Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hostilefork opened this issue Mar 3, 2020 · 0 comments
Open
Assignees
Labels

Comments

@hostilefork
Copy link
Member

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.

@hostilefork hostilefork self-assigned this Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant