> > On Mon, Dec 26, 2016 at 10:25 PM, Erik Gustafson <
Thanks Erik for the great explanation and the article!

On Mon, Dec 26, 2016 at 11:37:36PM -0500, Bruno Franco wrote:
> This might be a nice thing to add to the documentation too, since the
> function definitions don't mention it.
> difference with set is that setq does

'setq' is one of the prehistoric rocks of the Lisp language (like 'car' and
'cdr'). As you both said, it means "set quoted" or so.

Unfortunately, these old names are often not very consistent.

Consider 'member' versus 'memq'. Despite I got used to spell 'memq' as "mem
quick" in my head, the "q" in fact stems from the 'eq' function in other Lisps
(which is in turn '==' in PicoLisp). As you should know, 'member' uses 'equal'
for comparison (which is '=' in PicoLisp, i.e. a full, deep structure
comparison), while 'memq' uses pointer comparison and is thus considerably
faster.

The same meaning of "eq" (or "quick") have functions like 'delete' / 'delq',
'assoc' / 'asoq', 'case' / 'casq' or 'push1' / 'push1q'.

Keep in mind that speed of execution is only one aspect of pointer equality
operations. The other one is to distinguish between different physical objects,
like 'a' and "a", e.g. to achieve guaranteed locality.

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

Reply via email to