Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Signaling a simple error would signal another error if the message happened to have a ~ in it #41
since in simple cases there are no format args, but format is called with the message string. I searched for all cases in the source where there were calls to setFormatControl(x) followed by setFormatArguments(NIL). In such cases I changed setFormatControl(x) -> setFormatControl(x.replaceAll("~","~~")). An example that would trigger the double error was compiling (defun foo (x) ("This should be quoted ~a" x)).
While, I think I understand what sort of behavior you are trying to address here, I can't seem to see a "before and after" difference.
Could you please expand on the test case?
The test form as you wrote it
doesn't compile, but doesn't seem to give a "double error" either with or without this changeset applied.
I tried to guess at how to otherwise trigger the double error:
but this seems to sensibly return
Can you help my understanding here by refining the test case to trigger the double error please?
into a file. Compile and load the file in slime.
I think that should work, or
You can tell there will be problems just looking at the code.
The problem was noticed while debugging in slime. The error shown was a format error. After some consternation I realized that it was a program-error that was the problem - I wasn't calling format in the code. I then looked at code for ProgramError, realized that it was buggy, and chose this as a solution. The alternative was tracking down any case that might embed a tilde and fixing it at the source, but that wouldn't protect against future transgression.
Replication recipe for posterity:
Place the following in a <file:~/work/abcl/double-error.lisp>