Skip to content

Commit 235d769

Browse files
committed
rename with to but
1 parent 15f27e1 commit 235d769

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This version is not yet released. If you are reading this on the website, then t
2020
- Add the experimental [`fft`](https://uiua.org/docs/fft) function, which performs the Fast Fourier transform
2121
- The inverse FFT is also supported via [`un °`](https://uiua.org/docs/un)
2222
- Add the experimental [`astar`](https://uiua.org/docs/astar) modifier, which performs the A* pathfinding algorithm
23-
- Add the experimental [`with`](https://uiua.org/docs/with) modifier, which is a complement to [`on ⟜`](https://uiua.org/docs/on) and [`by ⊸`](https://uiua.org/docs/by)
23+
- Add the experimental [`but`](https://uiua.org/docs/but) modifier, which is a complement to [`on ⟜`](https://uiua.org/docs/on) and [`by ⊸`](https://uiua.org/docs/by)
2424
- Adjacent [`trace ⸮`](https://uiua.org/docs/trace)s now function as a single [`trace ⸮`](https://uiua.org/docs/trace) of more values
2525
- N+1 adjacent [`stack ?`](https://uiua.org/docs/stack)s now format to N [`trace ⸮`](https://uiua.org/docs/trace)s
2626
- Add the [`&camcap`](https://uiua.org/docs/&camcap) system function, which captures a frame from a camera

site/primitives.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@
414414
"class": "Planet",
415415
"description": "Call two functions on two distinct sets of values"
416416
},
417+
"but": {
418+
"glyph": "",
419+
"outputs": 1,
420+
"modifier_args": 1,
421+
"class": "Stack",
422+
"description": "Call a function but keep its last argument on the top of the stack",
423+
"experimental": true
424+
},
417425
"by": {
418426
"glyph": "",
419427
"outputs": 1,
@@ -1248,14 +1256,6 @@
12481256
"class": "DyadicArray",
12491257
"description": "The n-wise windows of an array"
12501258
},
1251-
"with": {
1252-
"glyph": "",
1253-
"outputs": 1,
1254-
"modifier_args": 1,
1255-
"class": "Stack",
1256-
"description": "Call a function but keep its last argument on the top of the stack",
1257-
"experimental": true
1258-
},
12591259
"xlsx": {
12601260
"args": 1,
12611261
"outputs": 1,

src/compile/modifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl Compiler {
447447
}};
448448
}
449449
match prim {
450-
Dip | Gap | On | By | With => {
450+
Dip | Gap | On | By | But => {
451451
// Compile operands
452452
let (mut instrs, sig) = self.compile_operand_word(modified.operands[0].clone())?;
453453
// Dip (|1 …) . diagnostic
@@ -488,7 +488,7 @@ impl Compiler {
488488
instrs.insert(0, Instr::Prim(Pop, span));
489489
Signature::new(sig.args + 1, sig.outputs)
490490
}
491-
prim if prim == On || prim == With && sig.args <= 1 => {
491+
prim if prim == On || prim == But && sig.args <= 1 => {
492492
instrs.insert(
493493
0,
494494
if sig.args == 0 {
@@ -543,7 +543,7 @@ impl Compiler {
543543
}
544544
Signature::new(sig.args.max(1), sig.outputs + 1)
545545
}
546-
With => {
546+
But => {
547547
let mut i = 0;
548548
if sig.args > 1 {
549549
instrs.insert(

src/primitive/defs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,11 +1685,11 @@ primitive!(
16851685
/// : [⫯+ 2 5]
16861686
/// : [⫯- 2 5]
16871687
///
1688-
/// [with] can be used to copy a value from deep in the stack, or to move it.
1688+
/// [but] can be used to copy a value from deep in the stack, or to move it.
16891689
/// ex: # Experimental!
16901690
/// : [⫯⊙⊙⊙∘ 1 2 3 4]
16911691
/// : [⫯⊙⊙⊙◌ 1 2 3 4]
1692-
([1], With, Stack, ("with", '⫯')),
1692+
([1], But, Stack, ("but", '⫯')),
16931693
/// Call a function on two sets of values
16941694
///
16951695
/// For monadic functions, [both] calls its function on each of the top 2 values on the stack.

src/primitive/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl Primitive {
386386
use SysOp::*;
387387
matches!(
388388
self,
389-
With | (Coordinate | Astar | Fft | Triangle | Case)
389+
But | (Coordinate | Astar | Fft | Triangle | Case)
390390
| Sys(Ffi | MemCopy | MemFree | TlsListen)
391391
| (Stringify | Quote | Sig)
392392
)
@@ -834,7 +834,7 @@ impl Primitive {
834834
| Primitive::Dip
835835
| Primitive::On
836836
| Primitive::By
837-
| Primitive::With
837+
| Primitive::But
838838
| Primitive::Gap
839839
| Primitive::Un
840840
| Primitive::Under

0 commit comments

Comments
 (0)