libera/#commonlisp - IRC Chatlog
Search
11:05:21
attila_lendvai
what's the semantics of the :default-initargs of defclass? i have added one for a baseclass, and when i inspect the instance of a subclass of it, i can see it in SBCL's internal slots on the class, but the slot-value on the instance is not what i have specified.
11:06:29
jackdaniel
initargs are passed to initialize-instance, reinitialize-instance and shared-initialize
11:08:47
attila_lendvai
oh, the slot has a :initform, probably that's why it's completely ignored. thanks jackdaniel!
11:10:54
jackdaniel
I think that you have an initform in the subclass that you create the instance of, and you have a default initarg in the superclass's form
11:11:49
jackdaniel
but then even without the initform the superclass's initarg would not take effect
11:13:31
attila_lendvai
Xach wrote about it: https://lisptips.com/post/11728375873/initform-and-default-initargs
11:13:38
jackdaniel
(because default initargs are supplemented to make-instance that is specialized on the class, not as an after method)
11:25:39
theothornhill
Is anyone else struggling with sly not popping the marker stack correctly when using M-. and M-,?
11:26:16
jackdaniel
I've noticed that slime shows an empty buffer if the slime debugger is popped from another thread, not sure if that's relevant
11:26:25
theothornhill
I can go to definition with M-., but won't go back with M-,. It just says 'at start of xref history'
11:27:57
attila_lendvai
jackdaniel, nothing really, just holding off the bitrot from the hu.dwim universe. i'm mostly working on/with crypto stuff, https://www.ethswarm.org/ and Guix (i.e. scheme! :)
11:29:04
attila_lendvai
ACTION is reminded of all the slime gems getting bitrotten in his fork. should have submitted them again to the new maintainers...
11:30:01
attila_lendvai
jackdaniel, hopefully helps recovering from the ongoing mass psychosis by providing an uncensorable p2p storage infrastructure
11:30:05
jackdaniel
I need to give another shot guix (but plug in there non-guix repository), I really like the idea
11:31:26
attila_lendvai
jackdaniel, it's a whole lot of fun! i've spent a few months on nixos, but their infrastructure for services was a pain to work with. then i moved on to guix, and i didn't regret it one bit. i've already implemented the swarm service for it.
11:32:29
attila_lendvai
jackdaniel, the scheme devenv for guix is nowhere near the slime/sbcl experience, but it's still a lisp nevertheless. on Guix even the init process is a scheme code (i.e. instead of systemd and whatnot).
11:41:55
theothornhill
Hmm. I must be confused. Has never M-. and M-, worked with going back and forth between definition and usage? I get the same behavior in slime as well
11:44:12
theothornhill
How strange. Do you need to do anything magical in your config? I run emacs -Q with (package-initialize), set the lisp-inferior-program, then quickload my project. Now I can jump to definition, but not jump back
11:48:38
pjb
but the same behavior is also implemented with M-. bound to xref-find-definitions and M-, to xref-pop-marker-stack eg. in emacs-lisp-mode (probably also C modes using TAGS files).
11:49:58
theothornhill
Yes, and it works proplerly in elisp and all other modes that implement this behavior
12:00:45
theothornhill
slime-push-definition-stack should use (xref-push-marker-stack), but uses (ring-insert find-tag-marker-ring (point-marker))
12:15:58
theothornhill
https://github.com/slime/slime/pull/650 should fix this issue if someone else has it
12:45:27
unixlisp
What is the value? (let* ((old (list 0)) (new (nsublis '((0 . zero)) old))) (eq old new))
13:02:49
pjb
unixlisp: (let* ((old (list 0)) (new (nsublis '((0 . zero)) old))) (eq old new)) #| --> t |#
13:03:20
pjb
(let* ((old (list 0)) (new (nsublis '((0 . zero)) old))) (values (eq old new) old new)) #| --> t ; (zero) ; (zero) |#
13:04:08
pjb
(setf *print-circle* t) (let* ((old (list 0)) (new (nsublis '((0 . zero)) old))) (values (eq old new) old new)) #| --> t ; #1=(zero) ; #1# |#
13:04:52
pjb
unixlisp: nsublis as its name indicates, can mutate the old list. It returns a new list, but this new list is not a fresh list, it's a list that can be built from the conses of the old list.
13:07:10
pjb
That's true of about all the mutating functions. Very few are specified to exactly mutate. nconc is specified to mutate (using rplacd). nsubstitute is not.
13:12:15
pjb
Notably: (let ((s (copy-seq "Hello World!"))) (nstring-upcase s :start 5 :end 11) s) #| --> "Hello WORLD!" |#
13:27:23
beach
That's because the standard is mainly meant for people who create Common Lisp implementations. To them, it makes perfect sense.
13:29:54
_death
I think it's also meant for users of Common Lisp.. they can know what's required and what isn't
13:32:43
_death
but I may disagree with precisely the word "mainly" there.. I think it's mainly for users
13:39:25
pjb
unixlisp: yes, and none of the cdr of the toplevel list can be mutated. So it's in the forced-mutating functions class.
13:47:33
beach
"It is a language specification aimed at an audience of implementors and knowledgeable programmers."
14:06:51
phoe
I mean, it works, but I can't figure out why after reading it thrice and there are statements that are ignorable in it
14:08:07
rotateq
phoe: there was also another thing which drove me crazy, cause very ugly style and didn't even work
14:09:08
phoe
rotateq: the famous ambiguous operator, see the top of https://www.rosettacode.org/wiki/Amb#Common_Lisp
14:09:43
rotateq
phoe: nooo, then you would see my bad code from some months ago and I know what to improve ... going from DEFUN to generic
14:11:29
rotateq
but on the site with calculating pi by arctans all other do some naive approach, i remembered an identity by Lehmer which my old math teacher told me about 10 years ago, to check if the identity holds
15:22:53
rotateq
i hope in my next rebirth I'll be sent back in time to wipe out some big decisions in newer human technology :D
15:34:00
Bike
the dynamic variable version involves a random number generator. that seems like a misunderstanding of amb
15:36:32
phoe
it should be able to work fine without shuffling, it'll just always return the same set of values every time.
15:39:16
phoe
aaa, I just realized that I have a use case for &optional and &key in the same lambda list
15:45:05
jackdaniel
(defun dafun (&optional very &key other optional keys &allow-other-optional-keys))
15:57:53
phoe
I gotta run now, but that's a quickly hacked version that should be a tad better and a bit more "enterprise-grade"
20:19:03
jmercouris
we have this in our ASD to compile a corresponding shared library http://dpaste.com/3SX5ANG4H
20:40:01
rotateq
and i deleted something in the /usr/share and cannot load other libs anymore :D maybe complete reinstallation of SBCL could help