Hi Thorsten,

> > You can genearate a list of value-key-pairs from a symbol's properties
> > with 'getl', but this will always return a freshly cons'ed list, not
> ...
> But what is the returned list ((VAL . KEY) KEY (VAL . KEY)) then? 
> 
> A property-list (not really, because its not part of the symbols
> internal cell structure)?

Right, in this sense it is not a property list. But if we obtained it
with 'getl', we know that it is a *copy* of a symbol's internal property
list.


> An association list because it is build of
> dotted pairs? Or just a list?

Just a list.


> Whats the difference to an association
> list, except of course that every alist is a list? When is a list not an
> alist in PicoLisp? Is a property list an alist because its elements are
> (reversed) dotted pairs?

No. An association list exists only in the head of a programmer. It
becomes manifested in the moment a programmer applies 'assoc' or 'asoq'
to it.

*Any* list can be an association list. Calling 'assoc' on a list makes
only sense, though, if it consists (at least partially) of cells where
the CARs should be searched for.

The above list ((VAL . KEY) KEY (VAL . KEY)) can be taken as an
association list if you want to search for the VAL elements.


> Are these all alists?
> 
> #+begin_src picolisp
> ((VAL . KEY) KEY (VAL . KEY))
> 
> (VAL KEY KEY VAL  KEY)
> 
> ((VAL . KEY) KEY VAL KEY))

Yes. 'assoc' ignores atomic list elements. So 'assoc' on the the second
list will always return NIL, no matter what the search key is.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to