System/Words

Ever needed to create a function that has a refinement with the same name as an existing word or function in REBOL?

All words are stored in SYSTEM/WORDS, so if you need to, you can access every function or data using that path:

>> system/words/now
== 2-Dec-2007/8:12:36+1:00


So if you have a function with a refinement called FALSE, the normal FALSE word inside the function will be overridden with the state of the refinement. To access it again, use SYSTEM/WORDS/FALSE:

test: func [a b /false] [
a + b ; exciting, but irrelevant stuff happens here.

; this function should return false when /false is used
either false [system/words/false][true]
]


Outside the function, FALSE behaves like normal. Enjoy!
|