freenode/#lisp - IRC Chatlog
Search
5:18:47
Josh_2
Is it possible for me to modify the default behaviour of the automatically generated accessor functions that are created when I define a new class?
5:19:51
beach
Sure, they are just methods on generic functions. You can add auxiliary methods, or you can redefine the primary method.
5:20:41
beach
... unless you mean that you want DEFCLASS to generate accessors that behave differently. That might be more complicated.
5:23:40
Josh_2
hmm, well my problem is that I have lots of different classes where the type is either a keyword or a byte array, however when it comes to actually using instances of those classes I have to manually convert from a byte array to a string, and I was wondering if I could just get the accessor functions to call the converting code for me
5:27:29
beach
The easiest way would be to define a wrapper macro for DEFCLASS. The right (but more complicated) way would probably be to use the MOP in some creative way.
5:27:51
pjb
clim does just that. It defines its own defclass, so it can generate the accessors (and other things) as it wishes.
5:29:49
Bike
probably define a custom class of standard-reader-method that does your conversion and then specialize reader-method-class to return it
5:34:28
pjb
Josh_2: (defpackage "YOUR-LISP" (:use "CL") (:shadow "DEFCLASS") (:export . #.(the same symbols as CL))) (defmacro your-lisp:defclass …)
7:54:37
pjb
Also, instead of naming it your-lisp:defclass, you can name it your-program:define-slot-converting-class or something.
16:01:10
mister_m
Hello again - can i use DESTRUCTURING-BIND to extract the car, and cdr / "rest" of a list? I'm a little confused about how destructuring lambda lists work.
16:03:23
mister_m
I didn't know you could just do dot notation there, awesome. Does the "rest" of the list when destructuring this way give a proper list?
16:05:55
beach
So (multiple-value-bind (car . cdr) '(a b c . d) ...) will give A as the value of CAR and (B C . D) as the value of CDR, so CDR is not proper.
16:09:30
DaisyChristieeee
Whats wrong with it ? https://bit.ly/38yoZCp Could you please help me to debug it..
16:13:45
DaisyChristieeee
Whats wrong with it ? https://bit.ly/38yoZCp Could you please help me to debug it..
16:27:09
seok
with dexador, if I do (dex:get ..) with keep-alive to true every time, does the connection remain open?
16:45:37
_death
seok: it has a connection pool.. note that keep-alive is true by default.. if you have many requests to many servers, you'll run out of file descriptors unless you clear the connection pool every now and then :/
16:50:54
seok
apparently ArangoDB's http api supports keep alive, so I figured it would be right to use it