1

Something simple as this:

Welcome to DrScheme, version 4.2.3 [3m].
Language: Lazy Scheme; memory limit: 128 megabytes.

> (let ((x 2) (y 10))
   (+ x y))

#<promise>

> 

I press enter for the let expression, and it gives me the #<promise>. What am I doing wrong?

1 Answer 1

4

It says Language: Lazy Scheme;. I'm sure this means that you're using a variant of scheme that runs lazily - i.e. it doesn't evaluate an expression until the result is required. The way scheme will manage this internally will be by using scheme's promise mechanism - instead of returning the result of an expression, a promise to calculate the result later is returned. You should be able to get the result explicitly by calling force against this promise.

Here are a couple of references:

A non-lazy scheme will behave in the way you expect.

HTH

1
  • Hmm, I did a quick search on SO a few days ago and most people suggested DrHaskell as an IDE. On the language selection, that was the only one with Scheme in the name so I just chose that one. I guess it was the top most one "Module." Thanks
    – Justen
    Jan 20, 2010 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.