freenode/#lisp - IRC Chatlog
Search
17:56:33
mgsk
aeth: which part is a terrible antifeature? That SBCL does or doesn't always respect :type?
17:56:38
aeth
You could also wrap the defclass in a (debug 3) declaration, but that could have other effects, and it wouldn't fix this behavior on other implementations that might behave differently and never check :type
17:57:16
aeth
mgsk: It's terrible that it has the capability to check type in a defclass slot, but doesn't normally do it. Especially since it's the most reliable implementation for defstruct typechecking.
17:58:33
mgsk
aeth: I'm guessing it chooses not to typecheck for efficiency's sake? i.e. if you want type checking, you have to opt-in to the run-time slow down?
18:00:23
aeth
SBCL singlehandedly makes people reimplement a(n apparently optional) part of the standard because the default settings on the most popular implementation (SBCL) don't respect :type
18:02:18
aeth
SBCL is normally the implementation to use if you want type information to be respected in a reasonable way, like in structs, declarations, etc. Pretty much everywhere except defclass
18:02:47
aeth
But it focuses on types-for-efficiency, which is why they probably don't care with defclass slots
18:04:25
phoe
but also why some things simply cannot be optimized away into simple pointer lookups and such
18:08:38
aeth
defstruct is often implemented like defclass, but with redefinition restrictions so things like slot access via accessors can be inlined. The catch is that this means that in some implementations you can't redefine defstruct, which hurts the typical CL interactive workflow. You also can't afaik fix things via the MOP, like you can do with defclass.
18:09:37
aeth
define-condition also exists, for the condition system. So CL kind of has three class systems afaik.
18:17:39
aeth
position could also work, but that's trickier since it might conflict with the standard function POSITION
18:20:06
phoe
but then again, if you just allocate an artificial chunk of raw memory, then you effectively have pointers
18:20:27
aeth
shka_: It's only acting like a pointer if it's an array that has an element-type whose upgraded-array-element-type isn't T
18:30:04
phoe
paule32: instead of setting a global variable CDRAHT, use a local variable, and return the object.
18:33:19
phoe
I don't know how to help you. After all these months, you still to seem not to even try to write idiomatic Lisp.
18:36:01
paule32
ah ii understand - may be, (return-from draht-Cu1600 1) is direct context of the methode
19:47:16
ck_
Oh, ok. I didn't realize when we last talked that the secret to getting a response is to not address you directly.
19:49:44
paule32
ck_: don't be worry, my mother language is not english, so i have translate it when read + write, and so missunderstandings go on...
19:55:15
mgsk
Any ideas as to why (bt:destroy-thread *thread*) (print (bt:thread-alive-p *thread*)) => T ?
20:10:51
mgsk
I don't understand. *thread* is something returned by bt:make-thread. Why wouldn't bt:destroy-thread accept that (and also do what its name suggests)?
20:18:54
pjb
in ccl, (defparameter *thread* (bt:make-thread (lambda () (sleep 100000) 42))) (bt:destroy-thread *thread*) (bt:thread-alive-p *thread*) -> NIL
20:34:23
mgsk
pjb: I think I'm starting to understand what is happening. (bt:destroy-thread *thread*) (loop :while (bt:thread-alive-p *thread)) (print (bt:thread-alive-p *thread*)) => NIL
23:32:53
no-defun-allowed
In CL-WHO, it's printed if you give the WHO macro :prologue t from memory, maybe there is something like that?
0:35:49
moldybits
in CLOS, i have a class that no methods specialize on, but i want to handle any attempt of applying any method to it. (defmethod whatever ((x number)) x) (defclass foo () ()) (whatever (make-instance 'foo)) ; instead of erroring i want to intercept this
0:37:24
moldybits
my goal is to have an object that defers every method application and slot-value to another object seamlessly, except for chosen methods/slots that i want to override
0:37:43
no-defun-allowed
(defmethod no-applicable-method :around (gf &rest arguments) (if (find-if (lambda (x) (typep x 'anti-social-class)) arguments) do-something-else (call-next-method))) might work
0:39:31
oni-on-ion
wasn't someone in here looking for something like this recently ? https://github.com/plops/cl-cpp-generator
2:29:09
pjb
moldybits: AFAIK, it's not possible. Remember that methods are attached to generic functions, not to objects or classes.
2:58:10
LdBeth
Is it a good idea to rely on emacs’ font-lock text-property to predicate if a delimiter is in a string so I can ignore it?
3:18:39
LdBeth
I find the cool thing is I can change the display of many )))s to ] without affecting parent matching
3:22:36
LdBeth
ACTION uploaded an image: ima_7a79fe2.jpeg (8KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/kbjWwfdpmsHKlQyBwXnEJHoD >
3:24:35
pjb
LdBeth: this can be done trivially with font-locking. But indeed, the regexp may be complex if you want to avoid strings, (and comments), notably in CL where strings can stand on several lines, and comments can be embedded.
3:32:01
LdBeth
pjb: for my purpose these should be inserted by user and doesn’t mean to be preserved across sessions
3:33:49
pjb
LdBeth: you can let the user type the )))) using paredit, and display them as a single ]