Cool :-)
I started initialy by doing it "lispishly", but it apears to be extremely ineficient (but more elegant), due do a lot of copies newlisp have to make and carry along :
Code: Select all
(define (heads l)
(unique (map first l))
)
(define (members l class)
(filter (fn (x) (= class (first x))) l)
)
(define (doit l)
(map (fn (c) (members l c)) (heads l))
)
So, i still thinks newlisp is pragmatic, practical and useful, and
allow elegant "functional style" solutions, but it is often far far more efficient when doing things in the "imperative style". I like it, but like Haskell too ;-)
BTW, would you mind sharing your test list ?