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

Path and contexts etc.

 [1/2] from: stefan:falk:slg:se at: 15-Feb-2001 16:44


Hi list! How come it behaves like this?
>> string1: "foobar"
== "foobar"
>> type? string1
== string!
>> to-path string1
== foobar
>> path1: to-path string1
== foobar
>> type? path1
** Script Error: foobar is not defined in this context. ** Where: type? path1 /Regards Stefan

 [2/2] from: larry::ecotope::com at: 15-Feb-2001 10:23


Hi Stefan, Good question. Just a quick comment, others may wish to expound further. Paths like functions are "hot", the interpreter tries to fully evaluate them when encountered. In your case the path evaluates to an . The interpreter then automatically tries to evaluate the word foobar, resulting in the error. You can prevent the full evaulation like this:
>> type? :path1
== path! or
>> type? get/any 'path1
== path! HTH -Larry