akkartik / wart

An experimental, small, readable Lisp with thorough unit tests and extensible functions/macros.
http://akkartik.name/post/wart
142 stars 12 forks source link

close, write, and fork are not in scope. #2

Closed shauncarpenter closed 12 years ago

shauncarpenter commented 12 years ago

So, I ran Wart from a fresh download, and got this:

https://gist.github.com/8a765721403bd26f259a

After a bit of searching, I ended up adding

#include<unistd.h>

to the end of the includes in boot.cc. This seems to have fixed the errors; I didn't make a patch because it seems rather unportable...

I'm running Arch Linux, 64-bit, gcc 4.7.1-5.

akkartik commented 12 years ago

Thanks Shaun!

All my testing so far has been on 32-bit linux with gcc 4.4, and when I look at my preprocessor output:

$ g++ -E boot.cc

It looks like unistd.h gets included deep inside some header on my system. Why is your solution unportable? (I'm not very knowledgeable about POSIX and so on..)

shauncarpenter commented 12 years ago

I thought it would be because it wouldn't work on a nonPOSIX system, but it seems that isn't your goal anyway! I guess it wouldn't matter, because if you were wanting to use gcc, you would be running cygwin/mingw, which wraps the windows equivalents to close, fork, and write.

Also, you're very welcome!

akkartik commented 12 years ago

Ah, I didn't even think of non-POSIX systems :) I don't have access to any such, so philosophically my approach is to keep the code short, simple and hackable so others can fix them for themselves (and send me patches!).

akkartik commented 12 years ago

(Goes without saying, but I'd love to hear what you think of this project.)

shauncarpenter commented 12 years ago

I think it is rather awesome, actually! I have recently discovered arc (after using scheme for a little while), and wanted to learn more about it by writing my own interpreter in C. I had just finished the basic parser when I found your project, and discovered that pretty much everything up to that point was identical to yours, so I decided I should just use this. (although, it's rather hard to write that first part differently).

You really seem to have achieved your goal of making it simple, I started reading the code yesterday and already understand a surprising amount.

I really like the way you encourage simply putting wart in with your code, and the way one can just give the right numbers to their code so it is run in the right order; I haven't really investigated it yet, but it seems this would make it much easier to interface homemade wart programs with C code.

shauncarpenter commented 12 years ago

also, optional significant whitespace; nice :)

akkartik commented 12 years ago

(BTW, I sent a response last night to your gmail from commits on Pygmy. Let me know if that's not the best address for you. Mine: ak@akkartik.com)