David Coons wrote:
> Can someone please explain why the first result is word instead of logic,
and why the second prints anything at all?
>
> >> b: ["John" true "Sam" false]
> == ["John" true "Sam" false]
> >> print type? second b
> word

The reason is that the block pointed to by 'b is not evaluated. To get it to
behave as you expect, 'reduce the block, like this:

>> b: reduce ["John" true "Sam" false]
== ["John" true "Sam" false]
>> print type? second b
logic

> ...and why the second prints anything at all?
> >> if fourth b [print "OK"]
> OK

Because 'b is not evaluated, the type for the fourth word is:
>> type? fourth b
== word!

Anything not 'false or 'none is true:
>> make logic! fourth b
== true


>> b: ["John" true "Sam" false]
== ["John" true "Sam" false]
>> type? fourth b
== word!
>> b: reduce b
== ["John" true "Sam" false]
>> type? fourth b
== logic!
>> make logic! fourth b
== false
>> if fourth b [print "OK"]
== false

I hope that helps!

Andrew Martin
ICQ: 26227169
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
-><-

Reply via email to