[plt-scheme] Using the struct type identifier as a macro [PATCH]

From: Dimitris Vyzovitis (vyzo at media.mit.edu)
Date: Mon Nov 17 12:07:42 EST 2008

On Mon, 17 Nov 2008, Jens Axel Soegaard wrote:

> Dimitris Vyzovitis wrote:
>> On Mon, 17 Nov 2008, Dimitris Vyzovitis wrote:
>>> On Sun, 16 Nov 2008, Dave Herman wrote:
>>>> Does your patch also bind the struct name as an identifier macro so it 
>>>> can be used in a higher-order fashion? E.g.:
>>> 
>>> Not currently, but this is straightforward; I can add it.
>> 
>> Updated patch attached (svn12467, aka 4.1.3.1, but the affected files are 
>> the same in 4.1.2 so it should apply there as well)
> I am curious, how many tests in the test suite fails after this patch?
>
>   http://svn.plt-scheme.org/plt/trunk/collects/tests/

The patch is non-invasive: it modifies the default macro of the meta
struct to expand when there is a constructor identifier in the metadata 
instead of barfing.  So, unless there is a test that forcibly looks for a 
syntax error when using the struct type identifier, it shouldn't fail any.

For the match part, the struct type identifier is bound to syntax
anyway and hence not a match-expander.  So, unless you name a struct
in a way that shadows a builtin match rule there shouldn't be a
problem there either.

Did you run into a problem? (No, I haven't run the testsuite yet)

-- vyzo


Posted on the users mailing list.