[REBOL] Re: If without a THEN
From: ryanc:iesco-dms at: 9-Aug-2001 14:09
Looked weird to me too, it never occurred to me to use 'if that way.
>> something: true
== true
>> reaction: [print "HOLY COW!"]
>> if something reaction
HOLY COW!
>>
Ryan Cole wrote:
> Your answer is that 'remove returns a block, so 'if gets the argument type it
> needs. No reason for error. The contents of the block at the position
> returned by remove are simply evaluated, in this case to effect other than
> returning the last value in the block, 12.
>
> --Ryan
>
> [Sanghabum--aol--com] wrote:
>
> > Hi all,
> >
> > Just purely out of curiosity, can anyone tell me why this badly-bracketed
> > code does anything other than give a message "Script Error: if expected
> > then-block argument of type: block"?
> >
> > myblock: [1 2 3 4 5 6 7 8 9 10 11 12]
> > foreach xx myblock [
> > if xx = 9
> > remove find myblock xx
> > ] ; for
> > print myblock
> >
> > --Thanks,
> > --Colin
> > --
> > To unsubscribe from this list, please send an email to
> > [rebol-request--rebol--com] with "unsubscribe" in the
> > subject, without the quotes.
>
> --
>
> Ryan Cole
> Programmer Analyst
> www.iesco-dms.com
> 707-468-5400
>
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400