From: Burton Samograd
Subject: What does elt stand for?
Date: 
Message-ID: <87he7yi8qd.fsf@kruhft.vc.shawcable.net>
Oldtimers,

I'm just perusing the coding style guide at lisp.org and am finding a
number of interesting functions and tips.  Some of the names are a bit
odd, and one that got me was elt.  Anybody care to elaborate on where
that name came from so I can have an association to remember it by?

Also, the hyperspec page for elt mentions aref.  Just to be sure that
I'm understandging things correctly, is an array a subtype of a
sequence? Vice versa?  Can aref be used on a sequence as well?

-- 
burton samograd
······@kruhft.dyndns.org
http://kruhftwerk.dyndns.org
From: Kent M Pitman
Subject: Re: What does elt stand for?
Date: 
Message-ID: <sfwel32e0m5.fsf@shell01.TheWorld.com>
Burton Samograd <······@hotmail.com> writes:

> I'm just perusing the coding style guide at lisp.org and am finding a
> number of interesting functions and tips.  Some of the names are a bit
> odd, and one that got me was elt.  Anybody care to elaborate on where
> that name came from so I can have an association to remember it by?
> 
> Also, the hyperspec page for elt mentions aref.  Just to be sure that
> I'm understandging things correctly, is an array a subtype of a
> sequence? Vice versa?  Can aref be used on a sequence as well?

It means "element".

Sequences (i.e., arrays and lists) are said to have elements.

A short name was picked for easier use.

AREF can be used only on arrays.

NTH can be used only on lists, though is often not recommended because
indexed access to lists takes linear time and can degrade the amount of
time an algorithm takes.

ELT can be used on both, though often is not the right operator
because of its propensity to slow things down if the sequence is a list.

You definitely would not implement MAP by having it iterate to the length
of a sequence calling ELT to do the extractions; rather, you'd decide if
the object was a list or an array and then either cdr down the list (if it
was one) or used indexed array access via AREF (if it was that instead).