[plt-scheme] [redex] language keywords
Thanks all,
I'm moving to 'where' everywhere, and it seems to work. It's even much more readable with where clauses than with the collections of (nested) term-lets that I had.
-- Éric
On Jun 3, 2010, at 2:36 AM, Robby Findler wrote:
> It would be good to avoid term-let, I think, if you can use things
> like 'where' in the reduction relation instead. But we'd probably need
> to see an example use if you don't see how to do the transformation.
>
> Robby
>
> On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter <etanter at dcc.uchile.cl> wrote:
>> Yes, I do use term-let and that's (at least up to now) exactly where the
>> problem manifests!
>>
>> Should I be using something else?
>>
>> -- Éric
>>
>> On Jun 2, 2010, at 22:40, Casey Klein <clklein at eecs.northwestern.edu> wrote:
>>
>>> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund <cce at ccs.neu.edu> wrote:
>>>>
>>>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein
>>>> <clklein at eecs.northwestern.edu> wrote:
>>>>>
>>>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter <etanter at dcc.uchile.cl>
>>>>> wrote:
>>>>>>>>
>>>>>>>> Is there something as simple/direct as the list of keywords in
>>>>>>>> syntax-rules/syntax-case?
>>>>>>>> If not, any alternative suggestion?
>>>>>>>>
>>>>>>>> Thanks!
>>>>>>>>
>>>>>>>> -- Éric
>>>>>>>
>>>>>>> Take a look at variable-prefix. In my latest Redex work, variables
>>>>>>> all start with x, y, or z, and I just have to avoid any keywords that
>>>>>>> start with those.
>>>>>>
>>>>>> Thanks Carl,
>>>>>>
>>>>>> I'm using these as well, actually.
>>>>>> A problem I have is that, for readability, I have a non-terminal which
>>>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x)
>>>>>> for exactly the same, but it does enhance readability.
>>>>>> The problem is that >> is considered as a pattern variable...
>>>>>>
>>>>>> with macros I could just say:
>>>>>> (syntax-rules (>>)
>>>>>> ((x >> x) ...))
>>>>>>
>>>>>> Any idea?
>>>>>>
>>>>>
>>>>> I don't follow. The variables in a Redex pattern are always named
>>>>> after non-terminals, so I don't see how >> could be treated as a
>>>>> pattern variable.
>>>>>
>>>>> Do you mean that >> matches one of your six classes of variables?
>>>>
>>>> Is it possible Eric is using one of the forms that match using
>>>> syntax-case instead of the Redex pattern matcher? Do term-let and
>>>> where clauses still work that way?
>>>
>>> Oh, good thinking! term-let uses syntax-case, but where clauses no longer
>>> do.
>>>
>>>> (And if not, Eric, what version of PLT Scheme are you using?)
>>>>
>> _________________________________________________
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>