[plt-scheme] Does anyone use `set!' and `get!' patterns?

From: Joe Wells (jbw at macs.hw.ac.uk)
Date: Sun Mar 9 15:05:13 EDT 2008

Richard Cobbe <cobbe at ccs.neu.edu> writes:

> If you follow the standard convention that ML's ref cells are equivalent to
> PLT's boxes, then you can do the kind of match that you describe without
> `get!' and `set!' patterns:
>     [perdita:~]$ mzscheme
>     Welcome to MzScheme v372 [3m], Copyright (c) 2004-2007 PLT Scheme Inc.
>     > (require (lib "match.ss"))
>     > (match (box 3)
>         [#&x x]
>         [else #f])
>     3
> I assume this behavior is still available in v4, but I haven't yet upgraded
> and so don't really know what the equivalent to (require (lib "match.ss"))
> is.

Thanks very much for this explanation!


Posted on the users mailing list.