Skip to content

nesting #16

@goretkin

Description

@goretkin

There are some cases where I want something roughly like

(@fix (@fix 1 + _) / 3)((2,))

and

(@fix (@fix _ + _) / _)((1, 2), 3)

to work.

There needs to be a mechanism to prevent this nesting (that is, to maintain the current behavior). Currently

julia> (@fix (@fix _ + _) / _)
(::Fix{typeof(/),Tuple{Some{Fix{typeof(+),Tuple{Nothing,Nothing},NamedTuple{(),Tuple{}}}},Nothing},NamedTuple{(),Tuple{}}}) (generic function with 1 method)

and so the encoding for the nesting behavior should probably just not wrap the Fix{typeof(+),...} in Some. That is, I desire the following:

julia> (@fix Some(@fix _ + _) / _)
(::Fix{typeof(/),Tuple{Some{Fix{typeof(+),Tuple{Nothing,Nothing},NamedTuple{(),Tuple{}}}},Nothing},NamedTuple{(),Tuple{}}}) (generic function with 1 method)

and

julia> (@fix (@fix _ + _) / _)
(::Fix{typeof(/),Tuple{Fix{typeof(+),Tuple{Nothing,Nothing},NamedTuple{(),Tuple{}}},Nothing},NamedTuple{(),Tuple{}}}) (generic function with 1 method)

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