freenode/lisp - IRC Chatlog
Search
23:10:13
Shinmera
My slide show app is coming along. https://www.youtube.com/watch?v=bB0BlN8ORiA&feature=youtu.be
23:25:29
hjudt
are there any best practices naming accessors? if i have a class "box" with a slot "id", should i call the accessor box-id or simply id? is there any advantage doing the former?
23:31:39
Xach
hjudt: I find it useful to think of the protocol of generic functions first, and then use defclass to fill in the easy blanks of specific methods. in that context it doesn't make sense to name the generic functions with the class name (usually).
0:24:23
didi
Wonder: Why isn't the syntax of `let' the same of `setf'? i.e. (let (a a-value b b-value) ...)
0:26:11
fiddlerwoaroof
didi: clpjure does that, it's a bit annoying because it's more difficult to delete a binding/value pair
0:29:09
fiddlerwoaroof
I have actually experimented with writing a wrapper macro for setf that looks like (setf* (a a-value) (b b-value))
0:31:09
Bike
i don't think there's much particular reason either way. of course, if you do write a let like that it's short for ((a nil) (a-value nil) (b nil) (b-value nil))
0:34:08
fiddlerwoaroof
didi: it's nice, but I'm always hesitant to introduce new things for such a trivial reason
0:50:49
Zhivago
I think the savings with setf are minimal -- with let it makes more sense since it would otherwise introduce one scope per variable.
5:08:21
borei1
to define orphographic projection matrix i need to supply 2 arguments r-min and r-max, i created the following generic function
5:10:41
borei1
(setf (orpho projection-matrix) (vector -5.0 -5.0 -5.0 1.0) (vector 5.0 5.0 5.0 1.0))
5:11:51
|3b|
and i think you have to use the complicated SETF stuff rather than just a setf function
5:15:58
|3b|
would (orpho projection-matrix) return rmin and rmax? (and is "orpho" spelling from some other language? haven't seen that before)
5:16:35
|3b|
if not, i wouldn't expect (setf orpho) to accept rmin+rmax, regardless of how you combine them
5:18:32
|3b|
ACTION assumed it was from "orphographic" as used above, just not sure if that is "orthographic" in some other language or just a typo :)
5:24:39
|3b|
and unless it is identity or pure scale, just setting the diagonal is an odd thing to do
5:26:22
|3b|
if you have (0 0 1 0, 0 1 0 0, 1 0 0 0, 0 0 0 1) and set the diagonal, you get something like (2 0 1 0, 0 2 0 0, 1 0 1 0, 0 0 0 1), when you probably wanted (0 0 2 0, 0 2 0 0, 2 0 0 0, 0 0 0 1)
5:27:00
|3b|
when you want to do is multiply by (2 0 0 0, 0 2 0 0, 0 0 2 0, 0 0 0 1), which will give you the 2nd result rather than just setting the diagonal
5:27:36
|3b|
and will also rotate the axes correctly, scale translations, etc as expected depending on which order you multiply
5:29:15
|3b|
right, i would expect it to usually have concatenation of a bunch of rotation and translation (and possibly scale)