|
Pages: [1]
|
 |
|
Author
|
Topic: Function question (Read 394 times)
|
|
kpeters
|
Given a function as in:
go-first: does [ print "go-first" ]
How can I get it to print its name without having to supply it as a iteral to print?
TIA, Kai
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
Short answer: Functions do not have a name.
Long answer: hopefully someone else will have the time for the long answer...
|
|
|
|
|
Logged
|
|
|
|
|
Sunanda
|
Functions do not have names as Gabriele says....They are assigned to words which is a subtly different thing. You function could be assigned to many words, or none: go-first: go-next: go-last: does [print "who am i?" ] go-fifth: :go-next
blk: copy [] append blk does [print "who am i?" ] blk/1 But execution does have context, so this works in R2: go-first: does [print get in disarm try [0 / 0] 'where ] go-first == go-first It is not guaranteed to work in later versions of REBOL as the error handling may be overhauled.
|
|
|
|
|
Logged
|
|
|
|
|
kpeters
|
Thank you both for your time!
Regards, Kai
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |