views:

172

answers:

3

Hello.I am trying to put the following statement in Dr.Scheme:

{with {x {+ 5 5}} {+ x x}}

but I got an error:

expand: unbound identifier in module in: with

anyone could help me?Thanks.

+2  A: 

Are you trying to do this:

(let ([x (+ 5 5)] ) (+ x x ))

It would be really helpful if you could say what dialect of Scheme you are trying to use.

anon
Just to clarify: this is *NOT* Scheme!
Eli Barzilay
This may explain his previous question. I'd still like to know what Scheme dialect he's got Dr. Scheme set to, though.
anon
It's not a Scheme dialect at all. It's a language (there are actually a few of them) that is used in the PLAI textbook -- it has parenthesized syntax to make it easy to parse (with `read`), but curly braces are used to distinguish it from Scheme and prevent some confusion. But it's only a convention, and students are still confused, which is why the first thing I did in my version of the course is to enforce {}s and have them always come from strings.
Eli Barzilay
@Eli I understand that - but he must be using one of the Dr. Scheme built-in languages, and I'd quite like to know which, for future reference.
anon
The language that he would be using in this course is one of the languages specific to the textbook (see comment in the other question). However, there is nothing in this question that is related to that. (And if you're thinking about similar questions in the future, then the clear signs are the braces and using `with`.)
Eli Barzilay
+7  A: 

You're taking some PLAI-based course, and you confuse the language that you're working in (Scheme) with the language that you're implementing (WAE, or one of the extensions). These two are very different things, and the book uses curly braces in the latter to avoid confusion.

I can tell you from experience of teaching this class a number of times that it's a dangerous confusion, and the sooner you clarify things the better. If you leave it behind things might get more confusing in the near future. So spend some time on the differences between the two languages, and make sure that you know which parts of the book talk about which language.

Eli Barzilay
A: 

Eli is being needlessly argumentative. Neil Butterworth is making a good, simple point: when you post anything related to DrScheme, it usually helps to identify your language level up-front. It so happens that in this case, the language level is really not the issue at all. But Neil's right.

Shriram Krishnamurthi
This should be a comment to the above answer, not an answer in its own.
Orolin