libera/#commonlisp - IRC Chatlog
Search
10:16:49
dim
hi there! so my latest changes to handling conditions in pgloader worked, thanks all who helped!
10:17:17
dim
now I would like to find if I can capure the compiler notes and choose to output them in debug mode only (see https://paste.debian.net/1249834/)
10:23:19
scymtym
dim: if you just want the textual output and not, say, the individual condition objects, you could bind *STANDARD-OUTPUT*, *ERROR-OUTPUT*, etc. to a string output stream around the COMPILE call to capture the output
10:23:50
dim
scymtym: yeah I think that capturing is something I do in other places in pgloader, and that'd be good enough to get started
10:39:17
dim
I though that would capture the output and return it as a string, but it doesn't (the output still gets printed in the slime buffer, and the return value is an empty string) ; and I can't remember how to do the capturing now, I have forgotten most of my CL it seems... help?
11:26:35
Shinmera
The conditions are not printed inside compile. They escape to slime or whatever else handles the toplevel and then get printed there, escaping your *error-output* binding.
11:34:09
scymtym
there could be two problems: 1) different conditions are printed to different streams 2) calling COMPILE in a SLIME REPL vs. a plain REPL vs. in a non-REPL thread may result in different surrounding compilation unit setups (which can influence when problems are reported). (with-output-to-string (stream) (with-compilation-unit (:override t) (let ((*standard-output* stream) (*error-output* stream) (*trace-output* stream)) (comp
11:35:05
scymtym
the code was supposed to be (with-output-to-string (stream) (with-compilation-unit (:override t) (let ((*standard-output* stream) (*error-output* stream) (*trace-output* stream)) (compile nil '(lambda (x) y)))))
13:00:18
dim
(let* ((fun nil) (notes (with-output-to-string (*error-output*) (setf fun (compile nil '(lambda (x) (+ x "plop"))))))) (values fun notes))
13:09:45
dim
I ended up with https://github.com/dimitri/pgloader/pull/1411/commits/fb63a778fb33c7afea0e7ab98e5580dda5093559 in case someone's curious
13:18:24
scymtym
(multiple-value-bind (function warnings-p failure-p) … is not going to receive a second and third value since (setf fun (compile nil source)) discards any values but the first
13:21:00
dim
I don't have a test env anymore on my local machine, so I have to commit and push and inspect the CI output, sorry
13:21:29
dim
if I wanted to get back seriously on hacking pgloader I would invest some more time and have a local test env of course, but I'm just trying to fix it from a distance, if that makes sense
13:22:15
dim
the link to the current changeset is https://github.com/dimitri/pgloader/pull/1411/files (which now includes a fix to what you mentioned last)
14:33:58
pve
Hi, is the correctable error signalled by make-package if a package already exists going to be of type "error"? So I should do (handler-case (make-package "MY-PACKAGE") (error (c) ...))?
14:42:42
pve
sure, I meant that if I for some reason wanted to access package-error-package then the second handler would be convenient
14:54:20
Bike
oh, yeah, the package errors are both surprisingly specific and surprisingly vague. for clasp i took a while to set up some helpful restarts, but none of them are standard
14:54:35
Bike
(of course how often you'd need to fix package errors programmatically anyway is debatable...)
15:00:44
pjb
pve: the only thing that clhs make-package says is: A correctable error is signaled if the package-name or any of the nicknames is already the name or nickname of an existing package.
15:21:29
pjb
It definitely means an instance of ERROR. At least, it doesn't mean a "direct instance of ERROR".
15:22:06
pjb
You can bet that clhs make-package was written before conditions such as package-error where defined.
15:28:17
beach
There is a lot of that in the standard. It is as if they ran out of time and couldn't go through every page one more time to make sure everything was up to date.
15:32:41
Bike
jcowan: it's actually just one now that i look at it - resolve-conflict. you pass it the symbol you want to keep for whatever operation and that's what's used. e.g. if the A package uses the B package, and you EXPORT B::FOO from B which causes a conflict with A::FOO, you can resolve-conflict with either a::foo or b:foo and the one you pick will be accessible in A
15:33:41
Bike
this is basically cribbed from sbcl, which briefly describes the mechanism in 7.11 of the manual
15:35:45
masinter
it wasn't a matter of running out of time. "is an error" was a way of allowing existing implementations to be compliant