Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Cold hands, no gloves.


comp / comp.lang.lisp / Re: Why don't people like lisp?

SubjectAuthor
* Re: Why don't people like lisp?B. Pym
`* Re: Why don't people like lisp?HenHanna
 `* Re: Why don't people like lisp?Jeff Barnett
  +- Re: Why don't people like lisp?HenHanna
  `* Re: Why don't people like lisp?Paul Rubin
   `* Re: Why don't people like lisp?Lawrence D'Oliveiro
    `* Re: Why don't people like lisp?Paul Rubin
     +- Re: Why don't people like lisp?Jeff Barnett
     `* Re: Why don't people like lisp?Lawrence D'Oliveiro
      `* Re: Why don't people like lisp?Paul Rubin
       `* Re: Why don't people like lisp?Lawrence D'Oliveiro
        `* Re: Why don't people like lisp?Paul Rubin
         +* Re: Why don't people like lisp?Jeff Barnett
         |`- Re: Why don't people like lisp?Kaz Kylheku
         +- Re: Why don't people like lisp?Paul Rubin
         `- Re: Why don't people like lisp?Ben Bacarisse

1
Subject: Re: Why don't people like lisp?
From: B. Pym
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 21:54 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (B. Pym)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Fri, 28 Jun 2024 21:54:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <v5nbe0$3he95$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Fri, 28 Jun 2024 23:54:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b1ceb86ed3a735c50ed835e76e0169f9";
logging-data="3717413"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JA79nVq6ohOXO0UHfEtzz"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:Uao8F+Q0hjkzU4F+XmYZz2jNMTQ=
View all headers

Pascal Costanza wrote:

> > Indentation in Lisp is not clear enough. Let's look at an example from
> > http://www-users.cs.umn.edu/~gini/aiprog/graham/onlisp.lisp:
> >
> > (defun mostn (fn lst)
> > (if (null lst)
> > (values nil nil)
> > (let ((result (list (car lst)))
> > (max (funcall fn (car lst))))
> > (dolist (obj (cdr lst))
> > (let ((score (funcall fn obj)))
> > (cond ((> score max)
> > (setq max score
> > result (list obj)))
> > ((= score max)
> > (push obj result)))))
> > (values (nreverse result) max))))
> >
> > Note that only one pair of adjacent lines is indented by the same amount.
> > Other alignments are in the middle of lines.
> >
> > Here is a straightforward translation into my dream language; note that
> > there aren't a lot of parens despite insignificant indentation and despite
> > using braces (like C) instead of bracketing keywords (like Pascal):
> >
> > def mostn Fun [] = [], null;
> > def mostn Fun (First\List) {
> > var Result = [First];
> > var Max = Fun First;
> > each List ?Obj {
> > let Score = Fun Obj;
> > if Score > Max {Max = Score; Result = [Obj]}
> > if Score == Max {Result = Obj\Result}
> > };
> > reversed Result, Max
> > };
>
> Apparently, Paul Graham doesn't like CLOS nor the LOOP macro. Here is
> another verson in Common Lisp (and this is not a dream language ;):
>
> (defmethod mostn (fn (list (eql nil)))
> (declare (ignore fn list))
> (values nil nil))
>
> (defmethod mostn (fn list)
> (loop with result = (list (car list))
> with max = (funcall fn (car list))
> for object in (cdr list)
> for score = (funcall fn object)
> when (> score max) do (setq max score
> result (list object))
> when (= score max) do (push object result)
> finally return (values (nreverse result) max)))

Gauche Scheme

(use gauche.collection) ;; fold2

(define (max-by fn lst)
(if (null? lst)
(values '() #f)
(fold2
(lambda (x best worth)
(let ((score (fn x)))
(cond ((> score worth) (values (list x) score))
((= score worth) (values (cons x best) worth))
(#t (values best worth)))))
(take lst 1) (fn (car lst))
(cdr lst))))

(max-by (lambda(x) (modulo x 5)) '(22 23 24 25 26 27 28 29))

===>
(29 24)
4

Subject: Re: Why don't people like lisp?
From: HenHanna
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sat, 29 Jun 2024 02:48 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Fri, 28 Jun 2024 19:48:46 -0700
Organization: A noiseless patient Spider
Lines: 97
Message-ID: <v5nsmf$3nsv3$1@dont-email.me>
References: <v5nbe0$3he95$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 29 Jun 2024 04:48:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a284b8b9998909dad96ddd00bdf8ce4c";
logging-data="3929059"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gy91o8V/rZyKB+3OgREydfYv8GPSG5fs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:P4R35zHRftpW5jUBfKsGH1hNIYw=
In-Reply-To: <v5nbe0$3he95$1@dont-email.me>
Content-Language: en-US
View all headers

On 6/28/2024 2:54 PM, B. Pym wrote:
> Pascal Costanza wrote:
>
>>> Indentation in Lisp is not clear enough. Let's look at an example from
>>> http://www-users.cs.umn.edu/~gini/aiprog/graham/onlisp.lisp:
>>>
>>> (defun mostn (fn lst)
>>> (if (null lst)
>>> (values nil nil)
>>> (let ((result (list (car lst)))
>>> (max (funcall fn (car lst))))
>>> (dolist (obj (cdr lst))
>>> (let ((score (funcall fn obj)))
>>> (cond ((> score max)
>>> (setq max score
>>> result (list obj)))
>>> ((= score max)
>>> (push obj result)))))
>>> (values (nreverse result) max))))
>>>
>>> Note that only one pair of adjacent lines is indented by the same amount.
>>> Other alignments are in the middle of lines.
>>>
>>> Here is a straightforward translation into my dream language; note that
>>> there aren't a lot of parens despite insignificant indentation and despite
>>> using braces (like C) instead of bracketing keywords (like Pascal):
>>>
>>> def mostn Fun [] = [], null;
>>> def mostn Fun (First\List) {
>>> var Result = [First];
>>> var Max = Fun First;
>>> each List ?Obj {
>>> let Score = Fun Obj;
>>> if Score > Max {Max = Score; Result = [Obj]}
>>> if Score == Max {Result = Obj\Result}
>>> };
>>> reversed Result, Max
>>> };
>>
>> Apparently, Paul Graham doesn't like CLOS nor the LOOP macro. Here is
>> another verson in Common Lisp (and this is not a dream language ;):
>>
>> (defmethod mostn (fn (list (eql nil)))
>> (declare (ignore fn list))
>> (values nil nil))
>>
>> (defmethod mostn (fn list)
>> (loop with result = (list (car list))
>> with max = (funcall fn (car list))
>> for object in (cdr list)
>> for score = (funcall fn object)
>> when (> score max) do (setq max score
>> result (list object))
>> when (= score max) do (push object result)
>> finally return (values (nreverse result) max)))
>
> Gauche Scheme
>
> (use gauche.collection) ;; fold2
>
> (define (max-by fn lst)
> (if (null? lst)
> (values '() #f)
> (fold2
> (lambda (x best worth)
> (let ((score (fn x)))
> (cond ((> score worth) (values (list x) score))
> ((= score worth) (values (cons x best) worth))
> (#t (values best worth)))))
> (take lst 1) (fn (car lst))
> (cdr lst))))
>
> (max-by (lambda(x) (modulo x 5)) '(22 23 24 25 26 27 28 29))
>
> ===>
> (29 24)
> 4

How do i avoid using -99999 ???

(define (print x) (newline) (write x) (newline))

(define (max-by fn Lis) (maxBy fn Lis '() -99999))

(define (maxBy fn x cLis cMax)
(cond
((null? x) (cons (reverse x) cMax))
((= (fn (car x)) cMax) (maxBy fn (cdr x) (cons (car x) cLis) cMax))
((> (fn (car x)) cMax) (maxBy fn (cdr x) (list (car x)) (fn (car x))))
(else (maxBy fn (cdr x) cLis cMax))))

(print (max-by (lambda(x) (modulo x 5)) '(4 5 6 7 8 9 3 44)))
(print (max-by (lambda(x) (modulo x 5)) '(24 25 26 27 28 29 33 44)))

Subject: Re: Why don't people like lisp?
From: Jeff Barnett
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Sat, 29 Jun 2024 03:11 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Fri, 28 Jun 2024 21:11:58 -0600
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <v5nu23$3obdr$1@dont-email.me>
References: <v5nbe0$3he95$1@dont-email.me> <v5nsmf$3nsv3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sat, 29 Jun 2024 05:12:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5d16c124d67dcef1cafe70dc066a69b0";
logging-data="3943867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gTJZccZeSnHsgFWjkyBiNMWLegHE1Bec="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:76JZm5wLh8V51/DR0pqkI1EtSrE=
Content-Language: en-US
In-Reply-To: <v5nsmf$3nsv3$1@dont-email.me>
View all headers

On 6/28/2024 8:48 PM, HenHanna wrote:
> On 6/28/2024 2:54 PM, B. Pym wrote:
>> Pascal Costanza wrote:
>>
>>>> Indentation in Lisp is not clear enough. Let's look at an example from
>>>> http://www-users.cs.umn.edu/~gini/aiprog/graham/onlisp.lisp:
>>>>
>>>> (defun mostn (fn lst)
>>>>    (if (null lst)
>>>>        (values nil nil)
>>>>        (let ((result (list (car lst)))
>>>>              (max (funcall fn (car lst))))
>>>>          (dolist (obj (cdr lst))
>>>>            (let ((score (funcall fn obj)))
>>>>              (cond ((> score max)
>>>>                     (setq max    score
>>>>                           result (list obj)))
>>>>                    ((= score max)
>>>>                     (push obj result)))))
>>>>          (values (nreverse result) max))))
>>>>
>>>> Note that only one pair of adjacent lines is indented by the same
>>>> amount.
>>>> Other alignments are in the middle of lines.
>>>>
>>>> Here is a straightforward translation into my dream language; note that
>>>> there aren't a lot of parens despite insignificant indentation and
>>>> despite
>>>> using braces (like C) instead of bracketing keywords (like Pascal):
>>>>
>>>> def mostn Fun [] = [], null;
>>>> def mostn Fun (First\List) {
>>>>     var Result = [First];
>>>>     var Max = Fun First;
>>>>     each List ?Obj {
>>>>        let Score = Fun Obj;
>>>>        if Score >  Max {Max = Score; Result = [Obj]}
>>>>        if Score == Max {Result = Obj\Result}
>>>>     };
>>>>     reversed Result, Max
>>>> };
>>>
>>> Apparently, Paul Graham doesn't like CLOS nor the LOOP macro. Here is
>>> another verson in Common Lisp (and this is not a dream language ;):
>>>
>>> (defmethod mostn (fn (list (eql nil)))
>>>     (declare (ignore fn list))
>>>     (values nil nil))
>>>
>>> (defmethod mostn (fn list)
>>>     (loop with result = (list (car list))
>>>           with max = (funcall fn (car list))
>>>           for object in (cdr list)
>>>           for score = (funcall fn object)
>>>           when (> score max) do (setq max score
>>>                                       result (list object))
>>>           when (= score max) do (push object result)
>>>           finally return (values (nreverse result) max)))
>>
>> Gauche Scheme
>>
>> (use gauche.collection) ;; fold2
>>
>> (define (max-by fn lst)
>>    (if (null? lst)
>>      (values '() #f)
>>      (fold2
>>        (lambda (x best worth)
>>          (let ((score (fn x)))
>>            (cond ((> score worth) (values (list x) score))
>>                  ((= score worth) (values (cons x best) worth))
>>                  (#t (values best worth)))))
>>        (take lst 1) (fn (car lst))
>>        (cdr lst))))
>>
>> (max-by (lambda(x) (modulo x 5)) '(22 23 24 25 26 27 28 29))
>>
>>    ===>
>> (29 24)
>> 4
>
>
>
> How do i avoid using   -99999   ???
>
>
> (define (print x) (newline) (write x) (newline))
>
> (define (max-by fn Lis)    (maxBy fn Lis '() -99999))
>
> (define (maxBy fn x cLis cMax)
>  (cond
>   ((null? x)             (cons (reverse x) cMax))
>   ((= (fn (car x)) cMax) (maxBy fn (cdr x) (cons (car x) cLis) cMax))
>   ((> (fn (car x)) cMax) (maxBy fn (cdr x) (list (car x)) (fn (car x))))
>   (else                  (maxBy fn (cdr x) cLis cMax))))
>
> (print (max-by (lambda(x) (modulo x 5)) '(4 5 6 7 8 9 3 44)))
> (print (max-by (lambda(x) (modulo x 5)) '(24 25 26 27 28 29 33 44)))
In Common Lisp, symbolic constants were defined for the IEEE plus and
minus infinities. I don't recall the syntax at the moment but do
remember they were quite useful in making certain codes easier to read
and understand.
--
Jeff Barnett

Subject: Re: Why don't people like lisp?
From: HenHanna
Newsgroups: comp.lang.lisp, sci.lang
Organization: A noiseless patient Spider
Date: Sun, 30 Jun 2024 07:31 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.lang.lisp,sci.lang
Subject: Re: Why don't people like lisp?
Date: Sun, 30 Jun 2024 00:31:44 -0700
Organization: A noiseless patient Spider
Lines: 136
Message-ID: <v5r1l0$dpvt$2@dont-email.me>
References: <v5nbe0$3he95$1@dont-email.me> <v5nsmf$3nsv3$1@dont-email.me>
<v5nu23$3obdr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 30 Jun 2024 09:31:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b85dcc0c13748069fae9a1e48d50b27c";
logging-data="452605"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y+fdMbDRdH58ui0rk6qtVFzSwPBIF5OA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:3aN8uin3E+ICXRP//QGJUWcMHP4=
In-Reply-To: <v5nu23$3obdr$1@dont-email.me>
Content-Language: en-US
View all headers

On 6/28/2024 8:11 PM, Jeff Barnett wrote:
> On 6/28/2024 8:48 PM, HenHanna wrote:
>> On 6/28/2024 2:54 PM, B. Pym wrote:
>>> Pascal Costanza wrote:
>>>
>>>>> Indentation in Lisp is not clear enough. Let's look at an example from
>>>>> http://www-users.cs.umn.edu/~gini/aiprog/graham/onlisp.lisp:
>>>>>
>>>>> (defun mostn (fn lst)
>>>>>    (if (null lst)
>>>>>        (values nil nil)
>>>>>        (let ((result (list (car lst)))
>>>>>              (max (funcall fn (car lst))))
>>>>>          (dolist (obj (cdr lst))
>>>>>            (let ((score (funcall fn obj)))
>>>>>              (cond ((> score max)
>>>>>                     (setq max    score
>>>>>                           result (list obj)))
>>>>>                    ((= score max)
>>>>>                     (push obj result)))))
>>>>>          (values (nreverse result) max))))
>>>>>
>>>>> Note that only one pair of adjacent lines is indented by the same
>>>>> amount.
>>>>> Other alignments are in the middle of lines.
>>>>>
>>>>> Here is a straightforward translation into my dream language; note
>>>>> that
>>>>> there aren't a lot of parens despite insignificant indentation and
>>>>> despite
>>>>> using braces (like C) instead of bracketing keywords (like Pascal):
>>>>>
>>>>> def mostn Fun [] = [], null;
>>>>> def mostn Fun (First\List) {
>>>>>     var Result = [First];
>>>>>     var Max = Fun First;
>>>>>     each List ?Obj {
>>>>>        let Score = Fun Obj;
>>>>>        if Score >  Max {Max = Score; Result = [Obj]}
>>>>>        if Score == Max {Result = Obj\Result}
>>>>>     };
>>>>>     reversed Result, Max
>>>>> };
>>>>
>>>> Apparently, Paul Graham doesn't like CLOS nor the LOOP macro. Here is
>>>> another verson in Common Lisp (and this is not a dream language ;):
>>>>
>>>> (defmethod mostn (fn (list (eql nil)))
>>>>     (declare (ignore fn list))
>>>>     (values nil nil))
>>>>
>>>> (defmethod mostn (fn list)
>>>>     (loop with result = (list (car list))
>>>>           with max = (funcall fn (car list))
>>>>           for object in (cdr list)
>>>>           for score = (funcall fn object)
>>>>           when (> score max) do (setq max score
>>>>                                       result (list object))
>>>>           when (= score max) do (push object result)
>>>>           finally return (values (nreverse result) max)))
>>>
>>> Gauche Scheme
>>>
>>> (use gauche.collection) ;; fold2
>>>
>>> (define (max-by fn lst)
>>>    (if (null? lst)
>>>      (values '() #f)
>>>      (fold2
>>>        (lambda (x best worth)
>>>          (let ((score (fn x)))
>>>            (cond ((> score worth) (values (list x) score))
>>>                  ((= score worth) (values (cons x best) worth))
>>>                  (#t (values best worth)))))
>>>        (take lst 1) (fn (car lst))
>>>        (cdr lst))))
>>>
>>> (max-by (lambda(x) (modulo x 5)) '(22 23 24 25 26 27 28 29))
>>>
>>>    ===>
>>> (29 24)
>>> 4
>>
>>
>>
>> How do i avoid using   -99999   ???
>>
>>
>> (define (print x) (newline) (write x) (newline))
>>
>> (define (max-by fn Lis)    (maxBy fn Lis '() -99999))
>>
>> (define (maxBy fn x cLis cMax)
>>   (cond
>>    ((null? x)             (cons (reverse x) cMax))
>>    ((= (fn (car x)) cMax) (maxBy fn (cdr x) (cons (car x) cLis) cMax))
>>    ((> (fn (car x)) cMax) (maxBy fn (cdr x) (list (car x)) (fn (car x))))
>>    (else                  (maxBy fn (cdr x) cLis cMax))))
>>
>> (print (max-by (lambda(x) (modulo x 5)) '(4 5 6 7 8 9 3 44)))
>> (print (max-by (lambda(x) (modulo x 5)) '(24 25 26 27 28 29 33 44)))
>
> In Common Lisp, symbolic constants were defined for the IEEE plus and
> minus infinities. I don't recall the syntax at the moment but do
> remember they were quite useful in making certain codes easier to read
> and understand.

Thanks!!!

Yes, some Scheme implementations support negative infinity, often
denoted as -inf.0.

Here's a breakdown:

Concept: Negative infinity represents a value on the number line
that is infinitely far in the negative direction.

Representation: The specific notation for negative infinity can
vary depending on the Scheme implementation. However, -inf.0 is a common
representation, where:

-inf signifies negative infinity.

..0 indicates that it's an inexact number (as opposed to an exact
mathematical concept of negative infinity).

Not all Scheme implementations are guaranteed to support negative
infinity.

The latest Scheme standard, R7RS-small, recommends the use of +inf.0,
-inf.0, and +nan.0 for positive infinity, negative infinity, and
Not-a-Number, respectively.

Subject: Re: Why don't people like lisp?
From: Paul Rubin
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 23:49 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Tue, 02 Jul 2024 16:49:33 -0700
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <87msmzjqwi.fsf@nightsong.com>
References: <v5nbe0$3he95$1@dont-email.me> <v5nsmf$3nsv3$1@dont-email.me>
<v5nu23$3obdr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Wed, 03 Jul 2024 01:49:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="88cddf8af9c7125058ea83d38371ccbd";
logging-data="1948774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9C0d8noTV0XeXLZ170kXB"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:g604YY2JvIubMmyYptq1gGQw3qE=
sha1:vH8k1HgYvLpMO0stNuNjLgdz1zM=
View all headers

Jeff Barnett <jbb@notatt.com> writes:
> In Common Lisp, symbolic constants were defined for the IEEE plus and
> minus infinities. I don't recall the syntax at the moment but do
> remember they were quite useful in making certain codes easier to read
> and understand.

That's pretty horrendous either way (-99999 or -INF) . Better to return
an empty list in the event that that the input is empty. Also if I
understand the intention of that function, you really have to make two
passes through the list, which is simpler anyway.

Subject: Re: Why don't people like lisp?
From: Lawrence D'Oliv
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 23:59 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Tue, 2 Jul 2024 23:59:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <v62497$1rh22$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Jul 2024 01:59:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cf883433ea21f3408a2b17a5cac6794f";
logging-data="1950786"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IUD43ZGNGtxJtFk4RTuy7"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:bJP7lgtwNHA86dq1gJspspQm1W0=
View all headers

On Tue, 02 Jul 2024 16:49:33 -0700, Paul Rubin wrote:

> Jeff Barnett <jbb@notatt.com> writes:
>
>> In Common Lisp, symbolic constants were defined for the IEEE plus and
>> minus infinities.
>
> That's pretty horrendous either way (-99999 or -INF) . Better to return
> an empty list in the event that that the input is empty.

If a function like “max” or “min” is defined to return a number, then it
makes sense that the maximum of an empty list should be -∞, and the
minimum should be +∞. Being numbers, they can be compared with other
numbers in the usual way, and a lot of special cases no longer become
special.

Subject: Re: Why don't people like lisp?
From: Paul Rubin
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Wed, 3 Jul 2024 00:15 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Tue, 02 Jul 2024 17:15:56 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <87ed8bjpoj.fsf@nightsong.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>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Jul 2024 02:15:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="88cddf8af9c7125058ea83d38371ccbd";
logging-data="1948774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7vx/4iRTzhh3wzFw+o+1z"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:jXaU3pU4AedX1QxsY10fK82YQ8U=
sha1:9MuraAIRcJ0c6RiQnWEGr9JscBc=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> If a function like “max” or “min” is defined to return a number,

They are defined to return the larger or smaller of two members of any
datatype with an order relation, e.g. lexicographic order on strings.
There is no infinity for strings. There's also none for integers, for
that matter.

> then it makes sense that the maximum of an empty list should be -∞,

Meh, it's just undefined. Otherwise you can't tell whether the list is
empty or actually contains -∞ as a value.

> and a lot of special cases no longer become special.

More likely a lot of errors go undetected. Better to handle the special
cases in some sane way, if they can happen in the program and need
handling.

Subject: Re: Why don't people like lisp?
From: Jeff Barnett
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Wed, 3 Jul 2024 02:59 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Tue, 2 Jul 2024 20:59:24 -0600
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <v62eqe$20o3c$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Wed, 03 Jul 2024 04:59:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3f0e81d7c7223a14b0e1e4a4a70f956d";
logging-data="2121836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EVH64v8tRlRefCCQXl/p1G9+NCYT5tiw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fnZWhqQ89VCyTajlzRdvpd4J6Jo=
Content-Language: en-US
In-Reply-To: <87ed8bjpoj.fsf@nightsong.com>
View all headers

On 7/2/2024 6:15 PM, Paul Rubin wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> If a function like “max” or “min” is defined to return a number,
>
> They are defined to return the larger or smaller of two members of any
> datatype with an order relation, e.g. lexicographic order on strings.
> There is no infinity for strings. There's also none for integers, for
> that matter.
>
>> then it makes sense that the maximum of an empty list should be -∞,
>
> Meh, it's just undefined. Otherwise you can't tell whether the list is
> empty or actually contains -∞ as a value.
Consider a SUM of a set of integers: mathematicians define that operator
to return 0 for the empty set
Similarly:
MAX empty-set = -oo
MIN empty-set = +oo
PRODUCT empty-set = 1
and, in general,
GROUP OPERATOR empty-set = group-identity-element
This convention makes a whole lot of sense because, for one thing, it
makes definition of indefinite number of argument functions very easy.
For example SUM nil = 0
and SUM (CONS x list) = x + SUM list
If you try this sort of definition for MAX, the only value in all known
mathematics that can replace 0 in the above is -oo.
If you want to get into details, what I've said here applies to abelian
groups; we need to be careful about order in other settings.
>> and a lot of special cases no longer become special.
>
> More likely a lot of errors go undetected. Better to handle the special
> cases in some sane way, if they can happen in the program and need
> handling.
PS oo is meant to stand for numerical infinity.
--
Jeff Barnett

Subject: Re: Why don't people like lisp?
From: Lawrence D'Oliv
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Wed, 3 Jul 2024 05:21 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Wed, 3 Jul 2024 05:21:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v62n5g$22598$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Jul 2024 07:21:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cf883433ea21f3408a2b17a5cac6794f";
logging-data="2168104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Tv4Pha5E8sdzSU4m74kz+"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:wCPecqMYtkTPrWmkklyGZrXp/Vg=
View all headers

On Tue, 02 Jul 2024 17:15:56 -0700, Paul Rubin wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>
>> then it makes sense that the maximum of an empty list should be -∞,
>
> Meh, it's just undefined. Otherwise you can't tell whether the list is
> empty or actually contains -∞ as a value.

If it does contain that as a value, then it obviously doesn’t contain any
other values. There is an infinity of combinations of arguments to max
that give -∞ as the function result; what’s so special about
distinguishing the empty argument list?

Subject: Re: Why don't people like lisp?
From: Paul Rubin
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Wed, 3 Jul 2024 20:29 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Wed, 03 Jul 2024 13:29:21 -0700
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <87y16ii5i6.fsf@nightsong.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>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 03 Jul 2024 22:29:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="88cddf8af9c7125058ea83d38371ccbd";
logging-data="2478755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YqDWoVlFnvU1gwA5WAjoV"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:mO06HwxkBoJRMw5G2U8VeF8jpVg=
sha1:Q07sA88YBGTkxf+kxZ1+zpUB2GY=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> There is an infinity of combinations of arguments to max that give -∞
> as the function result; what’s so special about distinguishing the
> empty argument list?

max is a two-argument function, just like +. If you don't have two args
to give it, there is no result.

Subject:
From:
Newsgroups:
Date: Sat, 18 Jan 2025 06:57 UTC
View all headers

Subject: Re: Why don't people like lisp?
From: Paul Rubin
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 01:11 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Wed, 03 Jul 2024 18:11:35 -0700
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <87tth6hsfs.fsf@nightsong.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>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Jul 2024 03:11:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7141b374169c5e86e3f3381b7c9b90bd";
logging-data="2564348"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JY3VV8iK2A5EtH+6cMLZV"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:YRJ7lHVHuo/zSwp3PLY05lrK8Eo=
sha1:SqO1XcOCF/RA2vmyr0KtykUWK/o=
View all headers

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.

Subject: Re: Why don't people like lisp?
From: Jeff Barnett
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 06:12 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
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>
View all headers

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

Subject: Re: Why don't people like lisp?
From: Kaz Kylheku
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 06:57 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
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=
View all headers

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

Subject: Re: Why don't people like lisp?
From: Paul Rubin
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 19:41 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Thu, 04 Jul 2024 12:41:52 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <875xtl0wsf.fsf@nightsong.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>
<v64uv5$2erlp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Jul 2024 21:41:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7141b374169c5e86e3f3381b7c9b90bd";
logging-data="3046658"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/jFVGS3Zh0JBTgsObT79g"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:qylfXxK/2uhfQAIsj1LY2mcTG5I=
sha1:d5jnk09sKJoONE6hroC71iBQNT8=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> In Haskell, max always takes two args of an ordered type, and maximum
>> takes a list arg.

> Seems unnecessary to have two functions when one will do.

In Haskell that doesn't really make sense. Haskell functions actually
all take only one arg. Multi-arg functions work by currying. So
"max [1,2,3]" gives a function that compares [1,2,3] to a list you
supply. The default order relation on lists compares lexicographically.

> But then, Python max and min work for things besides numbers.

Yeah I was surprised to find that in Lisp and Scheme, they only work on
numbers. Haskell has an Ord typeclass, which is like an interface for
datatypes that support comparison. max and min work for any type that
implements Ord.

Subject: Re: Why don't people like lisp?
From: Ben Bacarisse
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 19:52 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.lisp
Subject: Re: Why don't people like lisp?
Date: Thu, 04 Jul 2024 20:52:33 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <871q49vsse.fsf@bsb.me.uk>
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>
<v64uv5$2erlp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Jul 2024 21:52:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b0d7afae60ab6b97749d31579332c9a3";
logging-data="3047141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JpazngK1KJH0gV4FYkkK3YxXjWxeOPaI="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:dcr/OeEO9W4CR+9t7ibff1mzDuY=
sha1:dcDjuMB558kIuJQUNVdVMixqi4E=
X-BSB-Auth: 1.b77543c59c3f806eafeb.20240704205233BST.871q49vsse.fsf@bsb.me.uk
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:

> On Wed, 03 Jul 2024 18:11:35 -0700, Paul Rubin wrote:
>
>> 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.
>
> Seems unnecessary to have two functions when one will do.

Haskell is a typed language so the two functions are quite different,
though the list version can be trivially defined from the binary
function.

--
Ben.

1

rocksolid light 0.9.8
clearnet tor