freenode/#lisp - IRC Chatlog
Search
22:00:46
skidd0
or, how can i directly manipulate the lack.response reesponse structure before sending?
22:15:28
jcowan
Well then, why bother to have external symbols at all and require a (slightly) more verbose syntax to access them from other packages? (This is not a rhetorical question.)
22:34:02
skidd0
to get access to the lack.response, would I want to do something :around the CALL method?
22:56:39
Bike
skidd0: it doesn't replace, but if your :around method doesn't call-next-method the original method will not be called
23:56:10
skidd0
I'm getting an error where hunchentoot doesn't know how to handle options http requests
1:28:34
kooga
(setf (lack.response:response-headers *response*) '(:access-control-allow-origin "*"))
1:29:52
skidd0
also, i figured out that I needed to add a options verb to the routing library i'm using (snooze)
4:00:27
beach
In a first-class global environments, I have a table called slot-readers and a table called slot-writers. These tables are indexed by symbol names.
4:00:29
Bike
in ecl and clasp direct instances of standard object use a hash table from slot names to locations.
4:01:19
beach
... then those tables work like the function entries in the first-class global environment.
4:02:22
beach
slot-value with a constant slot name gets rewritten to (funcall (car (load-time-value (find-reader-cell <name>))))
4:03:19
beach
I think SBCL must do the same, modulo the first-class global environment, and the function cell.
4:08:29
Bike
also wait, what happens if you have like (defclass foo () ((x :reader foo-x))) (defclass bar () ((x :reader bar-x))) (slot-value some-object 'x)
4:11:46
beach
In my scenario, (slot-value some-object 'x) would be translated to something like (funcall (car (load-time-value (find-reader-cell 'x))) some-object) and the cell would contain a generic function that dispatches on the class of some-object.
4:11:55
Bike
if the effective method just calls the accessor method, the discriminating function just reads from or writes to the slot directly
4:15:22
Bike
also the fast path i mentioned only happens if it's an object standard enough to not have custom slot-value-using-class methods possible. forgot that caveat
4:15:35
beach
Also, until a few years ago, I used slot-value for "internal" access, and slot accessors only for the public interface.
4:16:29
Bike
i'm not sure what the main reader method can do besides calling slot-value-using-class, i guess
4:18:17
beach
He had classes where slots were implemented as special variables so as to make it thread safe.
4:18:55
aeth
What I tend to do for internal setting is :accessor %foo :reader foo because that way I can use with-accessors on %foo without surprising behavior (i.e. only being able to set)
4:20:59
beach
So, in that case, SLOT-VALUE can not be optimized to do a direct slot access, of course, since there is no slot-location.
4:21:36
Bike
i have been thinking on and off about adding more interdependencies between methods in fastgf. for example, within a method body replace accessors with direct slot reads when possible, and then recompile the method if there's a change so it works transparently
4:21:50
Bike
i bet it would make it faster, but it would be pretty involved to maintain everything correctly
4:26:01
beach
So, I think I'll have to add SLOT-READERS and SLOT-WRITERS to the SICL first-class global environments.
4:31:02
beach
This stuff is frequently done "manually": (defgeneric foop (x) (:method (x) nil) (:method ((x foo)) t))
4:33:03
beach
Bike: Let me take a break and think about that idea. I think better when I am not at my computer.
4:56:57
beach
minion: memo for Bike: This is totally brilliant. I am convinced that it works. 1. Figure out whether any implementation does it. 2. If not, figure out what happens to the methods and call history as a result of DEFCLASS, and DEFTYPE. 3. Write it down. 4. Submit to ELS.
4:59:20
beach
minion: memo for Bike: There would be three kinds of methods: always false, always true, and requiring some action (for example if there is a DEFTYPE that expands to a compound type).
8:12:34
makomo
hah, today is the day when i finally used a full spec instead of just a symbol for ONCE-ONLY
8:30:57
jackdaniel
. is just a notation for a data structure (like #(1 2 3) is for vector), it is not a function
8:34:01
no-defun-allowed
if you do (a (. b c)) you break the expectations of depth - is it (a b . c) or (a (b . c))?
8:35:13
aeth
If it was anything else it'd probably be #.(a b) but then you wouldn't have it combined with the list representation and (a b . c) wouldn't be an obvious representation for a dotted list
8:36:56
oni-on-ion
perhaps i dont see the purpose of (a b . c) aside from being a bit strange considering lispisms