Deutsch   English   Français   Italiano  
<875xtl0wsf.fsf@nightsong.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Paul Rubin <no.email@nospam.invalid>
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=
Bytes: 2013

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.