libera/#commonlisp - IRC Chatlog
Search
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
20:42:57
Bike
jmercouris: you can define asdf classes to express dependencies on cc output more easily, i think? cffi does it for the groveler
22:13:42
phoe
okay, my production-grade AMB should be sorta decent now - asking for some review on https://plaster.tymoon.eu/view/2789#2789
22:15:56
phoe
as for the obvious question of why am I doing it - I want to make a calligraphy of AMB for the next ELS, and I need an implementation of it that I can trust (as opposed to the current rosetta code one)
22:17:10
phoe
and yes, a little bit of pretty handwritten lisp stuff to raise money for the lisp world again
22:17:51
Bike
https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-28.html#%_sec_4.3.2 yeah there's a couple
23:07:01
phoe
Bike: thanks for that resource, already found a few bugs in my code just by trying to implement that