Search found 10 matches
- Thu Dec 30, 2010 3:44 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
TA doesn't give enough of a shit to do such things. You guys were my last hope. Thanks for trying though.
- Thu Dec 30, 2010 1:18 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
Sir, part of the problem I have is the interpreter only gives errors for unmatched parens. That's it. I'm using Xlisp-plus 3.04. If you have suggestions for some other interpreter, that would be wonderful. The project is due tonight, unfortunately. Trying your code now, will report back. Still nothi...
- Wed Dec 29, 2010 4:11 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
Oh, try this: Replace this: (defun interpret-program (program input) (third (interpret-statement-list program (list '(()) input nil)))) With this version: (defun interpret-program (program input) (destructuring-bind (memory input output) (interpret-statement-list program (list '(()) input nil)) (fo...
- Wed Dec 29, 2010 4:03 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
So. My TA has responded with the following, in reference to the read statement: (defun interpret-read-statement (read-variable state) (let ((memory (first state)) (input (second state) (output (third state)) (list (set-value memory read-variable "this is a phony read value!!!") input outpu...
- Wed Dec 29, 2010 7:28 am
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
I tried the read statement with the dummy line and its still not outputting -- I'm really stuck here. I did replace the statement-selection with the case statement, as it does read clearer. I just don't understand why the application of the variable/value pair refuses to be made. Perhaps what I real...
- Tue Dec 28, 2010 8:28 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
The skeleton code looked like the first post, minus the interpret-statement for if, while, and read. the read statement also did not exist -- I based it upon the write statement and added another atom, then tried to place that atom into variable. Clearly, it doesn't work. I'll give yours a try. Than...
- Tue Dec 28, 2010 5:17 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
Even with your simplificiations, will the read statement function? It still does not seem to respond to output when i try to read in a variable/value pair and then write it out. It does respond to math, but can't the LISP interpreter do that on its own? The important step for me is getting it to rea...
- Tue Dec 28, 2010 6:20 am
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
Actually, its an extra-credit project for a 300 level class. I've been having a lot of trouble with it -- the skeletal portion included everything except the read, if, and while handlers. I also modified the statement that determines which function to call. I'm required to use recursion instead of i...
- Mon Dec 27, 2010 3:21 pm
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
Re: A simple Lisp program
Let me clarify: For starters, I'd just like to get the "read" portion working, so I can get some meaningful input and output from xlisp. Thanks.
- Mon Dec 27, 2010 8:59 am
- Forum: Common Lisp
- Topic: A simple Lisp program
- Replies: 16
- Views: 14313
A simple Lisp program
So i'm writing a simple LISP program to interpret statements, for example in the form: ((interpret-program '(read x) (write x) '(21)) But i can't get any meaningful output, so i can't figure out what's going wrong. I'm completely new to functional languages; Though i've done plenty of reading, and c...