Common Lisp Tips
A collection of short, dense bits of code with a brief explanation of what the code does and why it's cool. The site's creator, Zach Beane is the man behind Quicklisp, the default package manager for any Common Lisper.
If you try to ask anyone what you should read to learn Common Lisp, the universal recommendation is "Practical Common Lisp". However, the book is a lot more text than code and as such, I still haven't got past chapter 10 (of about 30).
For other people like myself, that enjoy learning from chunks of code and looking stuff up in the official documentation, I highly recommend you give lisptips.com a shot. I've been thoroughly enjoying learning all of these cool things that I probably wouldn't find by reading books or watching videos.
Here are some tips that I found cool:
1) http://lisptips.com/post/30978863226/a-simple-repl
How to make a repl in a few lines of code. when you think about it, all a repl requires is 4 functions, READ, EVALUATE, PRINT, LOOP lol so I guess that may not seem very cool. But in the tip, it's shown how to define functionality to use asterisks (*) to access previous forms.
2) http://lisptips.com/post/31516446212/using-an-adjustable-displaced-array-as-a-cursor-on
Lisp has something called a displaced-array which is basically an array of pointers that acts as a subset of a larger array. Since the displaced-array doesn't actually have any values of its own, changing this subset (displaced-array) changes the larger array (called the target). The snippet shows how to use a displaced-array to act as a cursor to a stream. This snippet forced me to look up a lot of things in the official docs and play around a lot with the code to fully understand what was going on.
3) http://lisptips.com/post/31253190116/binding-keyword-arguments
Create aliases for parameters.
1 comment
[ 2.6 ms ] story [ 14.0 ms ] thread