On Wed, Apr 15, 2015 at 9:35 PM, Alexander D. Knauth
<[email protected]> wrote:
>
> On Apr 15, 2015, at 2:29 PM, Jon Zeppieri <[email protected]> wrote:
>
>> I'm trying to provide a struct, the struct type of which uses
>> prop:procedure and prop:match-expander, and I'd like the procedure to
>> have a contract.
>>
>> If I simply (provide <identifier>)
>
> Is this identifier the constructor function, or an instance of this struct?
> If it’s the constructor function, then couldn’t you use (provide 
> (contract-out [struct id ([field contract] …)])) for that?
> If it’s an instance, then are you doing something different to define it as a 
> transformer binding?
>

It's an instance of a struct. Here's the background: I have a struct
type, created with `struct`, which has its own constructor and match
expander. However, I don't want to use that constructor or match
expander as part of the public interface. (The struct contains some
fields that should be treated as private.) Now, the only way I know to
provide a single identifier that can act as both a struct constructor
and a match expander is to use a struct. So, in this case, I need to
use a *different* struct type, an instance of which can be used, on
one hand, as a procedure to construct an instance of the original
struct type, and on the other, as a match expander (also for the
original struct type).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to