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:|
and it works fine with 1D matrices (lists). But I want to preserve my matrix structures. Like, I want to do:
(extend + args
(and (isa (car args) 'int) (isa (cdr args) 'cons) (> (len (flat(cdr args))) 1))
(map [+ _ (car args)] (flat (cdr args))))
and get ((4 5 ) (6 7)) instead I get (4 5 6 7) now.
(+ 3 '((1 2) (3 4)))