[racket-dev] API naming conventions (Push #25466)

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Oct 16 18:24:57 EDT 2012

Two hours ago, Sam Tobin-Hochstadt wrote:
> `match-define*` would be much worse -- it isn't a variant on
> `match-define`, nor does it resemble any of the other `match-X`
> forms.

The difference is very similar to the difference between
`match-lambda', `match-lambda*', and `match-lambda**', in that they're
both `define'-like forms only one has the extra (...) syntactic sugar.

But this is not as important as the fact that an API with both
`define/match' and `match-define' in it is a bad idea.  More than
that, if you really view them as things that are so different, then
you should agree that this is a bad confusion.

If you want more ideas, then maybe `match-defun' or `match-defn' or
simply `match-define-function'.  In any case, if you don't see why
having the two current names is bad, then please find someone who
does, and please¹⁴⁹ find a good name.

An hour ago, Neil Van Dyke wrote:
> John Clements wrote at 10/16/2012 04:51 PM:
> > Data point: I have no idea what define/match does, and the name by
> > itself does nothing to enlighten me.
> Another data point: If "define/match" expands to a "define" of a
> procedure that dispatches to a set of implementations based on a
> pattern-match of actual arguments... then the name is exactly what
> I'd expect for such a feature in a Scheme dialect.

The problem is not in knowing what it does -- it's in knowing how it
is different from `match-define'.

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

Posted on the dev mailing list.