This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Yet another Lisp related screencast

11 posts · 20781 views

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.

Re: Yet another Lisp related screencast

(defun (setf matrix-at) ...)
Wait, I can do that?

Re: Yet another Lisp related screencast

Yes, definitely :)

Re: Yet another Lisp related screencast

Alexander Lehmann wrote:Yes, definitely :)
You learn something new every day. 8-) I'd been using DEFSETF this whole time.

Re: Yet another Lisp related screencast

Paul Donnelly wrote:
(defun (setf matrix-at) ...)
Wait, I can do that?
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 it :oops:
---------
DarklingX, LLC
http://www.darklingx.com

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.

Re: Yet another Lisp related screencast

August wrote:
Paul Donnelly wrote:
(defun (setf matrix-at) ...)
Wait, I can do that?
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 it :oops:
It makes it so that not only can a person do
(matrix-at a b)
, they can also do
(setf (matrix-at a b) c)
. There are about four ways (and counting? :roll: ) ways to define setf expanders, but this is the most concise.

Re: Yet another Lisp related screencast

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.
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.
---------
DarklingX, LLC
http://www.darklingx.com

Re: Yet another Lisp related screencast

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.
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.

Re: Yet another Lisp related screencast

Paul Donnelly wrote:I still have no idea where it's described.
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)."

Re: Yet another Lisp related screencast

qbg wrote:
Paul Donnelly wrote:I still have no idea where it's described.
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)."
Now I see it. Back in the glossary. :geek: