[racket-dev] The `var` pattern in `match`

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu Nov 29 13:45:23 EST 2012

On Thu, Nov 29, 2012 at 10:40 AM, David Van Horn <dvanhorn at ccs.neu.edu> wrote:
> On 11/29/12 7:31 AM, Carl Eastlund wrote:
>>
>> Having something like the "var" pattern can be useful for macros that
>> expand into uses of match, if the macro doesn't want to expose that a
>> bound variable will be a match pattern and therefore must not be "_" or
>> "...".  Granted, there are ways around this, but personally I think it
>> would be nice if match supported this pattern.  I would, however,
>> entirely support renaming this pattern to something more obscure, like
>> "match:pattern-variable" or something, so that unintentional uses stop
>> being a problem.
>
>
> I think the real solution is to have (whatever name you give) `var' be
> something that is matched as an identifier and not a literal so that
> programmers can rename the pattern.  But I know from talking with Sam this
> would be a big change for match.

Making `var` specifically be matched by binding would be possible --
it would be less of a change than removing it entirely.

--
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.