Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Iteration in DrScheme

Name: Anonymous 2009-03-29 7:19

Okay, so I'm writing some shit in DrScheme (http://www.plt-scheme.org/, basically it's a derivative of LISP) and I'm trying to figure out how the fuck I should go about implementing iteration. I wrote some quite decent code using for loops to avoid the complicated recursion hell that LISP tends to subject you to but now that I go to run it, it keeps throwing up this error:

reference to undefined identifier: for

Basically, wtf is this shit? PLT Scheme guide section 11 is pretty clear that things like
(for ([i '(1 2 3)])
      (display i))
are perfectly valid scheme. Am I missing something painfully obvious, or is something really fucked up going on?

Name: Anonymous 2009-03-29 7:47

>>2

Yes, I know you can recite /prog/ memes. Can you give useful answers instead?

Oh, and to illustrate why I'm finding this so frustrating, that code which I posted, which the manual says works? Yeah, well if you copy and paste it into the scheme terminal then it still tells you for is an undefined identifier. I feel like there must be an import I'm missing or something, but I can't see anything in the manual page about requiring an import. And actually the idea of having to import a module in order to implement recursion just seems fucking ridiculous.

So yeah, anyone familiar with Scheme or LISP want to help? I don't want to have to write the (for (ident list) (procedure)) function by hand...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List