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