Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Reduce question

 [1/3] from: rebol:ccsducto:ar at: 13-Apr-2006 13:13


Hi all, I don't understand this difference
>> a: 1
== 1
>> b: 2
== 2
>> f1: [a < b]
== [a < b]
>> reduce f1
== [true]
>> f2: to-block "a < b"
== [a < b]
>> reduce f2
** Script Error: a word has no context ** Near: a < b
>> = f1 f2
== true Can someone help me? Thanks César

 [2/3] from: greggirwin::mindspring::com at: 13-Apr-2006 12:58


Hi Cesar,
>>> f2: to-block "a < b"
CC> == [a < b]
>>> reduce f2
CC> ** Script Error: a word has no context CC> ** Near: a < b When you use TO-BLOCK, the words are not bound in any way. Notice that the error says that A has no *context*, it doesn't say it has no *value* (as an unset word would). You can use LOAD and it should work fine, though it depends on what you're trying to do. -- Gregg

 [3/3] from: carl::cybercraft::co::nz at: 14-Apr-2006 9:31


On Thursday, 13-April-2006 at 13:13:10 Cesar Chavez wrote,
>Hi all, I don't understand this difference >>> a: 1
<<quoted lines omitted: 13>>
>== true >Can someone help me?
Others can better explain why that doesn't work, but using LOAD on the string will give you the result you want...
>> a: 1
== 1
>> b: 2
== 2
>> f3: load "a < b"
== [a < b ]
>> reduce f3
== [true] -- Carl Read.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted