libera/#commonlisp - IRC Chatlog
Search
6:38:43
beach
The term "visible" is used about a restart in RESTART-BIND and RESTART-CASE and it is related to the return value of the test function. But I can't see a definition of "visible" nor the relation between "visible" and "active" when it comes to restarts. Any hints?
6:42:02
jackdaniel
isn't it that visible means "invokable" while active means "present in the dynamic context"? I don't have a quote
6:44:29
jackdaniel
in http://www.lispworks.com/documentation/HyperSpec/Body/m_rst_ca.htm (:test arg): "... that returns true if the restart is to be considered visible."
6:44:50
jackdaniel
and in the Description: "In this case, the dynamic state is unwound appropriately (so that the restarts established around the restartable-form are no longer active) prior to execution of the clause. "
6:48:18
jackdaniel
we've discussed that earlier, if it is simply appended to the list then it will be correctly unwound either way
6:49:10
jackdaniel
(I think that the quote brought by scymtym is more in favor of restart clustering)
6:50:00
jackdaniel
btw, compute-restarts uses the term "applicable restarts" (which has a glossary entry) instead of "visible", but the context seem indicate that both term describe the same thing
7:39:02
beach
I think I have made up my mind. It seems "visible" is mentioned only in connection with the TEST-FUNCTION, so I'll define "visible" to mean "the TEST-FUNCTION returns true", and I will consider that a restart can be returned by FIND-RESTART or COMPUTE-RESTARTS only if it is visible.
7:44:23
beach
Almost. If by some secret way you could obtain a reference to an invisible restart, you could invoke it.
7:47:48
jackdaniel
do you have any plausible interpretation except for the "test associated with the restart"?
7:48:27
beach
The test being referred to seems to involve the association between a restart and a condition, and that has nothing to do with the test-function.
7:49:02
jackdaniel
the test function accepts one argument, that is the condition (see the initarg :test)
7:52:36
jackdaniel
that was my initial impression, but you've hinted something above, that "visible" means only that the test function returns T
7:52:46
beach
But it is not true that COMPUTE-RESTARTS returns all applicable restarts. A restart has to be active as well in order to be returned.
7:53:51
jackdaniel
the glossary entry says: "applicable restart n. 1. (for a condition) an active handler for which the associated test returns true when given the condition as an argument. 2. (for no particular condition) an active handler for which the associated test returns true when given nil as an argument. "
8:19:39
beach
One quirk though. If we take the "associated test" in the glossary entry for "applicable restart" to mean the TEST-FUNCTION, then it implies that we can call the test function with NIL and it should then return true.
8:20:24
beach
I think it is safest to assume that we can not call the test function with NIL, and if we have "no particular condition" we should not call the test function at all.
8:36:09
jackdaniel
that's not very conservative though, I'd rather fix the description of ":test" to explicitly allow nil
10:17:44
beach
I fear that someone who reads the dictionary entry for RESTART-BIND or RESTART-CASE might create a TEST-FUNCTION that does not work if passed NIL as an argument.
14:17:01
beach
What standard special forms or macros have a list of "bindings" other than LET, LET*, HANDLER-BIND, and RESTART-BIND?
14:18:35
beach
I mean syntactically, so that some part of the form can be identified as such a list of bindings.
14:22:44
ogamita
Also, binding is something that is established at run-time, so I wouldn't make such a difference between progv and let…
14:23:20
beach
For context, I am working on Iconoclast, which is a library defining ASTs for standard special forms and macros, and I am trying to identify reasonable mixin classes. That's why I am interested only in operators where the list of bindings is syntactically apparent.
14:25:34
bike
the format of the bindings is different for a lot of these, though. like LET is symbol | (symbol [value]), which is not what handler-bind or flet have.
14:38:29
beach
The idea is to extract certain features to mixin classes to avoid code duplication. Like bindings, declarations, documentation, body, clauses, ...