I'm debugging a script which doesn't behave like I wished;
I'm writing a small debug utility function, which would print the 'word followed by its value. I wrote this:
debug: func [x] [print rejoin ['x " => " x] wait 0.5 ]
And, in my code, I'd like to call it simply like this:
phrase: "beer is good"
mots: parse phrase " "
debug phrase
foreach mot mots [
debug mot
;do something...
]
and I would dream that it would output on the console something like:
phrase => "beer is good"
mot => "beer"
mot => "is"
mot => "good"
but I can't find a way to retrieve the variable's original name, that is, its name out of the scope of the function.