[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making 'eq' == 'eql' in bignum branch
From: |
Ken Raeburn |
Subject: |
Re: Making 'eq' == 'eql' in bignum branch |
Date: |
Tue, 28 Aug 2018 03:34:35 -0400 |
On Aug 27, 2018, at 22:25, Pip Cet <address@hidden> wrote:
>
> On Tue, Aug 28, 2018 at 1:50 AM Lars Ingebrigtsen <address@hidden> wrote:
>> But anyway, as Richard implies, it's a read syntax that's strangely
>> difficult to remember. Would it make sense to have a variable like
>> `positive-infinity' (etc) or `math-positive-infinity'? Or perhaps we'll
>> all start remembering it after seeing it sprinkled throughout the source
>> code after a while.
>
> How about making (min) = 1.0e+INF and (max) = -1.0e+INF? That would be
> easier to type, and it's mathematically correct. We could even
> optimize it in the bytecode compiler.
That’s great if you’re applying max or min to a possibly-empty collection of
values. But if you’ve got a loop where you’re tracking a minimum/maximum value
along with doing other stuff (possibly including computing the values you’re
looking for the minimum of), this may not help much.
If “1.0e+INF” is hard to remember, how about defining symbols “+inifinity” and
“-inifinity” (and if you want to get fancy with the Unicode, +∞ and -∞) with
the appropriate numeric values? I kind of like the nil idea too.
There’s no reason we couldn’t do some or all of the above. Only question is,
should “(min nil)” return nil or infinity?
Ken
- Re: Making 'eq' == 'eql' in bignum branch, (continued)
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Lars Ingebrigtsen, 2018/08/27
- Re: Making 'eq' == 'eql' in bignum branch, Pip Cet, 2018/08/27
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/27
- Re: Making 'eq' == 'eql' in bignum branch,
Ken Raeburn <=
- Re: Making 'eq' == 'eql' in bignum branch, Helmut Eller, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Stefan Monnier, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Pip Cet, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Herring, Davis, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Helmut Eller, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Pip Cet, 2018/08/29
- Re: Making 'eq' == 'eql' in bignum branch, Alan Mackenzie, 2018/08/31
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/31
- Re: Making 'eq' == 'eql' in bignum branch, Alan Mackenzie, 2018/08/31