Skip to content

Add this test for stacked 'apply' #447

Description

@masak

Rarely used in practice, it is nevertheless completely legal and well-defined to apply an apply, as if it were a function and not a hybrid between a special form and an evaluator special case:

$ bel
Language::Bel 0.63 -- msys.
> (set L '(1 2 3 4))
(1 2 3 4)
> (list L)
((1 2 3 4))
> (apply list L)
(1 2 3 4)
> (apply apply list L)
(1 2 3 . 4)
> (apply apply apply list L)
(1 2 3 lit num (+ (t t t t) (t)) + nil (t))
> (apply apply apply apply list L)
(1 2 3 lit num (+ (t t t t) (t)) + nil t)
> (apply apply apply apply apply list L)
*hangs*

I can kind of explain all the results to myself, except for the final hang. A guess is that we're expecting a nil at the end and never get it. Need to confirm this with a strict reading of the bel.bel evaluator source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions