Introduce | pipe operator #126

Closed
opened 2025-06-30 16:26:23 +02:00 by riki · 0 comments
Owner

The goal is to be able to use any function as an infix, like so:

x |mod 2

(most languages spell it out as x | mod 2, but I think for us stylistically it's nicer to keep the | associated with the function name.)

x |mod 2 is equivalent to mod x 2. In the future we can think about extending this with a magic _ syntax, such that you can write x |mod 2 _ and get mod 2 x.

The goal is to be able to use any function as an infix, like so: ``` x |mod 2 ``` (most languages spell it out as `x | mod 2`, but I think for us stylistically it's nicer to keep the `|` associated with the function name.) `x |mod 2` is equivalent to `mod x 2`. In the future we can think about extending this with a magic `_` syntax, such that you can write `x |mod 2 _` and get `mod 2 x`.
riki added the
area/haku
goal/h2
labels 2025-06-30 16:39:30 +02:00
riki closed this issue 2025-09-03 23:31:57 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: riki/rkgk#126
No description provided.