views:

147

answers:

2

Hey i'm just trying to write some code in DrScheme: ((function (x) (* x x)) 2)

but i got a message saying: reference to undefined identifier: function

I'm using language "Essentials of Programming languages (3rd ed.)" and the version of DrScheme is 4.2.1

Thanks!

+3  A: 

umm... that is not Scheme. You probably want:

((lambda (x) (* x x)) 2)
newacct
ah, i copied the example code from An introduction to scheme (http://www.acm.org/crossroads/xrds1-2/scheme.html)should i switch to another intro..?
I see that at the bottom the document they say that "We finally note that the syntax we have adopted above is slightly different than that of standard Scheme...."
newacct
i see. thanks a lot! it works right now!
A: 

should probably be

((lambda(x)(* x x))2)

or

((fun(x)(* x x))2)
free-dom