Skip to content

Commit ac8567d

Browse files
committed
1 parent 2f42517 commit ac8567d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

arc.arc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,17 @@ See [[atomic]]."
954954
(= x 2 y 4)
955955
_)
956956

957+
(mac or= args
958+
`(do ,@(map [cons 'or-assign _] (pair args))))
959+
960+
(mac or-assign (slot value)
961+
`(atomic
962+
,(if (ssyntax slot)
963+
`(or-assign ,(ssexpand slot) ,value)
964+
(alist slot)
965+
`(or ,slot (= ,slot ,value))
966+
`(or (if (bound ',slot) ,slot) (= ,slot ,value)))))
967+
957968
(def lastcons (xs)
958969
"Returns the absolute last link of list 'xs'. Save this value to efficiently
959970
append to 'xs'."
@@ -2750,11 +2761,6 @@ of 'x' by calling 'self'."
27502761
(3 4)
27512762
(4)))
27522763

2753-
(mac or= (place expr)
2754-
(let (binds val setter) (setforms place)
2755-
`(atwiths ,binds
2756-
(or ,val (,setter ,expr)))))
2757-
27582764
(defextend iso (x y) (isa x 'table)
27592765
(and (isa x 'table)
27602766
(isa y 'table)

0 commit comments

Comments
 (0)