Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Basic implementation for car, cdr, map with function pointers and clang blocks, the rest of Lispy stuff is left as an exercise. :)

https://godbolt.org/z/Y5qWs4c64



That's cool!

C++ had support for partial applications with templates (std::bind iirc), and it was possible to implement closures as objects with the () operator implemented. Now it has support for closure with a dedicated syntax.

It would be possible to do something similar in C - a closure is just a function pointer and a bunch of parameters bundled together, but I don't think there's enough flexibility in the language to make it look like regular function calls.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: