|
Last project I worked on had 9154 lines of lisp code out of which 4800 lines are utilities, that I've accumulated and written. The utilities cover everything from hash, list, string, files, function, a simple version of prolog, some algorithms like bloomfilter, suffix-tree, a simple bayesian filter implementation and a lot of stuff makes writing code easier. So it's pretty normal to have a large set of utilities that you prefer. It sort of ensures that the code doesn't become to large. I use (hput hash key value) and (hget hash key) a couple of functions, which I have. So it's a bit verbose than hash[key] = value or hash[key]. But it lets me write stuff like... (defexample cineworld-cinema-page (:record :cinema-listing
(:name "ENFIELD")
(:record-loop :film
(:name "BEVERLY HILLS CHIHUAHUA" "BRIDE WARS")
(:director "Raja Gosnell" "Gary Winick")
(:starring "Andy Garcia, Drew Barrymore, Piper Perabo, George Lopez, Jamie Lee Curtis"
"Anne Hathaway, Kate Hudson, Candice Bergen")
(:record-loop :date
(:day "Mon 26 Jan" "Tue 27 Jan")
(:record-loop :time
(:listing "11:10" "13:30")))))
"http://www.cineworld.co.uk/cinemas/22")
I wrote the code that reads that defexample macro and generates the data from it in 2 days. When I started I had no idea what the grammar was going to look like and how I was going to accomplish any of the details. |
"The utilities cover everything from hash, list, string, files, function, a simple version of prolog, some algorithms like bloomfilter, suffix-tree, a simple bayesian filter implementation and a lot of stuff makes writing code easier."
It is wonderful that you can write all that in 4800 lines in CL, and I know that's not hyperbole or exaggeration.
The problem is the parts covering hashes, lists, strings, files etc. are also being implemented by every other CL programmer, slightly differently. This makes it just that little bit harder to share and understand other people's code, which in turn makes it that little bit harder to build commonly agreed upon libraries for common things, and that little bit harder for people new to the language to get started.
This is all cumulative, and adds up to an actual shortcoming in my opinion. Clojure does a little better job here. For example, by having a common Seq interface shared by lists, arrays, sets, and hashes.