| Deutsch English Français Italiano |
|
<20240703234106.863@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.lisp Subject: Re: Why don't people like lisp? Date: Thu, 4 Jul 2024 06:57:05 -0000 (UTC) Organization: A noiseless patient Spider Lines: 36 Message-ID: <20240703234106.863@kylheku.com> 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> <v65efj$2ktd2$1@dont-email.me> Injection-Date: Thu, 04 Jul 2024 08:57:05 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7d93d4bd8c515bc8a0f37a98cfd50244"; logging-data="2798451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5YjjlDSm8V1LnGyAseprHCUIk3JvY2Rs=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:+9dzRrDFUbsLb/UAehocm5d+2cQ= 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