[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making 'eq' == 'eql' in bignum branch
From: |
Lars Ingebrigtsen |
Subject: |
Re: Making 'eq' == 'eql' in bignum branch |
Date: |
Tue, 28 Aug 2018 03:33:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Clément Pit-Claudel <address@hidden> writes:
> I usually use 1.0e+INF and -1.0e+INF when I need a neutral element for
> min and max respectively, rather than most-positive-fixnum.
Hey, nice tip. I hadn't even considered those (well, I didn't know they
had a read syntax -- is that new?). And I've already started using them
where I would previously have used most-positive-fixnum, like in this
code I just found myself typing:
(cl-sort films '<
:key (lambda (e)
(or (getf e :year) 1.0e+INF)))
This sorts a list of films by year, and sorts the ones with unknown
(nil) years to the end. This would obviously previously have been a
problem in the year 2305843009213693951 CE on legacy 64-bit machines,
but my code is now future proof.
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.
Hm... Probably the latter.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: Making 'eq' == 'eql' in bignum branch, (continued)
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/26
- Re: Making 'eq' == 'eql' in bignum branch, Richard Stallman, 2018/08/27
- Re: Making 'eq' == 'eql' in bignum branch, Paul Eggert, 2018/08/27
- Re: Making 'eq' == 'eql' in bignum branch, Tom Tromey, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Richard Stallman, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Clément Pit-Claudel, 2018/08/28
- Re: Making 'eq' == 'eql' in bignum branch, Richard Stallman, 2018/08/29
- 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 <=
- 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, 2018/08/28
- 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