metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
128 stars 27 forks source link

Should variadics have to be `<end>`-able to return NULL from TAKE? #1057

Open hostilefork opened 4 years ago

hostilefork commented 4 years ago

A variadic argument may be quoted or evaluative (like any other argument).

If it is evaluative, then a TAKE that returned NULL could mean two things: either there was source material that evaluated to NULL -or- there was no more input to be gathered.

This inherent ambiguity suggests it's not clear that TAKE is a perfect operation for getting a variadic argument...or at least not one that is evaluative. The new behavior of EVAL(UATE) might be preferable, and restrict TAKE to quoted arguments only (though soft-quoted arguments straddle this definition).

In any case, these tests broke when TAKE was changed to return NULL without use of a special TAKE*:

    left-normal: enfixed right-normal:
        func [return: [<opt> word!] x [word! <...>]] [take x]

    (error? trap [| left-normal])
    (error? trap [right-normal |])

The issue requires some consideration. This consideration might mean that VARARGS! has distinct operators for dealing with it (?)

For now this test is commented out.