

@cadr I found the bug



Awesome!






@cadr also i figured out what went wrong with uncaught-exception-handler

the compiled code (but not the source code) has a reference to all the exports





@cadr also note that the error message prints twice, which is something wrong with exception handling

@samth Yeah I noticed that

@samth yeah it’s about struct property predicates, provide-pre-transformer?
produces #f
for contract-out
which is a ppt
(which totally is a provide-pre-transformer?
), trying to fix now

even ppt?
produces #f which is very odd


@samth doing it twice thing seems to be happening because of the submodule handling code : https://github.com/pycket/pycket/blob/6a8d15ab71b259f15390c6c4536a4717c1ae941d/pycket/racket_entry.py#L200

With this namespace-require
call it evaluates everything until the contract error, and then in the module-declared?
call it goes through it again and we get a second contract error

That’s the same code as in the chez main.sps

Really it should just error at that point

also the module-declared?
call shouldn’t actually evaluate anything

but also that doesn’t explain why we get the error in the first place

Yeah I’m surprised that module-declared?
evaluates things too

One of the deficiencies of using the call_interpret is the error handling, when we get an error during a call_interpret, it’s converted to an exn and handed to the default handler and that just displays the error and calls the void function, and because that the current continuation is aborted, a Done exception is raised by the NilCont, so the initial call_interpret just returns with void

Also yeah it turns out doing it twice is not related to our contract error as I hypothesized before

But also we should fix call_interpret
to raise the resulting exception

That would require customizing the default handler because the call_interpret
doesn’t even see the raised exception, when it’s raised the default handler handles it and the evaluation continues with a void
plugged in to the rolled back continuation (which is usually a NilCont, raising a Done exception)

right, but in basically no case do we want the current behavior

I totally agree, I’ll improve that setup soon

Another possibility is to just set the initial continuation to do the right thing in call_interprtt

That’s what I had in mind, I’ll try to push a fix for that tonight