Skip to content

Commit

Permalink
Experimental support for + and - functions (joxa.std)
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk authored and ericbmerritt committed Jan 27, 2012
1 parent cb7725f commit 561738f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/joxa/std.jxa
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(module joxa.std
(require erlang lists))

(defn+ +(&rest args)
(case args
([x y]
(erlang/+ x y))
((a . b)
(lists/sum args))
(arg
arg)))

(defn+ -(&rest args)
(case args
([x y]
(erlang/- x y))
((a . b)
(lists/sum (lists/map (fn (x) (erlang/- 0 x)) args)))
(arg
arg)))

0 comments on commit 561738f

Please sign in to comment.