[racket] A question about code-style (and memory usage)

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 26 14:47:07 EDT 2011

On Tue, Jul 26, 2011 at 1:26 PM, Eli Barzilay <eli at barzilay.org> wrote:
> About a minute ago, Stephan Houben wrote:
>> On 07/26/2011 07:18 PM, Eli Barzilay wrote:
>> > On one hand I like such identifiers, but on the other there could be a
>> > lot more.  Just looking at random things, I can see `π', `→' or `⇒'
>> > (for `=>'), `≤', `≥', `…', `∞' and `-∞', `∊' (for `member'), `√', and
>> > many more.
>> I believe I have most of the obvious ones covered in mathsymbols.rkt
>> See http://planet.plt-scheme.org/package-source/stephanh/mathsymbols.plt/1/0/planet-docs/manual/index.html
>> for an overview.
> There's another issue there -- you'r binding such things as `≠', which
> are not functions so you're not doing just aliasing.

My opinions:

> Yet another
> question is whether things like `∊' and `∅' should be bound to set
> things or list things,

set, definitely. punning on sets vs lists is not a good habit, imo.

> and whether `∨' and `∧' should be bound to
> `and' and `or' or maybe they should be bound to `for/and' and
> `for/or'.  (There's also the cheap solution of looking for new
> characters like `⋎' and `⋏' but that's even more cheating...)

and and or, imo. The for/or and for/and ones should be "capitalized"
versions of those (ie, bigger ones somehow), if they exist.

>> > Maybe even `½', `¼', `¾', `-½' etc...
>> I considered adding those but in my opinion they would work better
>> as a proper extension of the reader, i.e. 2½ as an alternative
>> notation for 5/2 .
> Yeah, that's why I said "maybe" for these.  The same goes for `∞':
> you'd actually want not only that and `-∞' -- you'd also want `+∞'
> too, and the fact that you want all of these to be available for
> fractions too makes it very clear that a reader thing is more proper.

FWIW, I think that +∞ and -∞ should work and ∞ should not, given our
current Racket numeric tower and the spelling of these things that we
already have.


Posted on the users mailing list.