| Deutsch English Français Italiano |
|
<v65efj$2ktd2$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Jeff Barnett <jbb@notatt.com>
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Thu, 4 Jul 2024 00:12:02 -0600
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v65efj$2ktd2$1@dont-email.me>
References: <v5nbe0$3he95$1@dont-email.me> <v5nsmf$3nsv3$1@dont-email.me>
<v5nu23$3obdr$1@dont-email.me> <87msmzjqwi.fsf@nightsong.com>
<v62497$1rh22$1@dont-email.me> <87ed8bjpoj.fsf@nightsong.com>
<v62n5g$22598$1@dont-email.me> <87y16ii5i6.fsf@nightsong.com>
<v64o27$2dnqo$3@dont-email.me> <87tth6hsfs.fsf@nightsong.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 04 Jul 2024 08:12:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3e61778bce987d881465d3ccbeb45b0d";
logging-data="2782626"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SESQYe1a0PWRG2HNpa8xn+PjgY7MoX1A="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4Daday9aWVNLSrE/yPbENVKUkj8=
Content-Language: en-US
In-Reply-To: <87tth6hsfs.fsf@nightsong.com>
Bytes: 2631
On 7/3/2024 7:11 PM, Paul Rubin wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>> max is a two-argument function, just like +.
>> Not in all the good languages.
>
> Ah ok, yeah for the variadic versions in CL and Scheme, (max 2) gives 2
> but (max) throws a wrong-number-of-args error. In Haskell, max always
> takes two args of an ordered type, and maximum takes a list arg.
> maximum [2] gives 2 but maximum [] throws an empty list exception.
> maximum just applies max repeatedly, like using reduce in Lisp.
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.
--
Jeff Barnett