Skip to content

Infix call syntax for binary functions #8824

Closed
@bluss

Description

@bluss

Allow calling binary functions infix. Functions and method calls are enclosed by mandatory parantheses, and these obscure the logic of the code when nested.

Methods are already placed neatly (like operators) bewteen two objects (a .eq (b)) but with an infix call we can make this easier to read.

a.and(b.and(c.and(d)))

can be

a `and` b `and` c `and` d

and instead of overloading + for lists we can have

~[1,2,3] `concat` ~[2,3,4]

or a parser can use

AlNum `and` (AlNum `or` Hyphen)

Infix binary functions are simpler and have less drawbacks compared to arbitrary user operators. They are also more flexible than the builtin set of operators (that are limited in number and force call by &T).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions