> From: Lau B. Jensen <[email protected]>

> 
> 
> > Traditional lisp implements its lists as pairs:  The first element
> > of the list and a reference to the rest of the list.  This is
> > very different from how J implements lists, so I would expect
> > that translating data from one environment to the other would
> > involve some non-trivial overhead.
> >
> > Also, some lisp data  structures could not be translated directly
> > to J arrays, for example consider a circular list which has itself
> > for the "rest of the list" part.  But a J representation which
> > preserves this "feature" would be inefficient and clumsy for
> > most computational tasks.
> >  
> 
> Your knowledge of traditional lisps won't get you very far with Clojure. 
> Its not
> based on the cons cell for example.
> 
> If you want to gear up for Jisp, I recommend you read through Clojure.org,
> check out various links from Disclojure.org, and perhaps skim my blog.

IPersistentList... Really?

OK. Semantically, most of traversal and constructing features on Clojure
"lists" will still behave in a cons-like manner as in traditional Lisp.
The only difference, is that you can't mutate nodes (setq (car ...) ...).

http://clojure.org/functional_programming#toc3

This is somewhat similar to J (or maybe other APLs).
If you traverse a deeply boxed array and assign internal
elements to variables, it creates a shallow reference. But if 
you change the underlying object, it will create a copy.

J arrays are semantically immutable, but if a result of
a mutating operation (amending or appending) is assigned
to the same name, the implementation optimizes it to "in place"
effective mutation.


      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to