Guest7041 has quit [Killed (tantalum.libera.chat (Nickname regained by services))]
pabs3 has joined #commonlisp
puercopop has joined #commonlisp
markb1 has joined #commonlisp
decweb has quit [Quit: Konversation terminated!]
stirl2 has quit [Ping timeout: 252 seconds]
CrashTestDummy has joined #commonlisp
Ruby has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
CrashTestDummy has quit [Client Quit]
stirl has joined #commonlisp
markb1 has quit [Ping timeout: 252 seconds]
mosin has quit [Remote host closed the connection]
<fengshaun>
I'm trying to understand how spinneret:with-html works, and I'm wondering why it's using *html* rather than a passed-in stream. I was just banging my head trying to figure out how to use the output of with-html vs with-html-string.
<fengshaun>
how do I get the output of spinneret:with-html ?
<fengshaun>
with-html-string messes up the formatting/indent
<fengshaun>
(get-output-stream-string *html*) doesn't work since *html* is not an output-stream
<fengshaun>
and I can't follow the source properly
triffid has quit [Remote host closed the connection]
markb1 has joined #commonlisp
triffid has joined #commonlisp
shka has joined #commonlisp
<mange>
How does with-html-string mess up your formatting?
<mange>
I think you can just use let to bind *html* to whatever stream you want to write the output to. with-html-string just binds *html* using with-output-to-string, which returns the resulting string.
markb1 has quit [Ping timeout: 248 seconds]
jadzi has joined #commonlisp
<fengshaun>
doesn't seem to follow with-html's formatting, it's not major. I was trying to figure out the dynamic variable bindings.
<fengshaun>
I think I'm understanding it now. Thanks.
vardhan has quit [Ping timeout: 252 seconds]
<JoshYoshi>
Put with-html-string at the top, then with-html in any subsequent calls that are inside of with-html-string
<fengshaun>
I was using :raw, which was likely messing things up
edgar-rft has quit [Ping timeout: 252 seconds]
<JoshYoshi>
I absolutely love spinneret. I used the allegro version recently and frankly its dog doo doo in comparison
markb1 has joined #commonlisp
pve has joined #commonlisp
Posterdati has joined #commonlisp
skeemer has quit [Ping timeout: 244 seconds]
mishoo has joined #commonlisp
markb1 has quit [Ping timeout: 252 seconds]
King_julian has joined #commonlisp
markb1 has joined #commonlisp
vardhan has joined #commonlisp
Guest47 has joined #commonlisp
<fengshaun>
finally understand how the binding works, needed to separate the toplevel and the recursive part
istewart has quit [Quit: Konversation terminated!]
<fengshaun>
playing nice with djula's `safe` filter as well!
bpanthi977 has quit [Ping timeout: 252 seconds]
GalaxyNova has quit [Ping timeout: 268 seconds]
markb1 has quit [Ping timeout: 276 seconds]
<mgl>
ASDF:TEST-SYTEM runs tests in a WITH-COMPILATION-UNIT, meaning that unhandled warnings (no NLX performed) will be reported at the end. But there are tests that check that the right kind of warning is signalled by a function and also check its return values. In this case, the warning must not be handled. Still, I would like to silence the warnings deferred to the end of the compilation unit. How?
markb1 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life_ is now known as Lord_of_Life
markb1 has quit [Ping timeout: 244 seconds]
vardhan_ has joined #commonlisp
markb1 has joined #commonlisp
cage has joined #commonlisp
vardhan has quit [Ping timeout: 252 seconds]
Guest57 has joined #commonlisp
Guest27 has joined #commonlisp
Guest27 has left #commonlisp [#commonlisp]
Guest57 has quit [Quit: Client closed]
<beach>
Isn't it just warnings about undefined functions that are handled and reported at the end?
X-Scale has joined #commonlisp
<beach>
I think the idea is that if you have a call to a function that is defined later in the file, the warning is not signaled at all, so warnings about undefined functions must be delayed, and perhaps not signaled.
<mgl>
On SBCL, (with-compilation-unit () (subtypep nil 'junk))
<beach>
What is that form meant to demonstrate?
<mgl>
If evaluated, "undefined type: COMMON-LISP-USER::JUNK" warning is printed at the end of the compilation unit.
usagi_mimi has quit [Quit: WeeChat 4.5.2]
<beach>
How can you tell when there is just one form in the compilation unit?
<beach>
And, maybe the idea here is that the type might be defined later in the compilation unit. But I would be surprised if all warnings were delayed.
markb1 has quit [Ping timeout: 248 seconds]
<beach>
Then again, maybe this aspect of the standard is not well specified.
<beach>
A case for WSCL perhaps.
<mgl>
I didn't want to paste the full output here, but the output starts with "; in: WITH-COMPILATION-UNIT () (SUBTYPEP NIL 'JUNK)"
<mgl>
Indeed, a simple WARN is not delayed.
<jackdaniel>
with compilation unit may but does not have to DEFER some warnings
<scymtym>
in the context of testing warning related behavior of the compiler, wouldn't appropriate code be like (block nil (handler-bind ((warning (lambda (c) (muffle-warning) (return)))) (compile nil '(lambda () (subtypep nil 'junk))) (fail)))
<mgl>
Yes, but the question still stands: how do I prevent warning that would be deferred from getting deferred without handling them?
King_julian has quit [Ping timeout: 276 seconds]
<mgl>
(handler-bind ((warning #'muffle-warning)) (compile nil '(lambda () (subtypep nil 'junk)))) is silent but (with-compilation-unit () (handler-bind ((warning #'muffle-warning)) (compile nil '(lambda () (subtypep nil 'junk))))) is not.
<scymtym>
and/or bind the standard streams to broadcast-stream instances
<scymtym>
SBCL's checked-compile macro is an existing example that should be pretty close to the desired behavior
<jackdaniel>
technically something else (spooky) could handle warning signals from the outside and display them by other means
markb1 has joined #commonlisp
<mgl>
(handler-case (with-compilation-unit () (subtypep nil 'junk)) (warning ())) makes SBCL less wordy, but it still prints the warning as part of the summary.
<jackdaniel>
n.b you don't want to use handler-case, because it will break the execution at the point that the warning is signaled
<mgl>
Ah, I see. This works, but it silences all warnings, some of which are informative.
<jackdaniel>
you can't eat the cake and have it too. best you can do is to handle style warnings, or list particular leaf classes you are interested in (but not all warnings are specialized)
<jackdaniel>
alt something like (handler-bind ((warning (lambda (c) (when (uninteresting-p c) (muffle-warning))))) ...)
<jackdaniel>
and implement uninteresting-p to your liking
<mgl>
Is it reasonable though for ASDF:TEST-SYSTEM to run tests in W-C-U?
<jackdaniel>
my knee jerk reaction would be that things that asdf do are rarely reasonable :)
<jackdaniel>
(unrelated) we say that a condition is signaled in Common Lisp (instead of an exception being thrown), but it is not a complete story. semantics are very different if we signal the condition with ERROR and with SIGNAL -- the former will invoke a debugger when there is no control transfer, while the latter will silently return
<jackdaniel>
"the condition has been errored" doesn't make sense either, so I think that "throwing a condition" with ERROR would be a nice phrase to contrast it with "signaling a condition" with SIGNAL
runxiyu has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
runxiyu has joined #commonlisp
<mgl>
As long as SERIOUS-CONDITIONS are only signalled with ERROR and the rest with SIGNAL there is no confusion. Or should that not always be the case?
<jackdaniel>
you can signal a condition of type ERROR and you won't be placed in the debugger
chomwitt has quit [Ping timeout: 260 seconds]
<jackdaniel>
i.e whether the debugger is invoked is not a function of the condition type but rather a function of the used operator
<mgl>
Yes, I get that.
<jackdaniel>
we can make pinky swear to always do that, but improving terminology helps to distinguish semantically different actions
<mgl>
I've considered this terminology question when writing documentation (see e.g. https://github.com/melisgl/mgl-pax/ and search for "is signalled") but all the precise wording seemed to cumbersome, so I left it implicit that errors, warnings, etc are signalled appropriately.