forked from ryukinix/lisp-insights
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Land of Lisp progress: Finished the Chapter 9! Orc Game finished!
Summary: * arrays are similar to lists, but allow you to access an item at a specific offset more efficiently * hash tables are similar to alists, but let you look up the value associated with a key more efficiently * using arrays and hash tables in the appropriate places will usually make your code much faster * the only true way to tell if changing a data structure or algorithm makes your program faster it to time your code with the time command (on CL) * Common Lisp has generic functions that can be used against multiple datatypes. The most useful of these are sequence functions that can transparently handle lists, arrays and strings. * You can create objects with properties in list using the defstruct command The most valuable insight here was about the DEFMETHOD to define generic procedures tagging the datatype on argument. So we can define a function multiple times for each datatype doing a special procedure. This is really great. We can use as well for structs and classes (I think the book covers that later, but I got something from the google lisp koans too). https://www.github.com/DestructHub/lisp-koans-answers
- Loading branch information
Showing
2 changed files
with
161 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters