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

Pages: 1-

NEED LISP HALP

Name: Anonymous 2009-10-20 6:18

Hey /prog/riders,
for a school project i must write a LISP interpreter in JAVA. I've read SICP but there's no implementation of the interpreter in J2EE.
How can i do that?

ps : Sensei love enterprise quality code.

Name: Anonymous 2009-10-20 6:20

this is one of the strangest requests i've seen on /prog/ all week.

Name: Anonymous 2009-10-20 6:22

It's easy to write a metacircular one in Lisp, in only about a page of code. If you want to do it in Java or C, be prepared to write a few hundred lines at least. There's many of them floating around on the internet. Which Lisp to be precise? There's many of them, and they have different semantics and features, some easier and some harder to implement.

Name: Anonymous 2009-10-20 6:53

copy code of conjure .

Name: Anonymous 2009-10-20 7:14

Just write a simple recursive descent parser, it's rather simple for lisp. If you end up with more than about 500 lines of C code for the entire interpreter you are doing something wrong. As far as doing it in java, private static final String code = "
    #include <stdio.h>
    #include <stdlib.h>
    FILE* f;
    int main(int argc, char **argv) {
        if(argc <= 1) {
            fprintf(stdout, \"Usage: %s [filename]\", argv);
            exit(1);
        }
        f = fopen(*argv++);
        if(f == null) exit(1);
        readFile(f);
        sExpression();
        interpret();
        return 0;
    }";
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileOutputStream("lisperu.c")));
pw.write(code);
pw.close();
Runtime.getRuntime().exec("gcc -O3 -o lisperu ./lisperu.c");
Runtime.getRuntime().exec("./lisperu testProgram.lisp");

Name: Anonymous 2009-10-20 7:53

>>5
f = fopen(*argv++);
fail (I noticed you also wrote null instead of NULL but that is not enough for me to assume you're a retard; maybe you're coming from a lisp background or other, which is O.K. doing shitty mistakes with pointers is just newbiefucktastic. fuck off from /prog/

Name: Anonymous 2009-10-20 8:07

>>6
I think it's pretty obvious YHBT

Name: Anonymous 2009-10-20 8:20

Hey guys! Check this out!
The all-new LISP from Microsuss inc. will blow your socks off!

Name: Anonymous 2009-10-20 8:23

>>6
fopen(*++argv);
Thank you Mr. retard.

Name: Anonymous 2009-10-20 8:42

>>9
It still won't work, fopen takes two arguments.

Name: Anonymous 2009-10-20 9:22

>>10
And it must be a FILE *name struct.

Name: Anonymous 2009-10-20 9:46

                           //`'''```,
                 o        // LISP   `.,
           ,....OOo.   .c;.',,,.'``.,,.`
        .'      ____.,'.//
       / _____  \___/.'
      | / ||  \\---\|
      ||  ||   \\  ||
      co  co    co co

Name: Anonymous 2010-11-28 13:26

Name: Anonymous 2010-12-17 1:34

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

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