spdegabrielle has quit [Quit: Connection closed for inactivity]
zwr has quit [Read error: Connection reset by peer]
rkazak has joined #commonlisp
soweli_iki has quit [Remote host closed the connection]
zwr has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
rkazak has quit [Ping timeout: 264 seconds]
amb007 has joined #commonlisp
gnoo has quit [Quit: WeeChat 4.4.2]
gnoo has joined #commonlisp
decweb has joined #commonlisp
Thermoriax has quit [Ping timeout: 252 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
v88m has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
decweb has quit [Ping timeout: 276 seconds]
rkazak has joined #commonlisp
JuanDaugherty has quit [Quit: JuanDaugherty]
mwnaylor has quit [Remote host closed the connection]
mwnaylor has joined #commonlisp
rkazak has quit [Ping timeout: 276 seconds]
v88m has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
<yaneko>
kathe: hi
v88m has joined #commonlisp
Thermoriax has joined #commonlisp
rkazak has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
v88m has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
triffid has joined #commonlisp
josrr has quit [Remote host closed the connection]
v88m has quit [Read error: Connection reset by peer]
yaneko4 has joined #commonlisp
yaneko has quit [Ping timeout: 244 seconds]
yaneko4 is now known as yaneko
nkatte has joined #commonlisp
nkatte has quit [Remote host closed the connection]
nkatte has joined #commonlisp
rkazak has joined #commonlisp
v88m has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
rendar has joined #commonlisp
chum-cha has quit [Ping timeout: 248 seconds]
v88m has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
JuanDaugherty has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
<BrokenCog>
I'm not sure why I'm getting the wrong value for this: (decode-universal-time 1304465246) ... on a Linux machine, date -d @ gives me 2025, however (decode-universal-time) is giving me 1955. any suggestions??
<BrokenCog>
(using sbcl)
random-nick has quit [Ping timeout: 252 seconds]
<BrokenCog>
ah sorry ... pasted the wrong epoch seconds ... 1736036907 is 1955 according to (decode-universal-time), but, date -d says it's 2025. the other number is 1941 according to sbcl, 2011 according to date
<bike>
what exactly are you doing with date?
<BrokenCog>
date -d @1736036907
<BrokenCog>
decodeing the seconds.
<bike>
i'm going to guess that's using posix time, so seconds since 1970
<Farooq>
Bubblegumdrop, Target audience is programmers but the link you gave doesn't show it at a glance
rkazak has joined #commonlisp
nkatte has joined #commonlisp
v88m has quit [Ping timeout: 244 seconds]
v88m has joined #commonlisp
JuanDaugherty has joined #commonlisp
Farooq has quit [Quit: Client closed]
<Bubblegumdrop>
yeah
<Bubblegumdrop>
I don't know any pages that show it off
<Bubblegumdrop>
I have a couple of books and the first chapter is usually something like "here's something you can do in lisp that you can't do easily in other languages"
Farooq has joined #commonlisp
<Farooq>
hmm okay. then the link I've found is the best
rkazak has quit [Ping timeout: 265 seconds]
vardhan has joined #commonlisp
<Bubblegumdrop>
Farooq the book referenced on that page, "Practical Common Lisp" is a good example
wacki has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 276 seconds]
shmorg83 has quit [Ping timeout: 248 seconds]
wacki has joined #commonlisp
v88m has joined #commonlisp
rkazak has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life has joined #commonlisp
szkl has quit [Quit: Connection closed for inactivity]
rkazak has quit [Ping timeout: 272 seconds]
v88m has quit [Remote host closed the connection]
v88m has joined #commonlisp
rkazak has joined #commonlisp
soweli_iki has joined #commonlisp
soweli_iki has quit [Changing host]
soweli_iki has joined #commonlisp
soweli_iki has quit [Remote host closed the connection]
basicnpc has joined #commonlisp
<basicnpc>
This is a coding style question - I have a function #'f that is supposed to throw a warning. In the test suite, I'd like to test that (f) does throw a warning, and go on testing that (f) returns 0. However, I don't know how to do this with HANDLER-CASE in one blow. Any idea?
trocado has quit [Remote host closed the connection]
<phoe>
;; also note that warnings are signaled, rather than thrown
Farooq has quit [Client Quit]
<phoe>
HANDLER-CASE won't let you continue execution after the warning is signaled, so you need HANDLER-BIND to actually get the return value after the warning
rkazak has quit [Ping timeout: 264 seconds]
<basicnpc>
A good example why handler-bind is useful! Thank you, phoe.
<basicnpc>
Are "signal" and "throw" technically different in CL term?
v88m has quit [Read error: Connection reset by peer]
<phoe>
yes
<phoe>
"throwing" names a completely different thing in lisp than in java or c++
<basicnpc>
I see, the special op THROW says it all. Thanks.
<phoe>
when a c++-esque exception is thrown, the stack is more or less immediately unwound as a means of handling the exception; when a lisp condition is signaled, the stack is wound further to handle the condition, and only sometimes unwinding happens, and some conditions (everything except serious-conditions!) are actually allowed to be left unhandled
<phoe>
THROW is meant for non-local transfers of control, non-local jumps, or stack unwinding
<phoe>
control is transferred to CATCH locations that are not lexically established at compilation time; if you can do it lexically, you should use BLOCK/RETURN-FROM instead
<phoe>
...or TAGBODY/GO, depending on what you want to do
<ixelp>
Control Flow in Common Lisp - Online Lisp Meeting #11, 26.11.2020 - YouTube
<phoe>
and the whole Lisp condition system is built on top of TAGBODY/GO and BLOCK/RETURN-FROM; you can somewhat easily reimplement it if you wish, see https://github.com/phoe/portable-condition-system
<ixelp>
GitHub - phoe/portable-condition-system: A portable Common Lisp condition system
<jackdaniel>
it also requires dynamic bindings a funcall (if we speak about low-level details)
<jackdaniel>
and a funcall *
<jackdaniel>
and by funcall I mean higher order functions
<phoe>
and lexical closures!
<basicnpc>
I watched that talk before :-)
<jackdaniel>
oh? why? (lexical closures)
<phoe>
for closing over tagbody tags/block names so that your handler-case/restart-case handlers can unwind properly
<phoe>
you can emulate this via throw/catch and gensyms, but it'll be a tad slower
<jackdaniel>
ok, fair
<phoe>
basicnpc: :D
<basicnpc>
In any case, THROW is about passing values, while SIGNAL is about passing conditions?
<basicnpc>
Here, "passing" is used none technically.
<phoe>
THROW is about making a non-local transfer of control while passing a value around
<phoe>
SIGNAL is about invoking handlers that match the condition type, in order, until the condition is handled (via a transfer of control) or until you run out of handlers to execute
<phoe>
WARN is like SIGNAL, except a message is printed if we run out of handlers
<basicnpc>
in that case, the signal goes to the top-level. If it's warning, it prints a warning; if it's an error, it the repl halts.
<phoe>
ERROR is like SIGNAL, except it enters the debugger instead of continuing - it's impossible to continue
<jackdaniel>
signal is, if we ignore some fluff: (defun signal (condition) (dolist (h *handlers*) (funcall handler)))
<jackdaniel>
(funcall handler condition) *
<phoe>
CERROR is like ERROR, but it actually is possible to continue - it establishes a CONTINUE restart that you can select if you're brave enough
<jackdaniel>
the handler may decline (i.e not handle the condition), or transfer the contorol
* phoe
steals that simplified DEFUN SIGNAL from jackdaniel
<jackdaniel>
stuff like error and whatnot may be implemented as the last handler; in common lisp we deal with handler clusters (that's what I mean by extra fluff) and restarts (which are technically a debugger thing)
<jackdaniel>
go ahead
<phoe>
...and with handlers having associated condition types (more extra fluff)
<jackdaniel>
while error would be (defun error (c) (signal c) (internal-error "debugger malfunctions"))
<jackdaniel>
and cerror being simply signal, when debugger declines, then we simply continue
<phoe>
and warn being (defun warn (c) (signal c) (format *error-output* ";; WARNING: ~A~%" c)), sans some fluff
<ixelp>
cafe-latte/src/main/java/systems/raptor/cafe_latte/control_flow/tagbody at main · phoe/cafe-latte · GitHub
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
JuanDaugherty has joined #commonlisp
<phoe>
treating blocks and tagbodies like objects, rather than compile-time constructs, is not efficient, but if you can express the logic *somewhere* then the rest of the condition system can follow
shmorg83 has joined #commonlisp
rkazak has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
shawnw has joined #commonlisp
basicnpc has quit [Ping timeout: 260 seconds]
<jackdaniel>
technically tagbody labels and blocks are continuations, so
<jackdaniel>
you know, just capture the stack :)
shmorg83 has quit [Ping timeout: 252 seconds]
shawnw_ has joined #commonlisp
FragmentedCurve has joined #commonlisp
shawnw has quit [Ping timeout: 246 seconds]
rkazak has quit [Ping timeout: 265 seconds]
v88m has joined #commonlisp
v88m has quit [Read error: Connection reset by peer]
Thermoriax has quit [Ping timeout: 260 seconds]
basicnpc has joined #commonlisp
basicnpc has quit [Changing host]
basicnpc has joined #commonlisp
mgl has quit [Ping timeout: 264 seconds]
spdegabrielle has joined #commonlisp
basicnpc has left #commonlisp [Using Circe, the loveliest of all IRC clients]
Everything has joined #commonlisp
rkazak has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
Thermoriax has joined #commonlisp
cdegroot has quit [Ping timeout: 276 seconds]
Thermoriax has quit [Remote host closed the connection]
cdegroot has joined #commonlisp
Thermoriax has joined #commonlisp
mwnaylor has joined #commonlisp
v88m has joined #commonlisp
rkazak has quit [Ping timeout: 272 seconds]
v88m has quit [Read error: Connection reset by peer]
JuanDaugherty has quit [Quit: JuanDaugherty]
cage has quit [Quit: rcirc on GNU Emacs 29.4]
Pixel_Outlaw has joined #commonlisp
attila_lendvai_ has joined #commonlisp
rkazak has joined #commonlisp
Thermoriax has quit [Ping timeout: 276 seconds]
wacki has quit [Quit: Leaving.]
Thermoriax has joined #commonlisp
cercopith has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
josrr has quit [Remote host closed the connection]
rkazak has quit [Ping timeout: 248 seconds]
Everything has quit [Quit: leaving]
zwr has quit [Read error: Connection reset by peer]
attila_lendvai_ has quit [Ping timeout: 246 seconds]
zwr has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
akoana has joined #commonlisp
mishoo has quit [Ping timeout: 264 seconds]
rkazak has joined #commonlisp
v88m has joined #commonlisp
rkazak has quit [Ping timeout: 265 seconds]
v88m has quit [Read error: Connection reset by peer]
olivial has quit [Ping timeout: 248 seconds]
dino_tutter has quit [Ping timeout: 244 seconds]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
olivial has joined #commonlisp
elnegro has joined #commonlisp
pve has quit [Quit: leaving]
elnegro has quit []
rtypo has quit [Read error: Connection reset by peer]