[racket] `def' ?

From: Luke Vilnis (lvilnis at gmail.com)
Date: Thu May 10 12:58:57 EDT 2012

+1000 to "def" idea

I think the super verbose keywords can be an impediment to code
readability. The increase in signal-to-noise, along with (imo) sexier
looking code samples to show to prospective Racketeers is worth it. As
silly as it might sound, when I started out, Scheme's notoriously long
keywords gave it a superficial appearance of impracticality.

;; hot!
(def x 12)
(def y 15)
(def z 12)
(+ x y z)

;; not!
(define x 12)
(define y 15)
(define z 12)
(+ x y z)

On a related note - if we're looking to shorten some offending keywords,
making a nice alias for "match-define" would be fantastic. It is a shame to
have to use a 12-letter keyword to get something that is accomplished with
"let" in other languages, especially since Racket's pattern matching is too
awesome not to use.  I sometimes define "val" or "mdef" as an alias for
"match-define", but I'm always too embarassed to let such code escape my
laptop.

On Thu, May 10, 2012 at 12:29 PM, Neil Van Dyke <neil at neilvandyke.org>wrote:

> Making new names for key things is a good time to revisit what those
> things look like and mean.
>
> I have no major requests for changes to "define", but perhaps someone else
> does.  (I do, however, have a major request for the "let" family, but not a
> lot of time at the moment to advocate it, unless someone is going to mess
> with "let" now.)
>
> Neil V.
>
>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/**users <http://lists.racket-lang.org/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120510/8703656f/attachment-0001.html>

Posted on the users mailing list.