[racket-dev] Racket startup

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jun 28 10:20:33 EDT 2011

8 minutes ago, Neil Van Dyke wrote:
> Eli Barzilay wrote at 06/28/2011 09:52 AM:
> > This makes `MAIN' the Racket equivalent of Python's `__main__' thing.
> As for the name, if you could promise me that this name isn't a
> slippery slope to a proliferation of all-uppercase variable names...
> (By convention, I use all-uppercase for pattern variables in macro
> transformers, and that is the best use of them I've found so far.)

It's really just the first thing I could think of that wouldn't clash
with anything.  `__main__' is such an option too...  But more
seriously, I could only think of things like `on-run' or `script' or
something like that, which don't look as good.  In any case, `MAIN' is
in no way important.

> As for adding Python/Ruby/Perl-esque automagical behavior and hacks,
> I trust that people will do so with judicious hesitation.  Sometimes
> a hack is the most sensible way, but Racket is mostly not Hacket.

Well, by making the language provide it, and using the same semantics
of overriding bindings that came with your language to change it, it
gets (IMO) elevated from "a hack" to "a convenient feature".

Three minutes ago, Carl Eastlund wrote:
> The Racketish name would be #%main, wouldn't it?

Yes.  But the problem is that `#%foo' names are intended to be things
that you don't write in end-user code, only if you implement a new
language or change some fundamental thing.  In that respect, the `#%'
feels like serving the same role as `__', which feels dirty.  (I'm
also trying to imagine the first-time user impression being told to
define `#%main' vs `main' -- the first looks like it leads to an
impression of some perl-like language...)

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

Posted on the dev mailing list.