3 ms·
Cool article, but his interpreter is broken. Both repl mode and file mode just spew errors. gcc version 4.1.2 [briang@ ~]$ gcc lisp.c -o lisp [briang@ ~]$ .
by bjg 16y ago
Cool article, but his interpreter is broken.
Both repl mode and file mode just spew errors.
gcc version 4.1.2
[briang@ ~]$ gcc lisp.c -o lisp
[briang@ ~]$ ./lisp test.lisp
> Error.
> Error.
> Error.
...
- ludwig 16y agoIt worked fine for me: $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664) ... $ gcc lisp.c -o lisp $ ./lisp test.lisp > A > (A B C) ...
- bjg 16y agoTried clang trunk and ICC 11.0, both give me the same result I originally posted. I supposed it could be some weird difference between OSX vs Linux.
- scott_s 16y agoVerified. Worked fine on my Macbook (i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)), broke on a Linux box (gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)). This will drive me crazy. Edit: it has to do with 32-bit and 64-bit. When I compile explicitly as 32 bit on Linux (which is a 64-bit machine), the error goes away. Probably related to how he casts everything to an object, and assumes things will be in certain places.
- andrewf 16y agoIt's this: http://nakkaya.com/2010/08/24/a-micro-manual-for-lisp-implemented-in-c/#comment-70938308 http://nakkaya.com/2010/08/24/a-micro-manual-for-lisp-implem... I suspect Red Hat's gcc is aligning structure members on 64-bit boundaries.
- scott_s 16y agoExcellent! I thought name looked suspect.