Search
Thursday, 11th of April 2019, 15:50:18 UTC
15:56:20
fivo
Is it possible in CLOS to instantiate an instance of subclass B from an instance of superclass A.
15:56:29
fivo
I mean without writing something like
15:56:59
fivo
(make-instance 'B :slot1 (slot1-accessor A) .....)
15:57:30
p_l
Direct subclasses using MOP, then once you have the class pass it to make-instance?
16:05:08
shka_
fivo: not really, you can add defgeneric cloning-information to make it less annoying
16:05:41
shka_
well, or at least i don't think that this is possible
16:05:49
beach
fivo: You may want to use CHANGE-CLASS.
16:08:15
fivo
beach: CHANGE-CLASS only solves it if I don't inherit mulitple classes
16:08:55
Bike
which, what, you'd provide multiple superclass instances and get a copy combining all of them?
16:10:04
Bike
there's definitely nothing built in for that.
16:10:20
Bike
you'd have to specify some stuff, like what to do if the superclasses share a slot but have different values in it.
16:12:12
p_l
Wouldn't a custom metaclass work?
16:16:12
scymtym
this sounds like a prototype-based object system. maybe https://github.com/sbcl/specializable/blob/master/examples/prototype-specializer.lisp is relevant
16:16:44
jackdaniel
can anyone suggest some resource which provides some background knowledge about writing benchmarks?
16:17:08
shka_
heh, you are seriously making it more complex then it needs to be
16:20:00
selwyn
on that note, can someone suggest a resource that provides background knowledge about writing unit tests
16:21:43
Fade
richard gabriel wrote an article some time ago about implementing his benchmarks, but I"m having trouble finding it.
16:22:45
housel
Fade: You mean http://rpgpoet.com/Files/Timrep.pdf ?
16:22:50
Fade
ah, here. sorry pdf link: https://www.dreamsongs.com/Files/Timrep.pdf
16:23:04
jackdaniel
thank you, I'll read it
16:23:45
housel
The paper cited in https://github.com/smarr/are-we-fast-yet is also useful
16:24:12
housel
Namely https://stefan-marr.de/downloads/dls16-marr-et-al-cross-language-compiler-benchmarking-are-we-fast-yet.pdf
18:21:59
moldybits
does this function have a name, and does it exist? (f '(1 2 3)) => ((1 2) (2 3) (3 1))
18:30:03
Bike
you're collecting all the length 2 combinations
18:30:31
Bike
(let ((c nil)) (alexandria:map-combinations (lambda (x) (push x c)) '(1 2 3) :length 2) c)
18:32:34
pjb
Perhaps he's collecting successive pairs cycling back. (defun f (list) (loop for (a b) on list collect (list a (or b (first list))))) (f '(1 2 3)) #| --> ((1 2) (2 3) (3 1)) |#
18:37:41
moldybits
right, that's kinda obvious now that i see it. :)
18:38:13
moldybits
thanks, pjb and Bike.
19:14:50
sjl_
(defun f (list) (loop for (a . b) on list collect (list a (if b (car b) (first list)))))
19:25:29
warweasle
I never thought about it, but common lisp can use recursive macros, right?
19:29:07
flip214
warweasle: as long as you have some termination condition that triggers before the compiler stack is full...
19:29:26
warweasle
Ok. Then my mistake is somewhere else.
19:31:51
flip214
warweasle: care to paste?
19:32:41
warweasle
flip214: No, I moved everything into two functions just in case.
19:33:14
warweasle
I'll be happy to share when I'm done. It's for the lisp jam...It take a dialogue tree and executes it.
22:03:49
gjvc
does anyone have any suggestions on getting SLIME working on Fedora 30 ? it can't find swank-loader.lisp
23:10:38
Xach
gjvc: how did you install slime?
23:43:46
gjvc
i think it's there via rpm
23:44:24
gjvc
emacs-slime-2.19-4.fc29.noarch
23:49:59
gjvc
* (ql:quickload "quicklisp-slime-helper")
0:58:22
Lord_of_Life_
** NICK Lord_of_Life
2:55:57
beach
Good morning everyone!
Friday, 12th of April 2019, 3:50:18 UTC