On Fri, Jun 10, 2011 at 7:03 PM, Richard Lawrence
<richard.lawre...@berkeley.edu> wrote:
> Sam Tobin-Hochstadt <sa...@ccs.neu.edu>
> writes:
>
>> I'll try to respond more comprehensively about the more general
>> question, but for this:
>>> (define-type Variable (Pair 'var Symbol))
>>> (define-predicate variable? Variable)
>>
>> Just use a struct:
>>
>> (struct: variable ([s : Symbol]))
>>
>> Now you have `variable' and `variable?' and `variable-s', and there's
>> no confusion with pairs.  That's how I'd write this code.
>
> Ah, duh.  Thanks, Sam.  (I take it this means that the answer to my more
> general question is, ``No, you can't do that,'' but I'll be interested
> to read your response when you've got time to send it.)

As it turns out, the answer to the more general question is: we have
an experimental mechanism to do that, called refinement types, that
seems to be currently broken.  Once I fix it, I'll respond again.

-- 
sam th
sa...@ccs.neu.edu

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to