WeScheme

Has anyone ever used http://www.WeScheme.org/ ? We have to use it in our Computer Science class. (The class "taught" Java and now it is "teaching" Lisp/functional languages through Scheme).

The issue I am having is that many of the functions detailed in other Scheme tutorials and examples don't work in WeScheme. A noticeable one is the set! function. Here is an actual interaction:
> set!
I saw set!, which isn't supposed to be used as a bare expression. Rather, one example of its use is: (set! x 17).
at: line 1, column 0, in <interactions0>
> (define x 2)
> x
2
> (set! x 17)
reference to an identifier before its definition: set!
at: line 1, column 0, in <interactions3>
> x
2
Our instructor is just as confused. We have to use WeScheme because our assignments involve outputting images.
Last edited on
Lisp isn't a functional language (though Scheme might be, don't know that much about it, although since it's closely related to Lisp I doubt it is).

The way I understood it set! performs a mutation, so it's not really appropitiate anyways if you were going for functional programming.
Last edited on
it is "teaching" Lisp/functional languages through Scheme
We have to use WeScheme because our assignments involve outputting images
If you care about teaching a paradigm, then change the assignment.
You may use plt-scheme (aka racket) instead.

It's weird that you don't have set!, that it is provided by scheme/base. However I agree with hanst99.
Lisp isn't a functional language


Uhh, yea it is? It's not purely functional but it's definitely functional... Well actually it's multi-paradigm but FP is definitely it's more prominently featured style.
Lisp is mostly imperative and it uses a few techniques that are also common to functional programming. Just the fact that your language supports closures and higher order functions doesn't automatically make it functional.
I don't know what planet your Lisp comes from, but Lisp here on Earth was designed with a functional component, based upon the "Lambda Calculus". The ability to do many procedural and OO stuff does not make it 'not functional'. And, frankly, just because it is not pure or modern like Haskell or Racket doesn't mean anything. Lisp is one of the fathers of functional programming as we understand it today.

It does not appear that WeScheme permits mutable assignment directly. That is OK though, because you really don't need it.

What is it you are trying to do exactly? How does the use of images change it?
Lisp supports the functional paradigm (first class and higher order functions, lambdas, closures), and it also had quite an influence on modern functional languages. However, Lisp itself is not a functional language.

Note that when I say Lisp (unqualified) I am talking about Common Lisp, not Scheme or Clojure which are more on the functional side of the fence.
I don't have a strong opinion for myself, but it appears that wikipedia claims common lisp is a functional language.

http://en.wikipedia.org/wiki/Functional_programming
Wikipedia claims many things. The facts are that in CL (and in most other Lisp dialects) a 'function' is no more a mathematical function - that is, a mapping from a value of one set to a value of another set - than in C. In a functional language however, functions are exactly that. Functional programming is, of course, possible in Lisp - but that's true for C++ too (even before lambdas were introduced), and I don't see anyone arguing that C++ is a functional language.
Duoas wrote:
What is it you are trying to do exactly? How does the use of images change it?
I'm just frustrated that it forces usage of big-bang by removing set! and set-car! and set-cdr! and such. As far as I know, and I have done a lot of searching out of frustration, WeScheme is the only Scheme interpreter that supports image output.
Thanks for this!
Topic archived. No new replies allowed.