Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Bug? 'func not really 'func Re:

From: g::santilli::tiscalinet::it at: 10-Oct-2000 12:53

[Al--Bri--xtra--co--nz] wrote:
> >> third :zot > == [ > "Defines a user function with given spec and body." > [catch] > spec [datatype!] {Help string (opt) followed by arg ... > ----^^^^^^^^^^^^^^^^ > Hmmmm... That seems a little odd?!
This is an old issue. Look:
>> type? first [block!]
== word!
>> third :func
== [ "Defines a user function with given spec and body." [catch] spec [block!] {Help string (opt) followed by arg wor...
>> fourth third :func
== [block!]
>> type? first fourth third :func
== datatype! When MAKE FUNCTION! processes the spec, it does not leave the type specifiers as words. Words are replaced by their values, while other values are replaced with their datatype. For example:
>> f: func [a ["A string"]] [] >> third :f
== [a [string!]] So, your BLOCK! above is not the word 'BLOCK! but the DATATYPE! BLOCK!; since its type is DATATYPE!, it is replaced by DATATYPE!. I think this should be considered as a bug, and DATATYPE! values should be left as they are. HTH, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/