bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16963: A patch to create a list-with-tail primitive.


From: Drew Adams
Subject: bug#16963: A patch to create a list-with-tail primitive.
Date: Thu, 27 Jun 2019 20:30:27 -0700 (PDT)

> Oh, this reminds me I had started writing a patch for this.  I used the
> name cons* instead of list* though, I always found it more logical:
> cons* is cons repeated, just like let* is let repeated.  Let me dust it
> off:

The name has long been `list*' in Lisp, including
in Common Lisp.  That's the name that should (still)
be used, IMO.

http://clhs.lisp.se/Body/f_list_.htm

  list* is like list except that the last argument to list
  becomes the car of the last cons constructed, while the
  last argument to list* becomes the cdr of the last cons
  constructed. Hence, any given call to list* always
  produces one fewer conses than a call to list with the
  same number of arguments.

  If the last argument to list* is a list, the effect is
  to construct a new list which is similar, but which has
  additional elements added to the front corresponding to
  the preceding arguments of list*.

  If list* receives only one object, that object is returned,
  regardless of whether or not it is a list.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]