Hi Pat,
>What is the meaning of thro?
>I have seen it here and there but never quite understood its purpose.
>
>Regards
>Patrick
>
>
>- Original Message -
>From: "Ladislav Mecir"
>
>
>
>>yes, it is useful. The following improvement uses the [throw] attribute
>>to make the behaviour of
Hi List,
What is the meaning of thro?
I have seen it here and there but never quite understood its purpose.
Regards
Patrick
- Original Message -
From: "Ladislav Mecir"
> yes, it is useful. The following improvement uses the [throw] attribute
> to make the behaviour of the function mo
AG> Hello all from a newcomer to this list,
Welcome Alain!
AG> Here is a function for only 1 condition but 3 cases : if it can be
AG> useful to anyone
AG> trif: func [
AG> condition
AG> iftrue [block!]
AG> iffalse [block!]
AG> ifnone [block!]
For more standard REBOL style, you
Hi Alain,
>Here is a function for only 1 condition but 3 cases : if it can be
>useful to anyone
>
>trif: func [
>
>
>...
>
>
>; example:
>print trif request "give an answer" ["yes"]["no"]["cancel"]
>
>by the way,
>is it good that "not none" equals "true" ?
>
>Alain Goyé.
>
>
yes, it is us
Hello all from a newcomer to this list,
Here is a function for only 1 condition but 3 cases : if it can be
useful to anyone
trif: func [
condition
iftrue [block!]
iffalse [block!]
ifnone [block!]
] [
do either condition [
iftrue
] [
either none? condition
Oops, should be > 3 cases.
Anton.
> do select reduce [...] is only better in code-size
> for > ~8 cases.
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.
Actually, I will change it to your suggestion
for this situation, because with only two/three cases
to select from, it is more efficient code.
do select reduce [...] is only better in code-size
for > ~8 cases.
Anton.
> Hi Anton,
>
> On Wednesday, December 17, 2003, 3:00:06 PM, you wrote:
>
> A
Hi, Maxim,
There's more to the story, although YMMV...
Maxim Olivier-Adlhoch wrote:
>
> describe: func [x [integer!] y [integer!]] [
> switch true compose [
> (x = 1) ["X is one"]
> (y = 1) ["Y is one"]
> (x = 2) ["X is two"]
> (y =
sorry for being late, but note that this works, straight out of the box:
describe: func [x [integer!] y [integer!]] [
switch true compose [
(x = 1) ["X is one"]
(y = 1) ["Y is one"]
(x = 2) ["X is two"]
(y = 2) ["Y is two"]
Thanks Joel, I think this is just what I need.
I don't think pif is a good name for it, though, it reminds
me of obscure unix commands, not very rebolish.
But what is a good name?
Perhaps something like "reselect" (because it's a bit
like a select reduce, but since that's not strictly true,
then t
Hi Anton,
On Wednesday, December 17, 2003, 3:00:06 PM, you wrote:
AR> do select reduce [
AR> event/shift [...]
AR> event/control [...]
AR> true [...] ; default
AR> ] true
any [
if event/shift [... true]
if event/control [... true]
(..
Hi, Anton,
Set the WayBack machine to 2000... ;-)
Anton Rolls wrote:
> I yearn (want), occasionally, a kind of any/switch-like
> flow-control function...
Some years ago we had a long discussion about generalizing IF on the
list, and kicked around various options/versions. The copy I could
lay
12 matches
Mail list logo