[REBOL] Re: Storing a logical condition

2003-10-21 Thread Joel Neely
Hi, Brett, Actually, you remind me of another point which I failed to raise... Brett Handley wrote: ... result encourages one to use a form that has the least effect on the parent/calling expression - whether you evaluate the condition early eg: condition-result: dummy = 1 or you

[REBOL] Re: Storing a logical condition

2003-10-20 Thread Joel Neely
Hi, Tim, and all! My buffer overflowed, but maybe this is still worth posting... Tim Johnson wrote: * Brett Handley [EMAIL PROTECTED] [031013 16:42]: Like Ingo's observation, it is significantly faster too - significant if you have a million iterations ;^) timeit [repeat i 100 [do

[REBOL] Re: Storing a logical condition

2003-10-20 Thread Gregg Irwin
Thanks for doing that Joel! Your benchmarks are always instructional and valuable to me. -- Gregg -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.

[REBOL] Re: Storing a logical condition

2003-10-20 Thread Brett Handley
Yep! The winner is the lowly, plain-vanilla function! At least for this simple case, the fastest way to defer the evaluation of an expression is simply to make that expression the body of a function with no parameters! Thanks for that work Joel. That is something useful to know. I like the

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Tom Conlin
either do reduce b [][] On Mon, 13 Oct 2003, Tim Johnson wrote: Hello rebols: I'd like to store a logical condition in a block to evaluate at a later time by 'if or 'either Example code: a: 1 == 1 b: [a = 0] == [a = 0] either b[print b evaluates to 'true'][print b evaluates to

[REBOL] Re: Storing a logical condition

2003-10-13 Thread SunandaDH
Tim: What do I need to do so that my answer will be: b evaluates to 'false' If a is still has a value, when you come to check the condition, then all you need is a do after the either: a: 1 b: [a = 0] either do b [print b evaluates to 'true'][print b evaluates to 'false'] b evaluates to

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Ged Byrne
Hi Tim, --- Tim Johnson [EMAIL PROTECTED] wrote: Hello rebols: I'd like to store a logical condition in a block to evaluate at a later time by 'if or 'either Example code: a: 1 == 1 b: [a = 0] == [a = 0] either b[print b evaluates to 'true'][print b evaluates to 'false'] b

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Ingo Hohmann
Hi Tim and Tom, Tom Conlin wrote: either do reduce b [][] or first reduce b [][] Which is faster, around 2 tenths of a second in 100 iterations. (Even _if_ you care, you possibly won't care _that_ much ;-) Kind regards, Ingo On Mon, 13 Oct 2003, Tim Johnson wrote: Hello

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Tim Johnson
Thanks to both Sunanda and Tom: actually I found the following either (do b)[...][...] worked, but your inputs will help keep me out of trouble: especially Sunanda's observations... cheers! tim * [EMAIL PROTECTED] [EMAIL PROTECTED] [031013 12:51]: Tim: What do I need to do so that my answer

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Tom Conlin
then ... either pick reduce b 1[][] should make it really scream! ;^) On Mon, 13 Oct 2003, Ingo Hohmann wrote: Hi Tim and Tom, Tom Conlin wrote: either do reduce b [][] or first reduce b [][] Which is faster, around 2 tenths of a second in 100 iterations. (Even _if_ you

[REBOL] Re: Storing a logical condition

2003-10-13 Thread Tim Johnson
* Brett Handley [EMAIL PROTECTED] [031013 16:42]: Hi Tim, The ALL function is a candidate too: either all b ... Like Ingo's observation, it is significantly faster too - significant if you have a million iterations ;^) timeit [repeat i 100 [do b]] == 0:00:04.387