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

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jul 26 13:18:04 EDT 2011

Yesterday, Matthew Flatt wrote:
> At Sun, 24 Jul 2011 14:44:24 +0200, Stephan Houben wrote:
> > [...] I find that summing comes up sufficiently
> > often to deserve its own compact syntax, so I propose:
> > 
> > ;; Solution 3
> > (require (planet "mathsymbols.rkt" ("stephanh" "mathsymbols.plt" 1 0)))
> > 
> > (Σ ([i (in-range 1 (add1 N))])
> >         (string-length (integer->string i)))
> 
> I agree. Unless there are objections, I plan to add `for/sum' and
> `for/product' with aliases `Σ' and `∏' to `racket/base' (as well as
> `for*/sum' and `for*/product' with aliases `Σ*' and `∏*').

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.  Maybe even `½', `¼', `¾', `-½' etc...

So how about some `racket/aliases' which is included in `racket' but
not in `racket/base' and adds some/all of these?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



Posted on the users mailing list.