Fix a problem printing slice errors, fix a load order issue
parent
6c7325706d
commit
bcf30cf1af
|
@ -9,6 +9,9 @@ USING: generic namespaces sequences ;
|
||||||
IN: errors
|
IN: errors
|
||||||
USING: kernel ;
|
USING: kernel ;
|
||||||
|
|
||||||
|
SYMBOL: error
|
||||||
|
SYMBOL: error-continuation
|
||||||
|
|
||||||
: catch ( try -- error | try: -- )
|
: catch ( try -- error | try: -- )
|
||||||
[ >c call f c> drop f ] callcc1 nip ; inline
|
[ >c call f c> drop f ] callcc1 nip ; inline
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
USING: errors help kernel kernel-internals ;
|
USING: errors help kernel kernel-internals ;
|
||||||
|
|
||||||
|
HELP: error f
|
||||||
|
{ $description "Global variable holding most recently thrown error." }
|
||||||
|
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
||||||
|
|
||||||
|
HELP: error-continuation f
|
||||||
|
{ $description "Global variable holding current continuation of most recently thrown error." }
|
||||||
|
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
||||||
|
|
||||||
HELP: >c "( continuation -- )"
|
HELP: >c "( continuation -- )"
|
||||||
{ $values { "continuation" "a continuation" } }
|
{ $values { "continuation" "a continuation" } }
|
||||||
{ $description "Pushes an exception handler continuation on the catch stack. The continuation must have been reified by " { $link callcc1 } "." } ;
|
{ $description "Pushes an exception handler continuation on the catch stack. The continuation must have been reified by " { $link callcc1 } "." } ;
|
||||||
|
|
|
@ -19,8 +19,6 @@ M: tuple error-help ( error -- topic ) class ;
|
||||||
|
|
||||||
M: string error. ( error -- ) print ;
|
M: string error. ( error -- ) print ;
|
||||||
|
|
||||||
SYMBOL: error
|
|
||||||
SYMBOL: error-continuation
|
|
||||||
SYMBOL: restarts
|
SYMBOL: restarts
|
||||||
|
|
||||||
: :s error-continuation get continuation-data stack. ;
|
: :s error-continuation get continuation-data stack. ;
|
||||||
|
@ -68,7 +66,7 @@ SYMBOL: restarts
|
||||||
":s - data stack at exception time" [ :s ] (debug-help)
|
":s - data stack at exception time" [ :s ] (debug-help)
|
||||||
":r - retain stack at exception time" [ :r ] (debug-help)
|
":r - retain stack at exception time" [ :r ] (debug-help)
|
||||||
":c - call stack at exception time" [ :c ] (debug-help)
|
":c - call stack at exception time" [ :c ] (debug-help)
|
||||||
":get ( var -- value ) accesses variables at time of error" print
|
":get ( var -- value ) accesses variables at time of the error" print
|
||||||
flush ;
|
flush ;
|
||||||
|
|
||||||
: print-error ( error -- )
|
: print-error ( error -- )
|
||||||
|
|
|
@ -2,14 +2,6 @@ IN: errors
|
||||||
USING: alien arrays generic help inference kernel math memory
|
USING: alien arrays generic help inference kernel math memory
|
||||||
strings vectors ;
|
strings vectors ;
|
||||||
|
|
||||||
HELP: error f
|
|
||||||
{ $description "Global variable holding most recently thrown error." }
|
|
||||||
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
|
||||||
|
|
||||||
HELP: error-continuation f
|
|
||||||
{ $description "Global variable holding current continuation of most recently thrown error." }
|
|
||||||
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
|
||||||
|
|
||||||
HELP: restarts f
|
HELP: restarts f
|
||||||
{ $description "Global variable holding the set of possible restarts for the most recently thrown error." }
|
{ $description "Global variable holding the set of possible restarts for the most recently thrown error." }
|
||||||
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
||||||
|
|
|
@ -134,7 +134,7 @@ M: no-cond summary
|
||||||
|
|
||||||
M: slice-error error.
|
M: slice-error error.
|
||||||
"Cannot create slice because " write
|
"Cannot create slice because " write
|
||||||
slice-error-reason append print ;
|
slice-error-reason print ;
|
||||||
|
|
||||||
M: no-word summary
|
M: no-word summary
|
||||||
drop "Word not found in current vocabulary search path" ;
|
drop "Word not found in current vocabulary search path" ;
|
||||||
|
|
Loading…
Reference in New Issue