Yet another Lisp related screencast
-
- Posts: 23
- Joined: Sat Jun 28, 2008 11:27 pm
- Contact:
Yet another Lisp related screencast
Hi there,
because I liked the excellent Lisp screencasts of Marco Baringer and Rainer Joswig and due to the lack of additional freely available stuff like the beforementioned, I've thought about creating comprehensive tutorial-like screencasts myself. So, during the past summer I began with the creation of a tutorial on writing a simple raytracer in Common Lisp, consisting of multiple screencasts. As I unfortunately do not have the time for further work on it, I finally decided to make the present state available.
Please note that I do not claim to be a Lisp uber-professional and thus you may or may not encounter a few mistakes. The ones I know about have been mentioned and corrected in the subsequent screencast respectively.
If you like what you see or should you wish to contact me, I'm looking forward to hearing from you. You can find my email address as well as the mentioned work at http://home.in.tum.de/~lehmanna/lisp-tutorial.html.
Also, please note that the first part is a neccessary prerequisite for its successors. Anyways, IMHO the more interesting and explanatory stuff starts from Part 2.
because I liked the excellent Lisp screencasts of Marco Baringer and Rainer Joswig and due to the lack of additional freely available stuff like the beforementioned, I've thought about creating comprehensive tutorial-like screencasts myself. So, during the past summer I began with the creation of a tutorial on writing a simple raytracer in Common Lisp, consisting of multiple screencasts. As I unfortunately do not have the time for further work on it, I finally decided to make the present state available.
Please note that I do not claim to be a Lisp uber-professional and thus you may or may not encounter a few mistakes. The ones I know about have been mentioned and corrected in the subsequent screencast respectively.
If you like what you see or should you wish to contact me, I'm looking forward to hearing from you. You can find my email address as well as the mentioned work at http://home.in.tum.de/~lehmanna/lisp-tutorial.html.
Also, please note that the first part is a neccessary prerequisite for its successors. Anyways, IMHO the more interesting and explanatory stuff starts from Part 2.
-
- Posts: 148
- Joined: Wed Jul 30, 2008 11:26 pm
Re: Yet another Lisp related screencast
Code: Select all
(defun (setf matrix-at) ...)
-
- Posts: 23
- Joined: Sat Jun 28, 2008 11:27 pm
- Contact:
Re: Yet another Lisp related screencast
Yes, definitely ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
-
- Posts: 148
- Joined: Wed Jul 30, 2008 11:26 pm
Re: Yet another Lisp related screencast
You learn something new every day.Alexander Lehmann wrote:Yes, definitely
![Cool 8-)](./images/smilies/icon_cool.gif)
Re: Yet another Lisp related screencast
August the newb here...what does this do? I did a macroexpand-1 and compared it to a regular defun but still don't get itPaul Donnelly wrote:Wait, I can do that?Code: Select all
(defun (setf matrix-at) ...)
![Embarrassed :oops:](./images/smilies/icon_redface.gif)
-
- Posts: 23
- Joined: Sat Jun 28, 2008 11:27 pm
- Contact:
Re: Yet another Lisp related screencast
This basically defines a new setf expander. You might want to look up defun, defsetf and the like in the CL HyperSpec for a more detailed unterstanding. However, in the case of the matrix it allows an aref-like access of the matrices elements both for reading and writing.
-
- Posts: 148
- Joined: Wed Jul 30, 2008 11:26 pm
Re: Yet another Lisp related screencast
It makes it so that not only can a person doAugust wrote:August the newb here...what does this do? I did a macroexpand-1 and compared it to a regular defun but still don't get itPaul Donnelly wrote:Wait, I can do that?Code: Select all
(defun (setf matrix-at) ...)
Code: Select all
(matrix-at a b)
Code: Select all
(setf (matrix-at a b) c)
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Re: Yet another Lisp related screencast
Thank you very much for the help guys! I did look in the Hyperspec a bit but wasn't quite able to piece it all together.Alexander Lehmann wrote:This basically defines a new setf expander. You might want to look up defun, defsetf and the like in the CL HyperSpec for a more detailed unterstanding. However, in the case of the matrix it allows an aref-like access of the matrices elements both for reading and writing.
-
- Posts: 148
- Joined: Wed Jul 30, 2008 11:26 pm
Re: Yet another Lisp related screencast
It's like that sometimes. Less so once you get the hang of its conventions and precise vocabulary, but look at how I got surprised by this way of defining setf expanders. I still have no idea where it's described.August wrote:Thank you very much for the help guys! I did look in the Hyperspec a bit but wasn't quite able to piece it all together.
Re: Yet another Lisp related screencast
Well, defun takes a function name as its first argument, and a function name is "1. (in an environment) A symbol or a list (setf symbol) that is the name of a function in that environment. 2. A symbol or a list (setf symbol)."Paul Donnelly wrote:I still have no idea where it's described.