Re: Why don't people like lisp?

Liste des GroupesRevenir à cl lisp 
Sujet : Re: Why don't people like lisp?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.lisp
Date : 04. Jul 2024, 08:57:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240703234106.863@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-04, Jeff Barnett <jbb@notatt.com> wrote:
I believe that (max) and (min) would work just fine in CL if including
the IEEE infinities was required to be conforming. Without them or
something similar, it would be hard to make a sensible definition.
>
Also refresh my memory: doesn't CL define a map-like function that looks
like (MAP! binary-op list identity-element) so that:
     (MAP! #'+ list 0) is the sum of the elements in the list
     (MAP! #'* list 10 is the product of the elements in list
     (MAP! #'max list -oo) is the max element in the list
     (MAP! #'min list +oo) is the minimum element in the list
     (MAP! #'append list nil) is the list made by appending the sublists
                              of list
     etc.
In all of these if the list argument is nil, the result is the identity
element.

(reduce #'+ list :initial-value 0)

- If :initial-value is present it's as if it is prepended to the list.

- When the effective list (main input plus any initial value)
  contains only one element, that element is returned without the
  function being called.

- When the effective list is empty (main input is empty and no
  initial value is specified), reduce calls the function with
  no arguments to obtain the identity element, which is returned.
  This obviously works for + and *.

- :from-end t can be used to obtain a right reduction.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
28 Jun 24 * Re: Why don't people like lisp?17B. Pym
29 Jun 24 `* Re: Why don't people like lisp?16HenHanna
29 Jun 24  `* Re: Why don't people like lisp?15Jeff Barnett
30 Jun 24   +- Re: Why don't people like lisp?1HenHanna
3 Jul 24   `* Re: Why don't people like lisp?13Paul Rubin
3 Jul 24    `* Re: Why don't people like lisp?12Lawrence D'Oliveiro
3 Jul 24     `* Re: Why don't people like lisp?11Paul Rubin
3 Jul 24      +- Re: Why don't people like lisp?1Jeff Barnett
3 Jul 24      `* Re: Why don't people like lisp?9Lawrence D'Oliveiro
3 Jul 24       `* Re: Why don't people like lisp?8Paul Rubin
4 Jul 24        `* Re: Why don't people like lisp?7Lawrence D'Oliveiro
4 Jul 24         `* Re: Why don't people like lisp?6Paul Rubin
4 Jul 24          +* Re: Why don't people like lisp?3Lawrence D'Oliveiro
4 Jul 24          i+- Re: Why don't people like lisp?1Paul Rubin
4 Jul 24          i`- Re: Why don't people like lisp?1Ben Bacarisse
4 Jul 24          `* Re: Why don't people like lisp?2Jeff Barnett
4 Jul 24           `- Re: Why don't people like lisp?1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal