[plt-scheme] New to PLT Redex. Need some help.

From: Hari Prashanth (mail.prashanthkr at gmail.com)
Date: Sat Oct 17 00:39:54 EDT 2009

Hi Everyone,
I took the code given in the Redex website (
http://redex.plt-scheme.org/lam-v.html) and made the following changes to
it.
1. changed number pattern to string

2. Instead of +(in reduction-relation), I used string-append

3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any other
string except "true".

And called traces like this

(traces red
        (term
         ((λ (n)
            (if0
             n
             1
             ((λ (x) (x x))
              (λ (x) (x x)))))
          (+ "2" "2"))))...

But it did not reduce the expression in any way. Basically The output was
just
((λ (n)
            (if0
             n
             1
             ((λ (x) (x x))
              (λ (x) (x x)))))
          (+ "2" "2")).

Where am I going wrong?

How can I use symbol instead of string? When I used symbol, I got an error
saying expected a non-terminal pattern but got one of Expr, Var, Val, Cntxt
in symbol_1.
Why did I get that error?

Can someone throw some light on it.

Thanks
Hari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20091017/3cde335f/attachment.html>

Posted on the users mailing list.