Skip to content

Commit

Permalink
rename flop to backward
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jun 20, 2024
1 parent 8d9d6c3 commit 1f660a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/compile/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,15 @@ impl Compiler {
self.push_instr(Instr::PushFunc(func));
}
}
Rear => {
Backward => {
let operand = modified.code_operands().next().unwrap().clone();
let (mut instrs, sig) = self.compile_operand_word(operand)?;
if sig.args != 2 {
self.add_error(
modified.modifier.span.clone(),
format!(
"{}'s function must be dyadic, but its signature is {}",
"Currently, {}'s function must be dyadic, \
but its signature is {}",
prim, sig
),
);
Expand Down
2 changes: 1 addition & 1 deletion src/primitive/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ primitive!(
/// It is experimental because it is unclear whether this is a desirable direction for the language.
/// ex: # Experimental!
/// : ¨⊂ 1 2
([1], Flop, Stack, ("flop", '¨')),
([1], Backward, Stack, ("backward", '¨')),
/// Call a function on two sets of values
///
/// For monadic functions, [both] calls its function on each of the top 2 values on the stack.
Expand Down
4 changes: 2 additions & 2 deletions src/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl Primitive {
use SysOp::*;
matches!(
self,
(But | Rear)
(But | Backward)
| (Orient | Coordinate | Astar | Fft | Triangle | Case)
| Sys(Ffi | MemCopy | MemFree | TlsListen)
| (Stringify | Quote | Sig)
Expand Down Expand Up @@ -851,7 +851,7 @@ impl Primitive {
| Primitive::By
| Primitive::Gap
| Primitive::But
| Primitive::Rear
| Primitive::Backward
| Primitive::Un
| Primitive::Under
| Primitive::Content
Expand Down

0 comments on commit 1f660a5

Please sign in to comment.