Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
phoe-krk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
71 ms
·
901.
▲
by
phoe-krk
6y ago
It is an upcoming book, as the title describes. It will be available later in the year.
902.
▲
by
phoe-krk
6y ago
The PCL description is a good one. My book expands on it two ways. First, I describe how the condition system can be used to work with conditions that are not errors and therefore do not require to be handled; Peter Seibel calls SIGNAL a
903.
▲
by
phoe-krk
6y ago
> once you're into mixed condition and exception based code of course things that to get more "fun". I imagine that is the reality of everyone who tries to implement a condition system in a language where the default beh
904.
▲
by
phoe-krk
6y ago
> You're hitting an unexpected condition then trying to handle the resultant exception intelligently, whereas you should have considered that possibility up-front and handled it non-exceptionally. That is the inverse of the idea.
905.
▲
by
phoe-krk
6y ago
I'll keep that in mind, and I'll add that link to the book's contents, and I'll add you to my book's Hall of Fame. Thanks.
906.
▲
by
phoe-krk
6y ago
Thanks. It was you who directed me towards this implementation and made it possible for me to mention it in the book, though, so I only consider it fair if I also add you to the book's Hall of Fame.
907.
▲
by
phoe-krk
6y ago
The online version of Practical Common Lisp was published fifteen years ago, well before the ebook market was as developed as it is now. Given the current market situation, I've made the decision to go the same way that Common Lisp Rec
908.
▲
by
phoe-krk
6y ago
Yes. Destructors are an equivalent of UNWIND-PROTECT, just like Java's finally{...} block of the try/catch/finally trio. Thank you for mentioning Worlogog, I'll include that in the book. How should I credit you?
909.
▲
by
phoe-krk
6y ago
> and you can always spin up more I think it depends on your OS. IIRC, on Windows, it was fairly easy to destabilize the OS by spawning threads in a loop and starving other processes on the system. I haven't used Windows in a long
910.
▲
by
phoe-krk
6y ago
That would definitely be very feasible with Erlang-style processes, but contemporary Common Lisp implementations do not come equipped with those.
911.
▲
by
phoe-krk
6y ago
Nope, it won't be free as in beer. The ebook will be purchasable when the dead-tree book arrives, but I don't yet know the price for it.
912.
▲
by
phoe-krk
6y ago
> Instead they return back up the stack to whoever called the function that signalled the condition. Not necessarily. They may return to any point on the stack that has been "announced" as a valid return point. One can comput
913.
▲
by
phoe-krk
6y ago
I know Baggers and his videos but I wasn't aware that he does debugger-oriented programming. Thanks, I'll pay closer attention to them!
914.
▲
by
phoe-krk
6y ago
> You can't quite stash the condition in a database and wait until everyone returns from the holiday to resume progress, but that's merely a technical limitation of the normal lisp compilers that are currently available. I thin
915.
▲
by
phoe-krk
6y ago
Sure, that's doable. CL, being multi-paradigm, supports functional programming idioms.
916.
▲
by
phoe-krk
6y ago
Thank you! I will include this in the book. How should I credit you?
917.
▲
by
phoe-krk
6y ago
Yes, you are correct! (And you don't sound negative just yet; skeptical, if anything.) The mechanism of handlers is literally a mechanism of dynamically provided callbacks. I draw the parallel between condition handlers and callbacks
918.
▲
by
phoe-krk
6y ago
I've replied to the parent comment with a different, more complex example. Is it more illustrative than the previous one?
919.
▲
by
phoe-krk
6y ago
There's no internal state of the callee leaking out. The act of communication between the signaling site and the handling function is done via condition objects - which are just like standard Lisp classes whose slots can be read by the
920.
▲
by
phoe-krk
6y ago
Sure. The type-error example shown here is easily fixable by languages which utilize static typing and therefore make invalid code uncompilable, but it has the advantage of being easily understood by almost all programmers. A more contrived
921.
▲
by
phoe-krk
6y ago
Using the word "alien" in context of a language often described as "made with alien technology" sounds peculiarly fitting. The image-based Lisp is just very very different when compared to mainstream batch languages like
922.
▲
by
phoe-krk
6y ago
The main part of the book outlines multiple ways of dealing with exceptional situations, including the handler and restart subsystems of the condition system. It also includes a section with some use cases of the condition system outside
923.
▲
by
phoe-krk
6y ago
Do you have any videos of such programming style performed in Lisp, or could you try to convince some of those programmers to record some of their programming sessions?
924.
▲
by
phoe-krk
6y ago
The book mentions that fact. The commit that removed them (along with the rationale) is available at https://github.com/rust-lang/rust/commit/454882dcb7fdb03867d...
925.
▲
by
phoe-krk
6y ago
Thanks. Hope that it turns out insightful for you. (Also, Common Lisp isn't a functional language. It's a multiparadigm one that often gets the label of being a functional one because Scheme and Clojure are really functionally ori
926.
▲
by
phoe-krk
6y ago
Not at all. It is a consequence of language design of other languages. When you divide by zero in Java, then there is nothing set in stone that prevents the language from winding the stack further and executing some code that will analyze
927.
▲
by
phoe-krk
6y ago
I'd put TCLCS after SICP and HTDP; these are introductory books to programming in general and therefore are prerequisites to working with a condition system. Or, in other words, one shouldn't read a book about handling exceptional
928.
▲
by
phoe-krk
6y ago
That's not enough. The condition system decouples the act of signaling a condition from the act of deciding how to handle it. This means that the promise would need to reach out to its dynamic environment to figure out what it would ne
929.
▲
by
phoe-krk
6y ago
C's longjmp doesn't cleanly unwind the stack. Common Lisp's GO, just like all CL control flow operators, cleanly unwind the stack, allowing cleanup forms established by UNWIND-PROTECT to be executed. That's the key diffe
930.
▲
by
phoe-krk
6y ago
Trivia: Kent M. Pitman (also known as kmp) is the father of the condition system as it exists nowadays. The code in the book is based on Portable Condition System - a library that I have created, and Portable Condition System itself is in t
More ›