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

[REBOL] Re: How to check function arguments? - Syntax REBOLution ...

From: christian:ensel:gmx at: 9-Jun-2002 22:44

Hello Gabriele, on Sunday, 09-Jun-02, 15:12:46, Gabriele Santilli wrote:
> REBOL does not support variable number of arguments because of its > freeform syntax.
As with all rules there seems to be an expection: The list of arguments to MAKE as specified by
>> source make
== make: native [ "Constructs and returns a new value." type [any-type!] "The datatype or example value." spec [any-type!] "The attributes of the new value." ] says there are exactly two arguments TYPE and SPEC, which is true in the case of
>> make block! 5
== [] But that given I really can't explain why
>> make function! [] ; two arguments, as suggested
** Script Error: Invalid argument: (missing value) ** Near: make function! [] fails and why instead of
>> make function! [[ ... ] [ ... ]] ; two arguments
- which one should consider to be what MAKE expects of us to do - we're all used to write
>> make function! [ ... ] [ ... ] ; three arguments
obviously violating the specification of make ... As said before, I really can't explain this to me. Looks as if all ANY-FUNCTION!s are equal, but some NATIVE!s are more equal ... Any ideas, somebody? Regards, Christian