rebol - type of literal words -


i reading bindology , tried this:

>> type? first ['x] == lit-word! >> type? 'x == word! 

i expected type? 'x return lit-word! too. appreciate insights.

a lit-word! if seen in "live" context evaluator resolves word itself. can used suppress evaluation single token when want pass word! value function. (of course, in own dialects when playing role of "evaluator", it's tinker-toy , can make mean whatever want.)

had wanted actual lit-word! have somehow suppress evaluator turning word!. noticed can achieved picking out of unevaluated block, such first ['x]. more "correct" way use quote 'x:

>> type? quote 'x == lit-word! 

beware odd bug known "lit-word decay":

>> x-lit: quote 'x >> type? x-lit == word! 

that has been corrected in red , pending correction in rebol. until have use get-word! extract lit-word value variable holding it:

>> x-lit: quote 'x >> type? :x-lit == lit-word! 

(you may have encountered practice way of fetching value of word vs. "running" through evaluator...as when want deal function's value vs. invoking it. should not necessary on values holding lit-word!. accident of history, seem.)


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -