Re: maximize null list => 0?

David Scherfgen via Sbcl-help <[email protected]> Sun, 9 Nov 2025 02:04:23 +0100
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAMTHLKijy5hwCAd_Xgn_JKuh5K8ufbO4bmYMbK_HDXo4xa07bQ@mail.gmail.com>
Quoting https://www.lispworks.com/documentation/HyperSpec/Body/06_ac.htm:

If the maximize or minimize clause is never executed, the accumulated value
> is unspecified.


So an implementation is free to return 0 or any other value.

Best regards
David Scherfgen

Am So., 9. Nov. 2025 um 00:30 Uhr schrieb Jeff Cunningham <
[email protected]>:

> I just noticed that
>
>   (loop for i in '() maximize i) ; => 0
>
> Seems like this violate the Principal of Least Surprise. I thoutht it
> was going to return NIL. Given the maturity of Lisp, it must have been
> a design decision argued about in a committee. I'm curious if anyone
> knows what the rational was.
>
> -- Jeff
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help