orangeduck / BuildYourOwnLisp

Learn C and build your own programming language in under 1000 lines of code!
http://www.buildyourownlisp.com/
Other
2.9k stars 394 forks source link

{}--> nil, fun lookup removed #41

Closed Tandrial closed 10 years ago

Tandrial commented 10 years ago

Since you defined {} to be nil, might as well use it in the functions

Also strings.exe crashes when I try to load your prelude.lspy . The function "lookup" seems to be responsible.

orangeduck commented 10 years ago

Thanks. Will you also add this change to the code in the chapter text. The fact lookup is crashing is pretty bad. I'll investigate that some more.

orangeduck commented 10 years ago

The crashing may be fixed in 20ec95d6bf440cd45cf5eea64d79913352930b2c.

I need to create a local copy with a proper exit function so I can run the whole thing through valgrind and ensure there are no leaks. At the moment ctrl+c to exit doesn't cleanup resources. I did this before at some point but with the number of changes since then I'm sure some more bugs have snuck in.

Tandrial commented 10 years ago

You're right https://github.com/orangeduck/BuildYourOwnLisp/commit/20ec95d6bf440cd45cf5eea64d79913352930b2c seems to fix lookup. 20ec95d

orangeduck commented 10 years ago

I found another memory leak I've removed in 4472a8f826534fa5a389fbd44d22896da7db8325. Everything should be clean now.

Tandrial commented 10 years ago

Cool. Thanks for the whole thing by the way. I really learned a lot. Getting started on all the bonus stuff now.

orangeduck commented 10 years ago

No problem! Thanks for reading :+1: