MyNetAz has quit [Write error: Connection reset by peer]
srhm has joined #commonlisp
sjl has joined #commonlisp
fuzy has joined #commonlisp
elderK has joined #commonlisp
yazz has joined #commonlisp
qsaiyan has joined #commonlisp
manwithluck has joined #commonlisp
reb has joined #commonlisp
zephyr has joined #commonlisp
thonkpod has joined #commonlisp
jistr has joined #commonlisp
calx- has joined #commonlisp
Guest7021 has joined #commonlisp
DrachenMaus has joined #commonlisp
splittist has joined #commonlisp
drmeister has joined #commonlisp
surabax has joined #commonlisp
jtbx has joined #commonlisp
mhcat has joined #commonlisp
edgar-rft_ has joined #commonlisp
okflo has joined #commonlisp
\f has joined #commonlisp
Oladon1 has joined #commonlisp
payphone has joined #commonlisp
jasom has joined #commonlisp
greenfork has joined #commonlisp
stag-enterprises has joined #commonlisp
simendsjo has joined #commonlisp
paulapatience has joined #commonlisp
shunter has joined #commonlisp
youthpastor has joined #commonlisp
kanuba has joined #commonlisp
khrbtxyz has joined #commonlisp
ol0ck has joined #commonlisp
Shinmera has joined #commonlisp
rootnode- has joined #commonlisp
sellax has joined #commonlisp
fengshaun has joined #commonlisp
Colleen has joined #commonlisp
sukaeto has joined #commonlisp
cqst has joined #commonlisp
bike has joined #commonlisp
yaneko has joined #commonlisp
BierLiebHaber has joined #commonlisp
younder has joined #commonlisp
cmack` has joined #commonlisp
Lord_of_Life has joined #commonlisp
terrorjack has joined #commonlisp
jA_cOp has joined #commonlisp
yottabyte has joined #commonlisp
kniffy has joined #commonlisp
Patternmaster has joined #commonlisp
cow_2001 has joined #commonlisp
antoszka has joined #commonlisp
mister_m has joined #commonlisp
fourier has joined #commonlisp
jdz has joined #commonlisp
energizer has joined #commonlisp
dmho has joined #commonlisp
tychoish has joined #commonlisp
fermat has joined #commonlisp
sm2n has quit [Max SendQ exceeded]
luis has joined #commonlisp
ElKowar has joined #commonlisp
famicom_guy has joined #commonlisp
thelounge82 has joined #commonlisp
deriamis has joined #commonlisp
c-clop25 has joined #commonlisp
yewscion__ has joined #commonlisp
kyoji has joined #commonlisp
hirez has joined #commonlisp
dino_tutter has joined #commonlisp
m5zs7k has joined #commonlisp
ryanbw has joined #commonlisp
skyl4rk has joined #commonlisp
saturn2 has joined #commonlisp
nxtr has joined #commonlisp
froggey has joined #commonlisp
mrvdb has joined #commonlisp
etimmons has joined #commonlisp
les has joined #commonlisp
mesaoptimizer has joined #commonlisp
sm2n has joined #commonlisp
MyNetAz has joined #commonlisp
Catie has joined #commonlisp
euandreh has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
kopiyka has joined #commonlisp
dmgk has joined #commonlisp
Thermoriax has joined #commonlisp
delyan_ has joined #commonlisp
iquites has joined #commonlisp
chrcav has joined #commonlisp
viaken has joined #commonlisp
runxiyu has joined #commonlisp
squishy_bloob has joined #commonlisp
GreaseMonkey has joined #commonlisp
gaze__ has joined #commonlisp
zups has joined #commonlisp
stylewarning has joined #commonlisp
|3b| has joined #commonlisp
Ruby has joined #commonlisp
susam has joined #commonlisp
drakonis has joined #commonlisp
theruran has joined #commonlisp
attila_lendvai_ has quit [Ping timeout: 260 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
Pixel_Outlaw has joined #commonlisp
aeth has joined #commonlisp
pkal has joined #commonlisp
zwr has joined #commonlisp
theothornhill has joined #commonlisp
nytpu has joined #commonlisp
deadmarshal_ has joined #commonlisp
Fade has joined #commonlisp
gjn has joined #commonlisp
gosha_ has joined #commonlisp
kvik has joined #commonlisp
x4d6165 has joined #commonlisp
mcoll has joined #commonlisp
Grauwolf has joined #commonlisp
disruptek has joined #commonlisp
bmp has joined #commonlisp
timmy has joined #commonlisp
larme has joined #commonlisp
HerlockSholmes has joined #commonlisp
jmbr has joined #commonlisp
arpunk has joined #commonlisp
kdlv has joined #commonlisp
adrianbrink has joined #commonlisp
tux0r has joined #commonlisp
smlckz has joined #commonlisp
lieven has joined #commonlisp
griffinmb___ has joined #commonlisp
sherbert has joined #commonlisp
entro has joined #commonlisp
Mandus has joined #commonlisp
luna-is-here has joined #commonlisp
MyNetAz has quit [Write error: Broken pipe]
ChanServ has joined #commonlisp
larme has quit [Max SendQ exceeded]
larme has joined #commonlisp
MyNetAz has joined #commonlisp
tsujp has joined #commonlisp
alfiee has joined #commonlisp
brokkoli_origin has joined #commonlisp
alfiee has quit [Ping timeout: 252 seconds]
geminium has joined #commonlisp
dra has quit [Ping timeout: 245 seconds]
geminium has quit [Ping timeout: 244 seconds]
akoana has quit [Quit: leaving]
rakka has quit [Remote host closed the connection]
rakka has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 244 seconds]
alfiee has joined #commonlisp
alfiee has quit [Ping timeout: 244 seconds]
josrr has quit [Ping timeout: 245 seconds]
synchromesh has quit [Read error: Connection reset by peer]
synchromesh has joined #commonlisp
awlygj has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
awlygj has joined #commonlisp
elderK has quit [Quit: WeeChat 4.5.1]
RavenJoad has joined #commonlisp
synchromesh has quit [Quit: WeeChat 4.1.1]
<RavenJoad>
Can a defclass's slot's :initform take a make-instance form? (defclass example ((foo :reader foo :initarg foo :initform '()))) works, but :initform (make-instance 'thing) does not.
<ixelp>
(defclass foo () ()) => #<STANDARD-CLASS FOO>, while (defclass bar () ((baz :initform (make-instance 'foo)))) => #<STANDARD-CLASS BAR>
alfiee has joined #commonlisp
<RavenJoad>
beach: That's what I figured from the documentation I read, but if I do :initform (make-instance 'example :example-arg (quick-xform "fun")), where SBCL says "Control stack exhausted while pseudo-atomic".
<beach>
That would depend on what happens when the class EXAMPLE is instantiated.
<beach>
Clearly, if that INITFORM is for the class EXAMPLE, you have an infinite recursion.
<beach>
... or if QUICK-XFORM does an infinite recursion.
alfiee has quit [Ping timeout: 245 seconds]
<beach>
So you can put any form there, but if the form does something wrong, obviously it won't work.
<RavenJoad>
Agreed. But these are two separate classes. (defclass user ((slot-example :initform (make-instance 'example :example-arg (quick-xform "fun"))))). quick-xform is just a cl-ppcre call to replace some characters.
<beach>
RavenJoad: I can't tell from that information what is wrong, but I can assure you that you can put any form in the :INITFORM. You need to study the backtrace to figure out why the computation in infinite.
<RavenJoad>
That's the thing. There is no backtrace (beyond the file that fails to compile). I just get "CORRUPTION WARNING", "Memory fault at 0xff...6", unhandled memory fault.
<beach>
Step one might be to evaluate that form separately an not as an INITFORM.
<RavenJoad>
I can evaluate that form just fine in Sly/Emacs. It produces a valid (and different) class instance each time
<beach>
An unhandled memory fault means either that your Common Lisp implementation has a defect, or that you (or one of the libraries you use) use foreign code that is buggy.
<RavenJoad>
This is meant to be a well-known default value that I can use if the user does not provide one at initialization-time.
<RavenJoad>
I mean, SBCL could definitely have a bug too, but that would be surprising.
<beach>
It has bugs, but you are right, that's not the first thing to look for.
<mange>
The initform gets evaluated for each instance of your class, so if you're wanting a single example instance as the default value for all instances of your class then I don't think you can use (make-instance 'example) as the :initform
<RavenJoad>
I don't need all initialized classes having the same default value (by address/object) for this slot, just that it has a well-known :example-arg value.
<RavenJoad>
Removing the quick-xform call shows that (make-instance 'example ...) is infinitely recursing for some reason (900+ calls to (make-instance 'example ...)).
<beach>
RavenJoad: Does that happen in a fresh image too? You may have defined the EXAMPLE class incorrectly.
<RavenJoad>
Yes. Each run is happening from a "make check" invocation I have that starts a new SBCL instance.
<RavenJoad>
Unless a cache is reused for some reason.
<beach>
The cache is used if the file containing the class definition has not changed.
<beach>
But more likely, you have some method on INITIALIZE-INSTANCE or something similar that causes an infinite recursion.
<beach>
... or indeed an :INITFORM that does that.
<beach>
RavenJoad: Wait... you said you evaluated the form as a form outside :INITFORM and there was no problem. But now there is?
<RavenJoad>
Correct. If I evaluate (make-instance 'example :example-arg "example") in Sly (my REPL interface), then it is fine. I get a new object each time. I only get this error when it is in the slot's :initform.
<beach>
My guess, then, would be that the creation of an instance of EXAMPLE creates an instance of the class that contains the creation of EXAMPLE as an initform.
<mange>
Seeing some code would really help to debug this. :)
<RavenJoad>
There is one thing I have not mentioned here, the :example-arg I create is a subclass of the top-level class.
<RavenJoad>
mange: I can push some in a minute. The branch is super messy though. I'm changing the whole backend of the compiler right now.
<beach>
That sounds like exactly what I said.
<beach>
RavenJoad: We have no idea what your top-level class is, because you haven't told us.
<mange>
So, wait, your (make-instance 'example) will implicitly use the initform (through the parent class)?
<beach>
RavenJoad: the INITFORM is evaluated when a subclass is created as well, unless it is overridden.
<ixelp>
chil/source/backends/verilog.lisp at 957dc4bb012c4530f2f8c8bd5622548845414075 · Chil-HW/chil
<RavenJoad>
In this case, verilog-module is the top-level class. It uses a verilog-net as its body. But for codegen-inheritance reasons (which may be poorly chosen coming from other OOP paradigms), verilog-net subclasses verilog-module.
<beach>
Then that's precisely what I guessed.
<RavenJoad>
So an infinite mutual recursion on instantiation? I'll have to figure out how (if) I can break that.
<mange>
The child class can override the initform, I believe.
<beach>
In the :INITFORM you create a subclass of the class that contains the :INITFORM.
<beach>
mange: That is what I said.
<RavenJoad>
My verilog-net class does not have a "body" slot (nor should it (at least for now)), which it would get by inheriting from the verilog-module class. So can I remove it?
<beach>
You can't remove a slot in a subclass.
<RavenJoad>
Yeah, that's what I figured. I probably need to rework the inheritance here a bit.
<beach>
That would be contrary to the Liskov Substitution Principle.
<beach>
But, as was pointed out three times, you can override the :INITFORM in a subclass.
bigbookofbug has quit [Remote host closed the connection]
<RavenJoad>
beach: Could you point me to a tiny example of that? I understand what you're saying but not quit ehow to implement it.
<ixelp>
(defclass foo ((bar :ini[...]) ERROR: (FOO ((BAR :INITFORM (LSJFLSKDJ)))) can't be destructured against the lambda list (CLASS-NAME CCL::SUPERCLASSES CCL::SLOTS &REST CCL::CLASS-OPTIONS), because it does not contain at least 3 elements. and (defclass baz (foo) (([...]) => #<STANDARD-CLASS BAZ> finally (make-insta[...]) ERROR: Class #<STANDARD-CLASS BAZ> can't be finalized because superclass FOO is not defined yet
<beach>
I don't know what that means. But the example shows how to override the slot.
<mange>
Your first defclass is missing a () after the class name, and those are the errors. Doesn't obscure the example, though.
<ixelp>
chil/source/backends/verilog.lisp at edbf4f9d2f1411bf09c107971472cf7de2e2d62b · Chil-HW/chil
alfiee has joined #commonlisp
<beach>
RavenJoad: Top-level comments take three (or four) semicolons.
<beach>
RavenJoad: And you are wasting precious vertical space by having more than one blank line between top-level forms.
<RavenJoad>
Yeah, I know. The extra blank lines are an accident. I'm not even following the style guide I say I should use. But this branch is a fixable one right now. I've completely rewritten the backend I used to have, so I am still in a tinkering phase before polishing.
<beach>
So are you satisfied with the answer(s) to your issue?
<RavenJoad>
Yes. That answer was exactly what I needed to solve this issue. I may rework the class hierarchy again, but that is a later issue.
alfiee has quit [Ping timeout: 248 seconds]
anticomputer has quit [Remote host closed the connection]
<beach>
mange: Thanks for you help.
anticomputer has joined #commonlisp
<RavenJoad>
beach: mange: Thank you both for your help. I'm going to call it a night on this project.
<beach>
Good luck!
RavenJoad has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]