Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit f0e3d72

Browse files
committed
2168 - '~=' for inequality
'!=' isn't an option. '<>' is kinda weird looking. Also, I don't want to further entangle assignment and comparison. '~=' is also kinda weird, and close to perl's '=~'. But at least it reads well.
1 parent c9bc685 commit f0e3d72

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

043check.wart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ let ($=) (=) # ignore later refinements
3131
(car.a = car.b)
3232
(cdr.a = cdr.b)))
3333

34+
alias (~=) ~equal
35+
3436
mac default(var val|to)
3537
`(or ,var
3638
(,var <- ,val))

044type.wart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def tag(type val)
2121
(list 'object type val)
2222

2323
def rep(x)
24-
if (or ~cons?.x (~equal 'object car.x))
24+
if (or ~cons?.x (car.x ~= 'object))
2525
x
2626
car:cddr.x
2727

045generic.wart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
let $mac mac
99
mac! mac(name params ... body)
10-
if (~equal car.body :case)
10+
if (car.body ~= :case)
1111
`(,$mac ,name ,params ,@body)
1212
`(let $super ,name
1313
(mac! ,name ,params

056sym.wart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def is_match(a b bindings) :case sym?.a
1818
(and (str.a.-1 = "_") # p_ matches any $p
1919
sym?.b
2020
(let acore (str.a 0 -1)
21-
(and (~equal acore str.b) # ..but not p
21+
(and (acore ~= str.b) # ..but not p
2222
(sym.acore = sym_root.b))))
2323
(and sym?.b
2424
(digit? str.b.-1) # (p_x p_x) matches two of any $p
2525
(withs (sa str.a
2626
ai (pos "_" (as list sa))
2727
acore (if ai (sa 0 ai)))
2828
(and ai
29-
(~equal acore str.b)
29+
(acore ~= str.b)
3030
(sym.acore = sym_root.b)
3131
(default bindings.a :to b)
3232
(bindings.a = b)))))

0 commit comments

Comments
 (0)