[plt-dev] some Racket proposals & implementation

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Apr 5 12:01:00 EDT 2010

On Apr  5, Robby Findler wrote:
> Something like that seems okay. I thought the proposal was for:
> (define (ufo #:posn p #:vel [vel (velocity 0 0)]))
> to be a define-struct (because it has no body).

What I suggested was

  (define-struct (ufo #:posn p #:vel [vel (velocity 0 0)]))

I also talked about

  (define (ufo #:posn p #:vel [vel (velocity 0 0)]) #:struct)

but not seriously.  Matthias took this further as a point against

On Apr  5, Matthias Felleisen wrote:
> #:super I dislike a lot. I much prefer
> (define-struct struct-name super-name (fields-as-parameters))

IMO removing the parentheses around the fields makes more sense:

  (define-struct ufo #:posn p #:vel [vel (velocity 0 0)])


  (define-struct (ufo player) #:posn p #:vel [vel (velocity 0 0)])

because it's far more common (from a lisp perspective).

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

Posted on the dev mailing list.