Skip to content

Commit

Permalink
add subscript for tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Sep 17, 2024
1 parent b228eec commit ba86cb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions site/src/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ pub fn Experimental() -> impl IntoView {
subscript(Rows, "Operate on -N-rank rows", "# Experimental!\n≡₂□ °△2_3_4"),
subscript(Each, "Operate on N-rank rows", "# Experimental!\n∵₁□ °△2_3_4"),
subscript(Repeat, "Repetition count", "# Experimental!\n⍥₅(⊂⟜/+) [1 2]"),
subscript(Tuples, "Tuple size", "# Experimental!\n⧅₂< ⇡4"),
] }
</table>

Expand Down
6 changes: 5 additions & 1 deletion src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,11 @@ code:
_ => {
if !matches!(
prim,
Primitive::Both | Primitive::Repeat | Primitive::Rows | Primitive::Each
Primitive::Both
| Primitive::Repeat
| Primitive::Rows
| Primitive::Each
| Primitive::Tuples
) {
self.add_error(
span,
Expand Down
1 change: 1 addition & 0 deletions src/compile/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ impl Compiler {
Instr::ImplPrim(ImplPrimitive::UndoRerank, span)
];
}
Primitive::Tuples => before = eco_vec![Instr::push(n)],
_ => {}
}
}
Expand Down

0 comments on commit ba86cb3

Please sign in to comment.