| Hey guys,
I am trying to extend + so that I can add an int to a list (each item of the list). So far I am using lib/extend.arc and I have: (extend + args
(and (isa (car args) 'int) (isa (cdr args) 'cons) (> (len (flat(cdr args))) 1))
(map [+ _ (car args)] (flat (cdr args))))
and it works fine with 1D matrices (lists). But I want to preserve my matrix structures. Like, I want to do: (+ 3 '((1 2) (3 4)))
and get ((4 5 ) (6 7)) instead I get (4 5 6 7) now.Any suggestions? |