Hi, Laplace,

laplace wrote:
> 
> In rebol doc, it is said that function can know himself
> (its argument, its code) but I can't see how it can know
> just its name : it would seem logical that it is the firts
> thing it should know :) ?
> 

Given a value of type FUNCTION! it is possible to acquire its
argument list and body.

>> foo: func [x [integer!] y [string!]] [append/dup copy "" y x]
>> first :foo
== [x y]
>> second :foo
== [append/dup copy "" y x]
>> third :foo
== [x [integer!] y [string!]]

However...

A function doesn't have a name.  A function is a value, and
zero, one, or more words can refer to that value, but "name"
is not an attribute of a function in REBOL.

For the sake of analogy, it's like having a reference to a
string value and asking for its "name".

-jn-

-- 
; Joel Neely                             joeldotneelyatfedexdotcom
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to