]> gitweb.factorcode.org Git - factor.git/commitdiff
extra: use throw-foo for ERROR: change
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 13 Aug 2015 08:56:32 +0000 (01:56 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 13 Aug 2015 08:56:32 +0000 (01:56 -0700)
95 files changed:
extra/alien/cxx/demangle/libstdcxx/libstdcxx.factor
extra/alien/fortran/fortran.factor
extra/arrays/shaped/shaped.factor
extra/asn1/asn1.factor
extra/audio/audio.factor
extra/audio/chunked-file/chunked-file.factor
extra/audio/engine/engine.factor
extra/audio/loader/loader.factor
extra/audio/vorbis/vorbis.factor
extra/backtrack/backtrack.factor
extra/base85/base85.factor
extra/benchmark/chameneos-redux/chameneos-redux.factor
extra/benchmark/tcp-echo0/tcp-echo0.factor
extra/bit/ly/ly.factor
extra/bloom-filters/bloom-filters.factor
extra/bson/reader/reader.factor
extra/c/preprocessor/preprocessor.factor
extra/cairo-demo/cairo-demo.factor
extra/constructors/constructors.factor
extra/cpu/8080/emulator/emulator.factor
extra/crypto/aes/aes.factor
extra/crypto/xor/xor.factor
extra/cuda/cuda.factor
extra/cuda/libraries/libraries.factor
extra/cuda/nvcc/nvcc.factor
extra/cuesheet/cuesheet.factor
extra/curses/curses.factor
extra/cursors/cursors.factor
extra/decimals/decimals-tests.factor
extra/decimals/decimals.factor
extra/descriptive/descriptive.factor
extra/dns/dns.factor
extra/forestdb/lib/lib.factor
extra/forestdb/paths/paths.factor
extra/fullscreen/fullscreen.factor
extra/game/models/collada/collada.factor
extra/game/models/loader/loader.factor
extra/gopher/gopher.factor
extra/gpu/render/render.factor
extra/gpu/shaders/shaders.factor
extra/graphviz/render/render.factor
extra/html/parser/analyzer/analyzer.factor
extra/images/atlas/atlas.factor
extra/images/bitmap/bitmap.factor
extra/images/gif/gif.factor
extra/images/png/png.factor
extra/images/tga/tga.factor
extra/images/tiff/tiff.factor
extra/imap/imap-tests.factor
extra/imap/imap.factor
extra/infix/infix.factor
extra/io/binary/fast/fast.factor
extra/io/files/acls/macosx/ffi/ffi.factor
extra/io/files/acls/macosx/macosx.factor
extra/io/streams/zeros/zeros.factor
extra/ip-parser/ip-parser.factor
extra/machine-learning/rebalancing/rebalancing.factor
extra/macho/macho.factor
extra/managed-server/managed-server.factor
extra/mason/common/common.factor
extra/math/derivatives/derivatives.factor
extra/math/matrices/laplace/laplace.factor
extra/math/transforms/fft/fft.factor
extra/memcached/memcached.factor
extra/memory/piles/piles.factor
extra/metar/metar.factor
extra/money/money.factor
extra/mongodb/connection/connection.factor
extra/mongodb/driver/driver.factor
extra/morse/morse.factor
extra/msgpack/msgpack.factor
extra/noise/noise.factor
extra/opencl/ffi/ffi-tests.factor
extra/opencl/opencl.factor
extra/pair-methods/pair-methods.factor
extra/pairs/pairs.factor
extra/pcre/pcre.factor
extra/poker/poker.factor
extra/progress-bars/progress-bars.factor
extra/redis/response-parser/response-parser.factor
extra/resolv-conf/resolv-conf.factor
extra/roles/roles.factor
extra/smalltalk/classes/classes.factor
extra/smalltalk/compiler/lexenv/lexenv.factor
extra/smalltalk/parser/parser.factor
extra/tar/tar.factor
extra/taxes/usa/fica/fica.factor
extra/terminfo/terminfo.factor
extra/tzinfo/tzinfo.factor
extra/units/units.factor
extra/usa-cities/usa-cities.factor
extra/uu/uu.factor
extra/vocabs/git/git.factor
extra/yaml/yaml.factor
extra/zoneinfo/zoneinfo.factor

index 3487423504eb7ff8056c97123a5de011bc346568..43e33d39916651d15fa3e0a121c2fb7a41ebe6b7 100644 (file)
@@ -13,9 +13,9 @@ ERROR: invalid-demangle-args name ;
 : demangle-error ( name status -- )
     {
         {  0 [ drop ] }
-        { -1 [ drop demangle-memory-allocation-failure ] }
-        { -2 [ invalid-mangled-name ] }
-        { -3 [ invalid-demangle-args ] }
+        { -1 [ drop throw-demangle-memory-allocation-failure ] }
+        { -2 [ throw-invalid-mangled-name ] }
+        { -3 [ throw-invalid-demangle-args ] }
     } case ;
 
 : mangled-name? ( name -- ? )
index 34405c6c87e7c5c640e30a65ea0b46b4e96a77e3..2d5d98d01f2f3a3c35e714af6586780dc5a9a373 100755 (executable)
@@ -102,12 +102,12 @@ CONSTANT: fortran>c-types H{
     dims>> [ product 2array ] when* ;
 
 MACRO: size-case-type ( cases -- quot )
-    [ invalid-fortran-type ] suffix
+    [ throw-invalid-fortran-type ] suffix
     '[ [ size>> _ case ] [ append-dimensions ] bi ] ;
 
 : simple-type ( type base-c-type -- c-type )
     swap
-    [ dup size>> [ invalid-fortran-type ] [ drop ] if ]
+    [ dup size>> [ throw-invalid-fortran-type ] [ drop ] if ]
     [ append-dimensions ] bi ;
 
 : new-fortran-type ( out? dims size class -- type )
@@ -150,7 +150,7 @@ M: misc-type (fortran-type>c-type)
 
 : fix-character-type ( character-type -- character-type' )
     clone dup size>>
-    [ dup dims>> [ invalid-fortran-type ] [ dup size>> 1array >>dims f >>size ] if ]
+    [ dup dims>> [ throw-invalid-fortran-type ] [ dup size>> 1array >>dims f >>size ] if ]
     [ dup dims>> [ ] [ f >>dims ] if ] if
     dup single-char? [ f >>dims ] when ;
 
@@ -212,7 +212,7 @@ M: integer-type (fortran-arg>c-args)
             { 2 [ [ c:short <ref>   ] [ drop ] ] }
             { 4 [ [ c:int <ref>     ] [ drop ] ] }
             { 8 [ [ c:longlong <ref> ] [ drop ] ] }
-            [ invalid-fortran-type ]
+            [ throw-invalid-fortran-type ]
         } case
     ] args?dims ;
 
@@ -225,7 +225,7 @@ M: real-type (fortran-arg>c-args)
             { f [ [ c:float <ref> ] [ drop ] ] }
             { 4 [ [ c:float <ref> ] [ drop ] ] }
             { 8 [ [ c:double <ref> ] [ drop ] ] }
-            [ invalid-fortran-type ]
+            [ throw-invalid-fortran-type ]
         } case
     ] args?dims ;
 
@@ -235,7 +235,7 @@ M: real-complex-type (fortran-arg>c-args)
             {  f [ [ <complex-float>  ] [ drop ] ] }
             {  8 [ [ <complex-float>  ] [ drop ] ] }
             { 16 [ [ <complex-double> ] [ drop ] ] }
-            [ invalid-fortran-type ]
+            [ throw-invalid-fortran-type ]
         } case
     ] args?dims ;
 
@@ -266,7 +266,7 @@ M: integer-type (fortran-result>)
             { 2 [ { [ c:short deref    ] } ] }
             { 4 [ { [ c:int deref      ] } ] }
             { 8 [ { [ c:longlong deref ] } ] }
-            [ invalid-fortran-type ]
+            [ throw-invalid-fortran-type ]
         } case
     ] result?dims ;
 
@@ -278,7 +278,7 @@ M: real-type (fortran-result>)
         { f [ { [ c:float deref ] } ] }
         { 4 [ { [ c:float deref ] } ] }
         { 8 [ { [ c:double deref ] } ] }
-        [ invalid-fortran-type ]
+        [ throw-invalid-fortran-type ]
     } case ] result?dims ;
 
 M: real-complex-type (fortran-result>)
@@ -286,7 +286,7 @@ M: real-complex-type (fortran-result>)
         {  f [ { [ *complex-float  ] } ] }
         {  8 [ { [ *complex-float  ] } ] }
         { 16 [ { [ *complex-double ] } ] }
-        [ invalid-fortran-type ]
+        [ throw-invalid-fortran-type ]
     } case ] result?dims ;
 
 M: double-precision-type (fortran-result>)
index 70f985c78d8f1123566145bf7450eda1e7a8cc8d..b411ebd132566f59775ebb011028c3d9f04e543e 100644 (file)
@@ -47,7 +47,7 @@ M: sequence shape array-replace wrap-shape ;
 ERROR: no-negative-shape-components shape ;
 
 : check-shape-domain ( seq -- seq )
-    dup [ 0 < ] any? [ no-negative-shape-components ] when ;
+    dup [ 0 < ] any? [ throw-no-negative-shape-components ] when ;
 
 GENERIC: shape-capacity ( shape -- n )
 
@@ -68,20 +68,20 @@ ERROR: no-abnormally-shaped-arrays underlying shape ;
 GENERIC: check-underlying-shape ( underlying shape -- underlying shape )
 
 M: abnormal-shape check-underlying-shape
-    no-abnormally-shaped-arrays ;
+    throw-no-abnormally-shaped-arrays ;
 
 M: uniform-shape check-underlying-shape
     shape>> check-underlying-shape ;
 
 M: sequence check-underlying-shape
     2dup [ length ] [ shape-capacity ] bi*
-    = [ underlying-shape-mismatch ] unless ; inline
+    = [ throw-underlying-shape-mismatch ] unless ; inline
 
 ERROR: shape-mismatch shaped0 shaped1 ;
 
 : check-shape ( shaped-array shaped-array -- shaped-array shaped-array )
     2dup [ shape>> ] bi@
-    sequence= [ shape-mismatch ] unless ;
+    sequence= [ throw-shape-mismatch ] unless ;
 
 TUPLE: shaped-array underlying shape ;
 TUPLE: row-array < shaped-array ;
index ad86a8877d4b2e9e056d328abea96920e0268fb2..40819a1302d69cd7f8b68ea163fb3885cefb91a4 100644 (file)
@@ -76,7 +76,7 @@ ERROR: unsupported-tag-encoding id ;
     elements get id>> 31 bitand
     dup elements get tag<<
     31 < [
-        get-id unsupported-tag-encoding
+        get-id throw-unsupported-tag-encoding
     ] unless ;
 
 : set-tagclass ( -- )
index dab3be1363e0e3e7e22f4978c1cc9a4d11453f87..fcd36a27bbcbf4964a6973ec4bdf56c528dd0151 100644 (file)
@@ -19,5 +19,5 @@ ERROR: format-unsupported-by-openal audio ;
         { { 1 16 } [ drop AL_FORMAT_MONO16   ] }
         { { 2  8 } [ drop AL_FORMAT_STEREO8  ] }
         { { 2 16 } [ drop AL_FORMAT_STEREO16 ] }
-        [ drop format-unsupported-by-openal ]
+        [ drop throw-format-unsupported-by-openal ]
     } case ;
index 271e56b1714baf66d19ab950a2fa528ee8f53357..01f2d9b109cf374e0a36b5b82a7aa1517433857a 100644 (file)
@@ -8,7 +8,7 @@ ERROR: invalid-audio-file ;
 : ensured-read ( count -- output/f )
     [ read ] keep over length = [ drop f ] unless ;
 : ensured-read* ( count -- output )
-    ensured-read [ invalid-audio-file ] unless* ;
+    ensured-read [ throw-invalid-audio-file ] unless* ;
 
 : read-chunk ( -- byte-array/f )
     4 ensured-read [ 4 ensured-read* dup endian> ensured-read* 3append ] [ f ] if* ;
index 5da13cd33e9bb50c3b50fd52092cf5ad24ab132f..16d82ca55e221733f5dfba9002f2036051ed1b14 100644 (file)
@@ -94,11 +94,11 @@ ERROR: audio-context-not-available device-name ;
 :: <audio-engine> ( device-name voice-count -- engine )
     [
         device-name alcOpenDevice :> al-device
-        al-device [ device-name audio-device-not-found ] unless
+        al-device [ device-name throw-audio-device-not-found ] unless
         al-device |alcCloseDevice* drop
 
         al-device f alcCreateContext :> al-context
-        al-context [ device-name audio-context-not-available ] unless
+        al-context [ device-name throw-audio-context-not-available ] unless
         al-context |alcDestroyContext drop
 
         al-context alcSuspendContext
index d1cb43aa3cd0b232e0f9305316a638f3d21edf25..ba2a346f7d39e701b86a2435bc1978179494fc6b 100644 (file)
@@ -14,7 +14,7 @@ audio-types [ H{ } clone ] initialize
 : read-audio ( path -- audio )
     dup file-extension >lower audio-types get ?at
     [ call( path -- audio ) ]
-    [ unknown-audio-extension ] if ;
+    [ throw-unknown-audio-extension ] if ;
 
 "audio.wav" require
 "audio.aiff" require
index d8036b4ee0fd980fa77e846c76f4a72bf8e1058a..eae8b48509a7918c07286d787ee82be9b3bce56b 100644 (file)
@@ -48,7 +48,7 @@ ERROR: no-vorbis-in-ogg ;
     stream>> read-bytes-into ; inline
 
 : ?ogg-error ( n -- )
-    dup 0 < [ ogg-error ] [ drop ] if ; inline
+    dup 0 < [ throw-ogg-error ] [ drop ] if ; inline
 
 : confirm-buffer ( len vorbis-stream -- ? )
     '[ _ sync-state>> swap ogg_sync_wrote ?ogg-error ] keep zero? not ; inline
@@ -119,11 +119,11 @@ ERROR: no-vorbis-in-ogg ;
     #vorbis-headers>> 1 2 between? not ; inline
 
 : ?vorbis-error ( code -- )
-    [ vorbis-error ] unless-zero ; inline
+    [ throw-vorbis-error ] unless-zero ; inline
 
 : get-remaining-vorbis-header-packet ( player -- ? )
     [ stream-state>> ] [ packet>> ] bi ogg_stream_packetout {
-        { [ dup 0 <   ] [ vorbis-error ] }
+        { [ dup 0 <   ] [ throw-vorbis-error ] }
         { [ dup zero? ] [ drop f ] }
         [ drop t ]
     } cond ;
@@ -153,7 +153,7 @@ ERROR: no-vorbis-in-ogg ;
 
 : initialize-decoder ( vorbis-stream -- )
     dup #vorbis-headers>> zero?
-    [ no-vorbis-in-ogg ]
+    [ throw-no-vorbis-in-ogg ]
     [ init-vorbis-codec ] if ;
 
 : get-pending-decoded-audio ( vorbis-stream -- pcm len )
index a87a031e001f7b079df934d94da8f3729e282364..7dc686ea242a1446c9ff18977767583e3bcaa7f8 100644 (file)
@@ -13,7 +13,7 @@ ERROR: amb-failure ;
 M: amb-failure summary drop "Backtracking failure" ;
 
 : fail ( -- )
-    failure get [ continue ] [ amb-failure ] if* ;
+    failure get [ continue ] [ throw-amb-failure ] if* ;
 
 : must-be-true ( ? -- )
     [ fail ] unless ;
index fb8efb2e2c7e5cb7750271aa79e6c0f234fb323b..e2d5f1cf6d2efc54eef2346d7287ae1c85350608 100644 (file)
@@ -18,7 +18,7 @@ CONSTANT: alphabet
 
 : base85>ch ( ch -- ch )
     $[ alphabet alphabet-inverse ] nth
-    [ malformed-base85 ] unless* ; inline
+    [ throw-malformed-base85 ] unless* ; inline
 
 : encode4 ( seq -- seq' )
     be> 5 [ 85 /mod ch>base85 ] B{ } replicate-as reverse! nip ; inline
@@ -48,7 +48,7 @@ PRIVATE>
     5 "\n\r" pick read-ignoring dup length {
         { 0 [ 2drop ] }
         { 5 [ decode5 (decode-base85) ] }
-        [ malformed-base85 ]
+        [ throw-malformed-base85 ]
     } case ;
 
 PRIVATE>
index bcc0e85620dc6bf6a985b2015aa7ac75478a1b5b..83839398c9c894e78c959da9b1270f2592e3e0bd 100644 (file)
@@ -38,7 +38,7 @@ TUPLE: meeting-place count mailbox ;
             { { yellow blue } [ red ] }
             { { blue red } [ yellow ] }
             { { blue yellow } [ red ] }
-            [ bad-color-pair ]
+            [ throw-bad-color-pair ]
         } case
     ] if ;
 
index 60500b3aa8de307f00aa3fda0a28524b0069c60a..05a7066bde42f6d5041fabe39006f091d2635978 100644 (file)
@@ -21,7 +21,7 @@ TUPLE: tcp-echo < threaded-server #times #bytes ;
 ERROR: incorrect-#bytes ;
 
 : check-bytes ( bytes n -- bytes )
-    over length = [ incorrect-#bytes ] unless ;
+    over length = [ throw-incorrect-#bytes ] unless ;
 
 : read-n ( n -- bytes )
     [ read ] [ check-bytes ] bi ;
@@ -46,7 +46,7 @@ M: tcp-echo handle-client*
     <tcp-echo> [
         \ threaded-server get server>address binary [
             #times [ #bytes read-write ] times
-            contents empty? [ incorrect-#bytes ] unless
+            contents empty? [ throw-incorrect-#bytes ] unless
         ] with-client
     ] with-threaded-server ;
 
index f69eff34b011e2f140b54c89c3461a5468ab1d34..036ec55d40d1b8af39264d010093926226e885a0 100644 (file)
@@ -19,7 +19,7 @@ ERROR: bad-response json status ;
 : check-status ( json -- json )
     dup "status_code" of 200 = [
         dup "status_txt" of
-        bad-response
+        throw-bad-response
     ] unless ;
 
 : json-data ( url -- json )
index 8dbdd3e24fdb9c487497e8e743e07b09b49f1fa1..50a680919e8c61e79e25021eb9157ba1a3aa389b 100644 (file)
@@ -49,7 +49,7 @@ TUPLE: bloom-filter
 { capacity fixnum read-only }
 { count fixnum } ;
 
-ERROR: invalid-size ;
+ERROR: invalid-size size ;
 ERROR: invalid-error-rate error-rate ;
 ERROR: invalid-capacity capacity ;
 
@@ -73,7 +73,7 @@ ERROR: invalid-capacity capacity ;
 ! If the number of hashes isn't positive, we haven't found
 ! anything smaller than the identity configuration.
 : check-hashes ( 2seq -- 2seq )
-    dup first 0 <= [ invalid-size ] when ;
+    dup first 0 <= [ throw-invalid-size ] when ;
 
 ! The consensus on the tradeoff between increasing the number of
 ! bits and increasing the number of hash functions seems to be
@@ -90,11 +90,11 @@ ERROR: invalid-capacity capacity ;
     ] reduce check-hashes first2 ;
 
 : check-capacity ( capacity -- capacity )
-    dup 0 <= [ invalid-capacity ] when ;
+    dup 0 <= [ throw-invalid-capacity ] when ;
 
 : check-error-rate ( error-rate -- error-rate )
     dup [ 0 after? ] [ 1 before? ] bi and
-    [ invalid-error-rate ] unless ;
+    [ throw-invalid-error-rate ] unless ;
 
 PRIVATE>
 
index 62e76eb42cfb8a6f42db4b25ccd1fc466e054b9a..cd00dbb03b9e060d4740f8dd8f5a3383b4726f90 100644 (file)
@@ -60,7 +60,7 @@ DEFER: read-elements
         { T_Binary_Function [ read-sized-string ] }
         { T_Binary_MD5 [ read >string ] }
         { T_Binary_UUID [ read >string ] }
-        [ "unknown binary sub-type" unknown-bson-type ]
+        [ "unknown binary sub-type" throw-unknown-bson-type ]
    } case ; inline
 
 TYPED: bson-regexp-read ( -- mdbregexp: mdbregexp )
@@ -90,7 +90,7 @@ TYPED: element-data-read ( type: integer -- object )
         { T_Code        [ read-int32 read-sized-string ] }
         { T_ScopedCode  [ read-int32 drop read-cstring H{ } clone stream>assoc <mongo-scoped-code> ] }
         { T_NULL        [ f ] }
-        [ "type unknown" unknown-bson-type ]
+        [ "type unknown" throw-unknown-bson-type ]
     } case ; inline recursive
 
 TYPED: (read-object) ( type: integer name: string -- )
index 55e11edde570a5a38dcda5d2f3e4a4504907d31a..c5232240feb59196e5f426f1b836243c509d2810 100644 (file)
@@ -81,7 +81,7 @@ ERROR: header-file-missing path ;
     skip-whitespace/comments advance dup previous {
         { CHAR: < [ CHAR: > take-until-object read-standard-include ] }
         { CHAR: " [ CHAR: " take-until-object read-local-include ] }
-        [ bad-include-line ]
+        [ throw-bad-include-line ]
     } case ;
 
 : (readlns) ( -- )
@@ -155,7 +155,7 @@ ERROR: header-file-missing path ;
         { "else" [ handle-else ] }
         { "pragma" [ handle-pragma ] }
         { "include_next" [ handle-include-next ] }
-        [ unknown-c-preprocessor ]
+        [ throw-unknown-c-preprocessor ]
     } case ;
 
 : parse-directive-line ( preprocessor-state sequence-parser -- )
index b08729b7a1d8c1b2faf6af50894623667251f10a..30efcebb243904023a7062414a367e22c2419067 100644 (file)
@@ -44,7 +44,7 @@ ERROR: no-cairo-t ;
 <PRIVATE
 
 : draw-hello-world ( gadget -- )
-    cairo-t>> [ no-cairo-t ] unless*
+    cairo-t>> [ throw-no-cairo-t ] unless*
     {
         [
             "Sans" CAIRO_FONT_SLANT_NORMAL CAIRO_FONT_WEIGHT_BOLD
index 49d9d5098c48aa1467d52734d301fc8b48f6bb8d..700f5bf38a51b8302c12765f25ea52d150b7f348 100644 (file)
@@ -26,9 +26,9 @@ ERROR: repeated-constructor-parameters class effect ;
 ERROR: unknown-constructor-parameters class effect unknown ;
 
 : ensure-constructor-parameters ( class effect -- class effect )
-    dup in>> all-unique? [ repeated-constructor-parameters ] unless
+    dup in>> all-unique? [ throw-repeated-constructor-parameters ] unless
     2dup [ all-slots [ name>> ] map ] [ in>> ] bi* swap diff
-    [ unknown-constructor-parameters ] unless-empty ;
+    [ throw-unknown-constructor-parameters ] unless-empty ;
 
 : constructor-boa-quot ( constructor-word class effect -- word quot )
     in>> swap '[ _ _ slots>boa ] ; inline
index 1d48355f04de3a67a515551f29e81d58c58eeb3c..7cf1bb7b5eae74ddb157b6089df7667c42db58ce 100644 (file)
@@ -488,7 +488,7 @@ ERROR: undefined-8080-opcode n ;
     dup instruction-cycles nth [
         nip
     ] [
-        undefined-8080-opcode
+        throw-undefined-8080-opcode
     ] if* ;
 
 : process-interrupts ( cpu -- )
index 5861cf2fc14b1936b29f02abf8700aa491efaf76..1b1323b1317232fdbd5a6922af79d6406da6aba9 100644 (file)
@@ -147,9 +147,9 @@ SINGLETON: aes-256-key
 M: aes-128-key key-expand-round ( temp i -- temp' )
     4 /mod 0 = swap and [ (add-rcon) ] when* ;
 
-ERROR: aes-192-256-not-implemented* ;
+ERROR: aes-192-256-not-implemented ;
 M: aes-256-key key-expand-round ( temp i -- temp' )
-    aes-192-256-not-implemented* ;
+    throw-aes-192-256-not-implemented ;
 
 : (key-sched-round) ( output temp i -- output' )
     key-expand-round
index 45bbe55d6eb2deb34ecbac8437241ec6cdec9e12..bfeaf9af970721b09df0e22ef6f078e3e29e2a3d 100644 (file)
@@ -8,5 +8,5 @@ IN: crypto.xor
 ERROR: empty-xor-key ;
 
 : xor-crypt ( seq key -- seq' )
-    [ empty-xor-key ] when-empty
+    [ throw-empty-xor-key ] when-empty
     [ dup length iota ] dip '[ _ mod-nth bitxor ] 2map ;
index 9ecaebce29b37bf18dd3571abf4f066518600424..54ae4a24ab8142744cb2d53a2bc74bb95ba8ae40 100644 (file)
@@ -13,7 +13,7 @@ IN: cuda
 ERROR: cuda-error-state code ;
 
 : cuda-error ( code -- )
-    dup CUDA_SUCCESS = [ drop ] [ cuda-error-state ] if ;
+    dup CUDA_SUCCESS = [ drop ] [ throw-cuda-error-state ] if ;
 
 : cuda-version ( -- n )
     { c:int } [ cuDriverGetVersion cuda-error ] with-out-parameters ;
index f899d4430d303af4a3b6e68e7cd52a78888dd1c1..fdf0799aa68e4eae6f37c95388ff1b6160ede88f 100644 (file)
@@ -86,10 +86,10 @@ PRIVATE>
 ERROR: no-cuda-library name ;
 
 : lookup-cuda-library ( name -- cuda-library )
-    cuda-libraries get ?at [ no-cuda-library ] unless ;
+    cuda-libraries get ?at [ throw-no-cuda-library ] unless ;
 
 : remove-cuda-library ( name -- library )
-    cuda-libraries get ?delete-at [ no-cuda-library ] unless ;
+    cuda-libraries get ?delete-at [ throw-no-cuda-library ] unless ;
 
 : unload-cuda-library ( name -- )
     remove-cuda-library handle>> unload-module ;
@@ -189,7 +189,7 @@ TUPLE: cuda-library name abi path handle ;
 ERROR: bad-cuda-abi abi ;
 
 : check-cuda-abi ( abi -- abi )
-    dup cuda-abi? [ bad-cuda-abi ] unless ; inline
+    dup cuda-abi? [ throw-bad-cuda-abi ] unless ; inline
 
 : <cuda-library> ( name abi path -- obj )
     \ cuda-library new
index c1e35c32caea95275cfbcad681eae616b8b2f608..443ff21363d91a4c6dd7b7116a42e89f19d47b78 100644 (file)
@@ -26,6 +26,6 @@ ERROR: nvcc-failed n path ;
     path normalize-path :> path2
     path2 parent-directory [
         path2 nvcc-command
-        run-process wait-for-process [ path2 nvcc-failed ] unless-zero
+        run-process wait-for-process [ path2 throw-nvcc-failed ] unless-zero
         path2 cu>ptx
     ] with-directory ;
index 4b85060a84609b1d9a552d0199fa486777b227b4..b5bd8dbfc7f20c31d2d19d61d66a6391d20447a0 100644 (file)
@@ -31,7 +31,7 @@ ERROR: unknown-filetype filetype ;
 
 : check-filetype ( filetype -- filetype )
     dup { "BINARY" "MOTOROLA" "AIFF" "WAVE" "MP3" } member?
-    [ unknown-filetype ] unless ;
+    [ throw-unknown-filetype ] unless ;
 
 ERROR: unknown-flag flag ;
 
index a6629650ad107cd92250d7f3a2ee70fd2eae7448..c089cea91fdc34a3f16626d567415ac6718523d0 100644 (file)
@@ -179,8 +179,8 @@ ERROR: unsupported-curses-terminal ;
 : >BOOLEAN ( ? -- TRUE/FALSE ) ffi:TRUE ffi:FALSE ? ; inline
 
 : curses-pointer-error ( ptr/f -- ptr )
-    [ curses-failed ] unless* ; inline
-: curses-error ( n -- ) ffi:ERR = [ curses-failed ] when ;
+    [ throw-curses-failed ] unless* ; inline
+: curses-error ( n -- ) ffi:ERR = [ throw-curses-failed ] when ;
 
 PRIVATE>
 
@@ -262,7 +262,7 @@ PRIVATE>
     [ current-window ] dip with-variable ; inline
 
 : with-curses ( window quot -- )
-    curses-ok? [ unsupported-curses-terminal ] unless
+    curses-ok? [ throw-unsupported-curses-terminal ] unless
     [
         '[
             ffi:initscr curses-pointer-error
index 7efa7cca2dd94dbb1f7be319f0e3ab5c9dd40373..b552ff1360eb02c9d3a3be87184596c61b8f063e 100644 (file)
@@ -67,7 +67,9 @@ GENERIC: cursor-key-value-unsafe ( cursor -- key value )
 PRIVATE>
 M: input-cursor cursor-key-value-unsafe cursor-key-value ; inline
 M: input-cursor cursor-key-value
-    dup cursor-valid? [ cursor-key-value-unsafe ] [ invalid-cursor ] if ; inline
+    dup cursor-valid?
+    [ cursor-key-value-unsafe ]
+    [ throw-invalid-cursor ] if ; inline
 
 : cursor-key ( cursor -- key ) cursor-key-value drop ;
 : cursor-value ( cursor -- key ) cursor-key-value nip ;
@@ -87,7 +89,9 @@ GENERIC: set-cursor-value-unsafe ( value cursor -- )
 PRIVATE>
 M: output-cursor set-cursor-value-unsafe set-cursor-value ; inline
 M: output-cursor set-cursor-value
-    dup cursor-valid? [ set-cursor-value-unsafe ] [ invalid-cursor ] if ; inline
+    dup cursor-valid?
+    [ set-cursor-value-unsafe ]
+    [ throw-invalid-cursor ] if ; inline
 
 !
 ! stream cursors
index 726212b0ea76afa5b43508dc00b803d8746dafc1..fc48561e8c987f014b4b9d5d66a4502885d7ea78 100644 (file)
@@ -21,7 +21,7 @@ ERROR: decimal-test-failure D1 D2 quot ;
     D1 D2
     quot1 [ decimal>ratio >float ] compose
     [ [ decimal>ratio ] bi@ quot2 call( obj obj -- obj ) >float ] 2bi -.1 ~
-    [ t ] [ D1 D2 quot1 decimal-test-failure ] if ; inline
+    [ t ] [ D1 D2 quot1 throw-decimal-test-failure ] if ; inline
 
 : test-decimal-op ( quot1 quot2 -- ? )
     [ random-test-decimal random-test-decimal ] 2dip (test-decimal-op) ; inline
index 1d244f0355a29f1f6dbae0188b9aface42a05eb1..23fa3a273d35dd5435566c77d33646d34cd89a7a 100644 (file)
@@ -43,7 +43,7 @@ ERROR: decimal-types-expected d1 d2 ;
 
 : guard-decimals ( obj1 obj2 -- D1 D2 )
     2dup [ decimal? ] both?
-    [ decimal-types-expected ] unless ;
+    [ throw-decimal-types-expected ] unless ;
 
 M: decimal equal?
     {
index 112540bc91a0c87e3dd1a8d1d9bfb1dac1e7cc08..ccf29a02c3e361c2f0beab5a8a89fce7bfe4744f 100644 (file)
@@ -19,7 +19,7 @@ M: descriptive-error error.
 
 : rethrower ( word inputs -- quot )
     [ length ] keep [ [ narray ] dip swap 2array flip ] 2curry
-    [ 2 ndip descriptive-error ] 2curry ;
+    [ 2 ndip throw-descriptive-error ] 2curry ;
 
 : [descriptive] ( word def effect -- newdef )
     swapd in>> rethrower [ recover ] 2curry ;
index d8e3f6bdf77a58eb64ac1bdab830eabddd8445e3..917e1bcb2b03363db0a99fe6cfd062dea9546f1a 100644 (file)
@@ -242,7 +242,7 @@ ERROR: unsupported-domain-name string ;
 
 : >n/label ( string -- byte-array )
     dup [ ascii? ] all?
-    [ unsupported-domain-name ] unless
+    [ throw-unsupported-domain-name ] unless
     [ length 1array ] [ ] bi B{ } append-as ;
 
 : >name ( domain -- byte-array )
index f3ce44dc869b4ecb1c96621a74963fbe2d9a1d34..0f26a5bbbd71d06522a870ba9abbf40922fafca9 100644 (file)
@@ -16,7 +16,7 @@ IN: forestdb.lib
 ERROR: fdb-error error ;
 
 : fdb-check-error ( ret -- )
-    dup FDB_RESULT_SUCCESS = [ drop ] [ fdb-error ] if ;
+    dup FDB_RESULT_SUCCESS = [ drop ] [ throw-fdb-error ] if ;
 
 
 TUPLE: fdb-kvs-handle < disposable handle ;
@@ -93,7 +93,7 @@ SYMBOL: current-fdb-kvs-handle
     rot {
         { FDB_RESULT_SUCCESS [ ret>string ] }
         { FDB_RESULT_KEY_NOT_FOUND [ 2drop f ] }
-        [ fdb-error ]
+        [ throw-fdb-error ]
     } case ;
 
 : fdb-del-kv ( key -- )
index d27af11e6a760505049472aad627430f5eb39202..79c54b12e041b418b1662d8056b98a8288c2e748 100644 (file)
@@ -18,12 +18,12 @@ CONSTANT: fdb-filename-base "fq"
 ERROR: not-an-fdb-filename string ;
 
 : ensure-fdb-filename ( string -- string )
-    dup fdb-filename? [ not-an-fdb-filename ] unless ;
+    dup fdb-filename? [ throw-not-an-fdb-filename ] unless ;
 
 ERROR: not-a-string-number string ;
 
 : ?string>number ( string -- n )
-    dup string>number dup [ nip ] [ not-a-string-number ] if ;
+    dup string>number dup [ nip ] [ throw-not-a-string-number ] if ;
 
 : change-string-number ( string quot -- string' )
     [ [ string>number ] dip call number>string ] 2keep drop
index 7b30d25f0e6861d193a13c06cecd3ca846b8fd4e..fe4535957bc069f68daa8477fd6ce9f845013ebb 100755 (executable)
@@ -55,12 +55,12 @@ ERROR: display-change-error n ;
 : fullscreen-mode ( monitor-info devmode -- )
     [ szDevice>> ] dip f CDS_FULLSCREEN f
     ChangeDisplaySettingsEx dup DISP_CHANGE_SUCCESSFUL =
-    [ drop ] [ display-change-error ] if ;
+    [ drop ] [ throw-display-change-error ] if ;
 
 : non-fullscreen-mode ( monitor-info devmode -- )
     [ szDevice>> ] dip f 0 f
     ChangeDisplaySettingsEx dup DISP_CHANGE_SUCCESSFUL =
-    [ drop ] [ display-change-error ] if ;
+    [ drop ] [ throw-display-change-error ] if ;
 
 : get-style ( hwnd n -- style )
     GetWindowLongPtr [ win32-error=0/f ] keep ;
@@ -86,7 +86,7 @@ ERROR: unsupported-resolution triple ;
     [
         slots{ dmPelsWidth dmPelsHeight dmBitsPerPel }
         triple =
-    ] find nip [ triple unsupported-resolution ] unless* ;
+    ] find nip [ triple throw-unsupported-resolution ] unless* ;
 
 :: set-fullscreen-window-position ( hwnd triple -- )
     hwnd f
index 18773e79a46f35c64bb82d3f8e11fc81dc07f158..3342aceeddfcd0adf3ae2a6e26166ceb8bd58125 100644 (file)
@@ -24,12 +24,12 @@ SYMBOLS: up-axis unit-ratio ;
 
 : x/ ( tag child-name -- child-tag )
     [ tag-named ]
-    [ rot dup [ drop missing-child ] unless 2nip ]
+    [ rot dup [ drop throw-missing-child ] unless 2nip ]
     2bi ; inline
 
 : x@ ( tag attr-name -- attr-value )
     [ attr ]
-    [ rot dup [ drop missing-attr ] unless 2nip ]
+    [ rot dup [ drop throw-missing-attr ] unless 2nip ]
     2bi ; inline
 
 : xt ( tag -- content ) children>string ;
index d566c512b11b7607de8499797d43b782739e783c..73fa57af8abca2b7d5159a370404b03ca59bb65e 100644 (file)
@@ -15,11 +15,11 @@ types [ H{ } clone ] initialize
 
 : models-class ( path -- class )
     file-extension >lower types get ?at
-    [ unknown-models-extension ] unless second ;
+    [ throw-unknown-models-extension ] unless second ;
 
 : models-encoding ( path -- encoding )
     file-extension >lower types get ?at
-    [ unknown-models-extension ] unless first ;
+    [ throw-unknown-models-extension ] unless first ;
 
 : open-models-file ( path encoding -- stream )
     <file-reader> ;
index 32d81cf3786c23fc20f94091b1d79a0a1aa9ba7a..96d27c99fd767fbb8972031d273a265d55a1dad5 100644 (file)
@@ -53,7 +53,7 @@ ERROR: not-a-gopher-url url ;
 
 : gopher ( url -- item-type byte-array )
     dup url? [ >url ] unless
-    dup protocol>> "gopher" = [ not-a-gopher-url ] unless {
+    dup protocol>> "gopher" = [ throw-not-a-gopher-url ] unless {
         [ host>> ]
         [ port>> 70 or <inet> binary ]
         [ path>> rest [ "1/" ] when-empty ]
index f157e322a81185555952f73c6f1e9618ea838518..312559e0dea15e808d71adde47fa6491e002775a 100755 (executable)
@@ -399,7 +399,7 @@ DEFER: [bind-uniform-tuple]
         { mat4-uniform   { [ dim 0 ] dip 4 4 >uniform-matrix-array glUniformMatrix4fv   } }
 
         { texture-uniform { drop dim dup iota [ texture-unit + ] int-array{ } map-as glUniform1iv } }
-    } at [ uniform invalid-uniform-type ] unless* >quotation :> value-quot
+    } at [ uniform throw-invalid-uniform-type ] unless* >quotation :> value-quot
 
     type uniform-type-texture-units dim * texture-unit +
     pre-quot value-quot append ;
@@ -442,7 +442,7 @@ DEFER: [bind-uniform-tuple]
         { mat4-uniform   [ [ 1 0 ] dip 4 4 >uniform-matrix glUniformMatrix4fv   ] }
 
         { texture-uniform { drop texture-unit glUniform1i } }
-    } at [ uniform invalid-uniform-type ] unless* >quotation :> value-quot
+    } at [ uniform throw-invalid-uniform-type ] unless* >quotation :> value-quot
 
     type uniform-type-texture-units texture-unit +
     pre-quot value-quot append ;
index 559f46f5602c6b3dfd718e29b00fa43958a0f74b..a1f514e2466c6ad4e3feb1eba48448b5f2cb7469 100755 (executable)
@@ -139,7 +139,7 @@ TR: hyphens>underscores "-" "_" ;
         [ vertex-attribute name>> name = ]
         [ size 1 = ]
         [ gl-type vertex-attribute [ component-type>> ] [ dim>> ] bi feedback-type= ]
-    } 0&& [ vertex-attribute inaccurate-feedback-attribute-error ] unless ;
+    } 0&& [ vertex-attribute throw-inaccurate-feedback-attribute-error ] unless ;
 
 :: (bind-float-vertex-attribute) ( program-instance ptr name dim gl-type normalize? stride offset -- )
     program-instance name attribute-index :> idx
@@ -182,7 +182,7 @@ TR: hyphens>underscores "-" "_" ;
 
 :: [link-feedback-format] ( vertex-attributes -- quot )
     vertex-attributes [ name>> not ] any?
-    [ [ nip invalid-link-feedback-format-error ] ] [
+    [ [ nip throw-invalid-link-feedback-format-error ] ] [
         vertex-attributes
         [ name>> ascii malloc-string ]
         void*-array{ } map-as :> varying-names
@@ -529,7 +529,7 @@ TUPLE: feedback-format
 : validate-feedback-format ( sequence -- vertex-format/f )
     dup length 1 <=
     [ [ f ] [ first vertex-format>> ] if-empty ]
-    [ too-many-feedback-formats-error ] if ;
+    [ throw-too-many-feedback-formats-error ] if ;
 
 : ?shader ( object -- shader/f )
     dup word? [ def>> first dup shader? [ drop f ] unless ] [ drop f ] if ;
index 6caf5250ee86a1991b2854fb0b290c4932711e92..b95f5548381727db457fd9c453d99bf8a061b056 100644 (file)
@@ -112,7 +112,7 @@ PRIVATE>
         { "png"  [ ".png" ] }
         { "tif"  [ ".tif" ] }
         { "tiff" [ ".tif" ] }
-        [ unsupported-preview-format ]
+        [ throw-unsupported-preview-format ]
     } case ;
 
 :: with-preview ( graph quot: ( path -- ) -- )
index e48f09d6608bf97d771c5a51d63c7104fb26832b..e8721c8785ea3129329d6416f5cab45a1cd88b05 100644 (file)
@@ -36,7 +36,7 @@ IN: html.parser.analyzer
 ERROR: undefined-find-nth m n seq quot ;
 
 : check-trivial-find ( m n seq quot -- m n seq quot )
-    pick 0 = [ undefined-find-nth ] when ; inline
+    pick 0 = [ throw-undefined-find-nth ] when ; inline
 
 : find-nth-from ( m n seq quot -- i/f elt/f )
     check-trivial-find [ f ] 3dip '[
index 8d03207cd59b631786025523780ce3d6174a95c5..f17a5975f98a1f88378434428ff4a6d72f00cbc6 100644 (file)
@@ -56,7 +56,7 @@ ERROR: atlas-image-formats-dont-match images ;
         [ [ upside-down?>>    ] same? ] 2tri and and
     ] all?
     [ first [ component-order>> ] [ component-type>> ] [ upside-down?>> ] tri ]
-    [ atlas-image-formats-dont-match ] if ; inline
+    [ throw-atlas-image-formats-dont-match ] if ; inline
 
 : atlas-dim ( image-placements -- dim )
     [ [ loc>> ] [ image>> dim>> ] bi v+ atlas-padding v+n ] [ vmax ] map-reduce
index 2ac2326e3296c5c85f2ebf38aa2c70bda5fdfe49..61697207cfcfad176f11e6fa2e47b824103a51fc 100644 (file)
@@ -182,7 +182,7 @@ UNION: os2-header os2v1-header os2v2-header ;
         { 40 [ read-v3-header ] }
         { 108 [ read-v4-header ] }
         { 124 [ read-v5-header ] }
-        [ unknown-bitmap-header ]
+        [ throw-unknown-bitmap-header ]
     } case ;
 
 : color-index-length ( header -- n )
@@ -228,7 +228,7 @@ GENERIC: bitmap>component-order* ( loading-bitmap header -- object )
         { 8 [ BGR ] }
         { 4 [ BGR ] }
         { 1 [ BGR ] }
-        [ unknown-component-order ]
+        [ throw-unknown-component-order ]
     } case ;
 
 : advanced-bitmap>component-order ( loading-bitmap -- object )
index 13e0cc1ac6b432358839755e40481418bb9bddad..5702a91d7a5148c362e4af0330b55c7b51d838af 100644 (file)
@@ -126,7 +126,7 @@ CONSTANT: BLOCK-TERMINATOR 0x00
 
 ERROR: unimplemented message ;
 : read-GIF87a ( loading-gif -- loading-gif )
-    "GIF87a" unimplemented ;
+    "GIF87a" throw-unimplemented ;
 
 : read-logical-screen-descriptor ( loading-gif -- loading-gif )
     2 read le> >>width
@@ -182,8 +182,8 @@ ERROR: unimplemented message ;
         { APPLICATION-EXTENSION [
             read-application-extension over application-extensions>> push
         ] }
-        { f [ gif-unexpected-eof ] }
-        [ unknown-extension ]
+        { f [ throw-gif-unexpected-eof ] }
+        [ throw-unknown-extension ]
     } case ;
 
 ERROR: unhandled-data byte ;
@@ -197,7 +197,7 @@ ERROR: unhandled-data byte ;
         ] }
         { IMAGE-DESCRIPTOR [ read-table-based-image ] }
         { TRAILER [ f >>loading? ] }
-        [ unhandled-data ]
+        [ throw-unhandled-data ]
     } case ;
 
 : read-GIF89a ( loading-gif -- loading-gif )
@@ -211,7 +211,7 @@ ERROR: unhandled-data byte ;
         read-gif-header dup magic>> {
             { "GIF87a" [ read-GIF87a ] }
             { "GIF89a" [ read-GIF89a ] }
-            [ unsupported-gif-format ]
+            [ throw-unsupported-gif-format ]
         } case
     ] with-input-stream ;
 
@@ -246,7 +246,7 @@ ERROR: unhandled-data byte ;
 ERROR: loading-gif-error gif-image ;
 
 : ensure-loaded ( gif-image -- gif-image )
-    dup loading?>> [ loading-gif-error ] when ;
+    dup loading?>> [ throw-loading-gif-error ] when ;
 
 M: gif-image stream>image* ( path gif-image -- image )
     drop load-gif ensure-loaded gif>image ;
index ffd0a7a09dafe7bb48f73ca76490cf5259af05c5..611c0308ecd8c54ef6d8c8c850ad3cf7dbdf81b4 100644 (file)
@@ -56,7 +56,7 @@ ERROR: bad-png-header header ;
 
 : read-png-header ( -- )
     8 read dup png-header sequence= [
-        bad-png-header
+        throw-bad-png-header
     ] unless drop ;
 
 ERROR: bad-checksum ;
index c64f4907d89e5db8c36c034b029172313a4cf069..f7b09cf34149c5fc38df2a91499b3438e45032c8 100644 (file)
@@ -20,11 +20,11 @@ ERROR: bad-tga-unsupported ;
 
 : read-color-map-type ( -- byte )
     1 read le> dup
-    { 0 1 } member? [ bad-tga-header ] unless ;
+    { 0 1 } member? [ throw-bad-tga-header ] unless ;
 
 : read-image-type ( -- byte )
     1 read le> dup
-    { 0 1 2 3 9 10 11 } member? [ bad-tga-header ] unless ; inline
+    { 0 1 2 3 9 10 11 } member? [ throw-bad-tga-header ] unless ; inline
 
 : read-color-map-first ( -- short )
     2 read le> ; inline
@@ -70,10 +70,10 @@ ERROR: bad-tga-unsupported ;
     4 read le> ; inline
 
 : read-signature ( -- )
-    18 read ascii decode "TRUEVISION-XFILE.\0" = [ bad-tga-footer ] unless ; inline
+    18 read ascii decode "TRUEVISION-XFILE.\0" = [ throw-bad-tga-footer ] unless ; inline
 
 : read-extension-size ( -- )
-    2 read le> 495 = [ bad-tga-extension-size ] unless ; inline
+    2 read le> 495 = [ throw-bad-tga-extension-size ] unless ; inline
 
 : read-author-name ( -- string )
     41 read ascii decode [ 0 = ] trim ; inline
@@ -83,12 +83,12 @@ ERROR: bad-tga-unsupported ;
 
 : read-date-timestamp ( -- timestamp )
     timestamp new
-    2 read le> dup 12 [1,b] member? [ bad-tga-timestamp ] unless >>month
-    2 read le> dup 31 [1,b] member? [ bad-tga-timestamp ] unless >>day
+    2 read le> dup 12 [1,b] member? [ throw-bad-tga-timestamp ] unless >>month
+    2 read le> dup 31 [1,b] member? [ throw-bad-tga-timestamp ] unless >>day
     2 read le>                                                   >>year
-    2 read le> dup 23 [0,b] member? [ bad-tga-timestamp ] unless >>hour
-    2 read le> dup 59 [0,b] member? [ bad-tga-timestamp ] unless >>minute
-    2 read le> dup 59 [0,b] member? [ bad-tga-timestamp ] unless >>second ; inline
+    2 read le> dup 23 [0,b] member? [ throw-bad-tga-timestamp ] unless >>hour
+    2 read le> dup 59 [0,b] member? [ throw-bad-tga-timestamp ] unless >>minute
+    2 read le> dup 59 [0,b] member? [ throw-bad-tga-timestamp ] unless >>second ; inline
 
 : read-job-name ( -- string )
     41 read ascii decode [ 0 = ] trim ; inline
@@ -96,8 +96,8 @@ ERROR: bad-tga-unsupported ;
 : read-job-time ( -- duration )
     duration new
     2 read le>                                                   >>hour
-    2 read le> dup 59 [0,b] member? [ bad-tga-timestamp ] unless >>minute
-    2 read le> dup 59 [0,b] member? [ bad-tga-timestamp ] unless >>second ; inline
+    2 read le> dup 59 [0,b] member? [ throw-bad-tga-timestamp ] unless >>minute
+    2 read le> dup 59 [0,b] member? [ throw-bad-tga-timestamp ] unless >>second ; inline
 
 : read-software-id ( -- string )
     41 read ascii decode [ 0 = ] trim ; inline
@@ -240,10 +240,10 @@ ERROR: bad-tga-unsupported ;
 
     #! Only 24-bit uncompressed BGR and 32-bit uncompressed BGRA are supported.
     #! Other formats would need to be converted to work within the image class.
-    map-type 0 = [ bad-tga-unsupported ] unless
-    image-type 2 = [ bad-tga-unsupported ] unless
-    pixel-depth { 24 32 } member? [ bad-tga-unsupported ] unless
-    pixel-order { 0 2 } member? [ bad-tga-unsupported ] unless
+    map-type 0 = [ throw-bad-tga-unsupported ] unless
+    image-type 2 = [ throw-bad-tga-unsupported ] unless
+    pixel-depth { 24 32 } member? [ throw-bad-tga-unsupported ] unless
+    pixel-order { 0 2 } member? [ throw-bad-tga-unsupported ] unless
 
     #! Create image instance
     image new
@@ -259,7 +259,7 @@ M: tga-image stream>image*
 M: tga-image image>stream
     2drop
     [
-        component-order>> { BGRA BGRA } member? [ bad-tga-unsupported ] unless
+        component-order>> { BGRA BGRA } member? [ throw-bad-tga-unsupported ] unless
     ] keep
 
     B{ 0 }         write #! id-length
index aee3d747d97c6d4e76779a69d8051dcf74860257..c9343396b801a5d3b50facb34b2621ec9c635ad2 100755 (executable)
@@ -65,7 +65,7 @@ ERROR: bad-photometric-interpretation n ;
         { 10 [ photometric-interpretation-itulab ] }
         { 32844 [ photometric-interpretation-logl ] }
         { 32845 [ photometric-interpretation-logluv ] }
-        [ bad-photometric-interpretation ]
+        [ throw-bad-photometric-interpretation ]
     } case ;
 
 SINGLETONS: compression
@@ -124,7 +124,7 @@ ERROR: bad-compression n ;
         { 34676 [ compression-sgilog ] }
         { 34677 [ compression-sgilog24 ] }
         { 34712 [ compression-jp2000 ] }
-        [ bad-compression ]
+        [ throw-bad-compression ]
     } case ;
 
 SINGLETONS: resolution-unit
@@ -137,7 +137,7 @@ ERROR: bad-resolution-unit n ;
         { 1 [ resolution-unit-none ] }
         { 2 [ resolution-unit-inch ] }
         { 3 [ resolution-unit-centimeter ] }
-        [ bad-resolution-unit ]
+        [ throw-bad-resolution-unit ]
     } case ;
 
 SINGLETONS: predictor
@@ -148,7 +148,7 @@ ERROR: bad-predictor n ;
     {
         { 1 [ predictor-none ] }
         { 2 [ predictor-horizontal-differencing ] }
-        [ bad-predictor ]
+        [ throw-bad-predictor ]
     } case ;
 
 SINGLETONS: planar-configuration
@@ -159,7 +159,7 @@ ERROR: bad-planar-configuration n ;
     {
         { 1 [ planar-configuration-chunky ] }
         { 2 [ planar-configuration-planar ] }
-        [ bad-planar-configuration ]
+        [ throw-bad-planar-configuration ]
     } case ;
 
 SINGLETONS: sample-format
@@ -177,7 +177,7 @@ ERROR: bad-sample-format n ;
             { 2 [ sample-format-signed-integer ] }
             { 3 [ sample-format-ieee-float ] }
             { 4 [ sample-format-undefined-data ] }
-            [ bad-sample-format ]
+            [ throw-bad-sample-format ]
         } case
     ] map ;
 
@@ -191,7 +191,7 @@ ERROR: bad-extra-samples n ;
         { 0 [ extra-samples-unspecified-alpha-data ] }
         { 1 [ extra-samples-associated-alpha-data ] }
         { 2 [ extra-samples-unassociated-alpha-data ] }
-        [ bad-extra-samples ]
+        [ throw-bad-extra-samples ]
     } case ;
 
 SINGLETONS: image-length image-width x-resolution y-resolution
@@ -224,7 +224,7 @@ ERROR: bad-jpeg-proc n ;
     {
         { 1 [ jpeg-proc-baseline ] }
         { 14 [ jpeg-proc-lossless ] }
-        [ bad-jpeg-proc ]
+        [ throw-bad-jpeg-proc ]
     } case ;
 
 ERROR: bad-tiff-magic bytes ;
@@ -232,7 +232,7 @@ ERROR: bad-tiff-magic bytes ;
     {
         { B{ CHAR: M CHAR: M } [ big-endian ] }
         { B{ CHAR: I CHAR: I } [ little-endian ] }
-        [ bad-tiff-magic ]
+        [ throw-bad-tiff-magic ]
     } case ;
 
 : read-header ( tiff -- tiff )
@@ -277,7 +277,7 @@ ERROR: no-tag class ;
     swap processed-tags>> ?at ;
 
 : find-tag ( ifd class -- tag )
-    find-tag* [ no-tag ] unless ;
+    find-tag* [ throw-no-tag ] unless ;
 
 : tag? ( ifd class -- tag )
     swap processed-tags>> key? ;
@@ -314,7 +314,7 @@ ERROR: unknown-ifd-type n where ;
         { 11 [ 4 * ] }
         { 12 [ 8 * ] }
         { 13 [ 4 * ] }
-        [ "value-length" unknown-ifd-type ]
+        [ "value-length" throw-unknown-ifd-type ]
     } case ;
 
 ERROR: bad-small-ifd-type n ;
@@ -330,7 +330,7 @@ ERROR: bad-small-ifd-type n ;
         { 9 [ endian> 32 >signed ] }
         { 11 [ endian> bits>float ] }
         { 13 [ endian> 32 >signed ] }
-        [ bad-small-ifd-type ]
+        [ throw-bad-small-ifd-type ]
     } case ;
 
 : offset-bytes>obj ( bytes type -- obj )
@@ -347,7 +347,7 @@ ERROR: bad-small-ifd-type n ;
         { 10 [ 8 group [ "ii" unpack first2 / ] map ] }
         { 11 [ 4 group [ "f" unpack ] map ] }
         { 12 [ 8 group [ "d" unpack ] map ] }
-        [ "offset-bytes>obj" unknown-ifd-type ]
+        [ "offset-bytes>obj" throw-unknown-ifd-type ]
     } case ;
 
 : ifd-entry-value ( ifd-entry -- n )
@@ -455,7 +455,7 @@ ERROR: unhandled-compression compression ;
     {
         { compression-none [ ] }
         { compression-lzw [ [ tiff-lzw-uncompress ] map ] }
-        [ unhandled-compression ]
+        [ throw-unhandled-compression ]
     } case ;
 
 : uncompress-strips ( ifd -- ifd )
@@ -483,7 +483,7 @@ ERROR: unhandled-compression compression ;
         {
             { predictor-none [ ] }
             { predictor-horizontal-differencing [ (strips-predictor) ] }
-            [ bad-predictor ]
+            [ throw-bad-predictor ]
         } case
     ] when ;
 
@@ -499,7 +499,7 @@ ERROR: unknown-component-order ifd ;
         { { 8 8 8 8 } [ ] }
         { { 8 8 8 } [ ] }
         { 8 [ ] }
-        [ unknown-component-order ]
+        [ throw-unknown-component-order ]
     } case >>bitmap ;
 
 : ifd-component-order ( ifd -- component-order component-type )
@@ -511,7 +511,7 @@ ERROR: unknown-component-order ifd ;
         { { 8 8 8 8 } [ RGBA ubyte-components ] }
         { { 8 8 8 } [ RGB ubyte-components ] }
         { 8 [ LA ubyte-components ] }
-        [ unknown-component-order ]
+        [ throw-unknown-component-order ]
     } case ;
 
 : handle-alpha-data ( ifd -- ifd )
@@ -519,7 +519,7 @@ ERROR: unknown-component-order ifd ;
         { extra-samples-associated-alpha-data [ ] }
         { extra-samples-unspecified-alpha-data [ ] }
         { extra-samples-unassociated-alpha-data [ ] }
-        [ bad-extra-samples ]
+        [ throw-bad-extra-samples ]
     } case ;
 
 : ifd>image ( ifd -- image )
index d79270cb56650d1ade2388ecd35ad465f6c4c31a..511c2fa3f269c6f59a7e91b4c70fd49ba6742476 100644 (file)
@@ -29,7 +29,7 @@ IN: imap.tests
 ERROR: no-imap-test-host ;
 
 : get-test-host ( -- host )
-    \ imap-settings get-global host>> [ no-imap-test-host ] unless* ;
+    \ imap-settings get-global host>> [ throw-no-imap-test-host ] unless* ;
 
 : imap-test ( result quot -- )
     '[ \ imap-settings get-global _ with-imap-settings ] unit-test ; inline
index 2436af9b322c926ca84e28ef20daa71015fe1e76..77d7a0c73659346c1f11773a306172dacaf77373 100644 (file)
@@ -41,7 +41,7 @@ CONSTANT: IMAP4_SSL_PORT 993
     [ number>string ] map "," join ;
 
 : check-status ( ind data -- )
-    over "OK" = not [ imap4-error ] [ 2drop ] if ;
+    over "OK" = not [ throw-imap4-error ] [ 2drop ] if ;
 
 : read-response-chunk ( stop-expr -- item ? )
     read-?crlf ascii decode swap dupd pcre:findall
index 45ea18b12855130653f27e26d347f49e9793bdf2..83611aaa7784f539066b73eeb69e73bd1bba7bd1 100644 (file)
@@ -16,7 +16,7 @@ M: local-not-defined summary
 
 : >local-word ( string -- word )
     qualified-vocabs last words>> ?at
-    [ local-not-defined ] unless ;
+    [ throw-local-not-defined ] unless ;
 
 ERROR: invalid-op string ;
 
@@ -28,7 +28,7 @@ ERROR: invalid-op string ;
         { "/" [ [ / ] ] }
         { "%" [ [ mod ] ] }
         { "**" [ [ ^ ] ] }
-        [ invalid-op ]
+        [ throw-invalid-op ]
     } case ;
 
 GENERIC: infix-codegen ( ast -- quot/number )
index 64206a7cd52fb77bc13b03dff2195b2e59757567..13a9f1df0270dad77d39070b3d417b101c3be6a1 100644 (file)
@@ -14,7 +14,7 @@ IN: io.binary.fast
 ERROR: bad-length bytes n ;
 
 : check-length ( bytes n -- bytes n )
-    2dup [ length ] dip > [ bad-length ] when ; inline
+    2dup [ length ] dip > [ throw-bad-length ] when ; inline
 
 <<
 : be-range ( n -- range )
index 38a2a003f6139175b2c57a94fb5f50bbef5a3b14..c757d3c40ee8a0a2e47ac00702ef87a673b804e9 100644 (file)
@@ -77,7 +77,7 @@ CONSTANT: ACL_EXTENDED_DENY  2
 ERROR: bad-acl-tag-t n ;
 
 : acl_tag_t>string ( n -- string )
-    dup 0 2 between? [ bad-acl-tag-t ] unless
+    dup 0 2 between? [ throw-bad-acl-tag-t ] unless
     { "undefined" "allow" "deny" } nth ;
 
 ! acl_flag_t
index c26be9572ccafca5517c8832258b786c643b5aee..247e52b98ee4649c7b902c7ad7353c324d58bf8b 100644 (file)
@@ -77,7 +77,7 @@ PRIVATE>
 ERROR: acl-init-failed n ;
 
 :: n>new-acl ( n -- acl )
-    n acl_init dup [ n acl-init-failed ] unless ;
+    n acl_init dup [ n throw-acl-init-failed ] unless ;
 
 : new-acl ( -- acl ) 1 n>new-acl ; inline
 
index 2077c64610824db420d5764a2e17232f62011bf0..bc6c7c5ffe3d7cc6a51c738cad66473fd2b42ce8 100644 (file)
@@ -33,7 +33,7 @@ ERROR: invalid-file-size n path ;
 
 : zero-file ( n path -- )
     {
-        { [ over 0 < ] [ invalid-file-size ] }
+        { [ over 0 < ] [ throw-invalid-file-size ] }
         { [ over 0 = ] [ nip touch-file ] }
         [ (zero-file) ]
     } cond ;
index 5dc03fae7281962f88abd8bc8685da4017ae778e..558402df940bea661a34094c506f03fd4b789303 100644 (file)
@@ -28,7 +28,7 @@ ERROR: invalid-ipv4 str ;
         { 2 [ 1 cut { 0 0 } glue ] }
         { 3 [ 2 cut { 0 } glue ] }
         { 4 [ ] }
-        [ drop invalid-ipv4 ]
+        [ drop throw-invalid-ipv4 ]
     } case bubble nip ; inline
 
 PRIVATE>
index 41c3296eee853e89b40e68fcda73842ecff99ef6..df9c19beb8683137f30ebbf35430d457e0250440 100644 (file)
@@ -7,7 +7,7 @@ IN: machine-learning.rebalancing
 ERROR: probability-sum-not-one seq ;
 
 : check-probabilities ( seq -- seq )
-    dup sum 1.0 .00000000001 ~ [ probability-sum-not-one ] unless ;
+    dup sum 1.0 .00000000001 ~ [ throw-probability-sum-not-one ] unless ;
 
 : equal-probabilities ( n -- array )
     dup recip <array> ; inline
index 65157c7914b039bf7c67d82c876fa804874943bc..2388c42ff765a6b63b500bbb235327f575582f8e 100644 (file)
@@ -833,7 +833,7 @@ ERROR: not-fat-binary ;
     fat_header memory>struct dup magic>> {
         { FAT_MAGIC [ ] }
         { FAT_CIGAM [ ] }
-        [ 2drop not-fat-binary ]
+        [ 2drop throw-not-fat-binary ]
     } case dup
     [ >c-ptr fat_header heap-size swap <displaced-alien> ]
     [ nfat_arch>> 4 >be le> ] bi
index b7a73c48320deaac87d6e2bfd60695c8728f0c88..3a0b4ad774468fde3d512525243bede3d45894aa 100644 (file)
@@ -21,7 +21,7 @@ HOOK: handle-client-disconnect managed-server ( -- )
 
 ERROR: already-logged-in username ;
 
-M: managed-server handle-already-logged-in already-logged-in ;
+M: managed-server handle-already-logged-in throw-already-logged-in ;
 M: managed-server handle-client-join ;
 M: managed-server handle-client-disconnect ;
 
@@ -44,7 +44,7 @@ ERROR: no-such-client username ;
 PRIVATE>
 
 : send-client ( seq username -- )
-    clients ?at [ no-such-client ] [ (send-client) ] if ;
+    clients ?at [ throw-no-such-client ] [ (send-client) ] if ;
 
 : send-everyone ( seq -- )
     [ client-streams ] dip '[ _ (send-client) ] each ;
index d01dff72d5222d49f4e13054fe516eb1dd700fff..2bfda23a750e87e56e0a2ee4a816f72236225e6b 100644 (file)
@@ -13,7 +13,7 @@ IN: mason.common
 ERROR: no-host-name ;
 
 : short-host-name ( -- string )
-    host-name "." split1 drop [ no-host-name ] unless* ;
+    host-name "." split1 drop [ throw-no-host-name ] unless* ;
 
 SYMBOL: current-git-id
 
index 9d74bdc75016d66ce42db527f7396bc9ec68350b..29465ffd1a3aa704a0c6b8966b2d339bb4922709 100644 (file)
@@ -23,7 +23,7 @@ DERIVATIVE: abs
     [ 0 <=>
         {
             { +lt+ [ neg ] }
-            { +eq+ [ 0 \ abs undefined-derivative ] }
+            { +eq+ [ 0 \ abs throw-undefined-derivative ] }
             { +gt+ [ ] }
         } case
     ] ;
index 817fa89d9a9845bc1a2f5949f13aee3691d8c740..86b12231e1c126b7d9a9f0cd54d243b337529017 100644 (file)
@@ -32,7 +32,7 @@ INSTANCE: missing immutable-sequence
 ERROR: not-a-square-matrix matrix ;
 
 : check-square-matrix ( matrix -- matrix )
-    dup square-matrix? [ not-a-square-matrix ] unless ; inline
+    dup square-matrix? [ throw-not-a-square-matrix ] unless ; inline
 
 PRIVATE>
 
index b887b55a5345fe405a7caf2624625721dd96dfe2..d7cdfe47c289487f11ebd1e0470154e01d76bd1d 100644 (file)
@@ -39,10 +39,10 @@ PRIVATE>
 ERROR: not-enough-data ;
 
 : fft ( seq -- seq' )
-    [ not-enough-data ] [ f (fft) ] if-empty ;
+    [ throw-not-enough-data ] [ f (fft) ] if-empty ;
 
 : ifft ( seq -- seq' )
-    [ not-enough-data ] [ t (fft) ] if-empty ;
+    [ throw-not-enough-data ] [ t (fft) ] if-empty ;
 
 : correlate ( x y -- z )
     [ fft ] [ reverse fft ] bi* v* ifft ;
index 8ff2a03de3499dbeec1b8621d756bc13f833a8dc..5561fdad9c43d1aaad560cc6722767d73633235d 100644 (file)
@@ -112,14 +112,14 @@ TUPLE: request cmd key val extra opaque cas ;
 
 : check-status ( header -- )
     [ 5 ] dip nth {
-        { NOT_FOUND    [ key-not-found     ] }
-        { EXISTS       [ key-exists        ] }
-        { TOO_LARGE    [ value-too-large   ] }
-        { INVALID_ARGS [ invalid-arguments ] }
-        { NOT_STORED   [ item-not-stored   ] }
-        { NOT_NUMERIC  [ value-not-numeric ] }
-        { UNKNOWN_CMD  [ unknown-command   ] }
-        { MEMORY       [ out-of-memory     ] }
+        { NOT_FOUND    [ throw-key-not-found     ] }
+        { EXISTS       [ throw-key-exists        ] }
+        { TOO_LARGE    [ throw-value-too-large   ] }
+        { INVALID_ARGS [ throw-invalid-arguments ] }
+        { NOT_STORED   [ throw-item-not-stored   ] }
+        { NOT_NUMERIC  [ throw-value-not-numeric ] }
+        { UNKNOWN_CMD  [ throw-unknown-command   ] }
+        { MEMORY       [ throw-out-of-memory     ] }
         [ drop ]
     } case ;
 
index d635b4d83c8c16e5774ed0dd488f7004f7fb2bf0..778dd8e7fb84101ff060163d7d7210cc2f3932fc 100644 (file)
@@ -21,7 +21,7 @@ M: pile dispose
 : pile-alloc ( pile size -- alien )
     [
         [ [ ] [ size>> ] [ offset>> ] tri ] dip +
-        < [ not-enough-pile-space ] [ drop ] if
+        < [ throw-not-enough-pile-space ] [ drop ] if
     ] [
         drop [ offset>> ] [ underlying>> ] bi <displaced-alien>
     ] [
index 54c26dfab46320c32613604890cf690b1514529f..a874da893d8844fdf37f09091b719f82048670f1 100644 (file)
@@ -22,7 +22,7 @@ ERROR: bad-location str ;
         { 3 [ first3 [ string>number ] tri@ 60.0 / + 60.0 / + ] }
         { 2 [ first2 [ string>number ] bi@ 60.0 / + ] }
         { 1 [ first string>number ] }
-        [ drop bad-location ]
+        [ drop throw-bad-location ]
     } case ;
 
 : string>longitude ( str -- lon/f )
index a3ac4ebb136715a01cdfedc0f4650b16462fe1eb..431f250a2cd3abcbd053f41168735a1abed116ac 100644 (file)
@@ -26,7 +26,7 @@ ERROR: not-an-integer x ;
     [ "-" ?head swap ] dip
     [ [ "0" ] when-empty ] bi@
     [
-        [ dup string>number [ nip ] [ not-an-integer ] if* ] bi@
+        [ dup string>number [ nip ] [ throw-not-an-integer ] if* ] bi@
     ] keep length
     10^ / + swap [ neg ] when ;
 
index b2801c11b9cecee1c780260dc47e5bd80e26b107..3b2ce203bc0cb4c689a9d85c65c5d10c7e119790 100644 (file)
@@ -148,7 +148,10 @@ ERROR: mongod-connection-error address message ;
     clone [ verify-nodes ] [ <mdb-connection> ] [ ] tri
     master-node [
         open-connection [ authenticate-connection ] keep
-    ] [ drop nip address>> "Could not open connection to mongod" mongod-connection-error ] recover ;
+    ] [
+        drop nip address>> "Could not open connection to mongod"
+        throw-mongod-connection-error
+    ] recover ;
 
 : mdb-close ( mdb-connection -- )
      [ [ dispose ] when* f ] change-handle drop ;
index bfad87b739f7c75ada9f2fae5431f8a97d008b71..a0ca3fd54af527fc9d982b3f3d5d40bfaece1ae0 100644 (file)
@@ -267,7 +267,7 @@ M: mdb-collection validate.
 <PRIVATE
 
 : send-message-check-error ( message -- )
-    send-message lasterror [ mdb-error ] when* ;
+    send-message lasterror [ throw-mdb-error ] when* ;
 
 PRIVATE>
 
index 86c599137be8de739fdf1745fbabf664c7fc5f3e..db86cdb32cbdb3a0d4d4a669002c552c7a023d10 100755 (executable)
@@ -160,7 +160,7 @@ CONSTANT: beep-freq 880
             { dash-char [ dash ] }
             { word-gap-char [ intra-char-gap ] }
             { unknown-char [ intra-char-gap ] }
-            [ no-morse-ch ]
+            [ throw-no-morse-ch ]
         } case
     ] interleave ;
 
index 021a96c3bb5e1895755b013f611ed080366d98e2..1519d43859e51783d095f5aaf12e67f4f3833363 100644 (file)
@@ -66,7 +66,7 @@ ERROR: unknown-format n ;
         { [ dup 0xc7 = ] [ drop read1 read-ext ] }
         { [ dup 0xc8 = ] [ drop 2 read be> read-ext ] }
         { [ dup 0xc9 = ] [ drop 4 read be> read-ext ] }
-        [ unknown-format ]
+        [ throw-unknown-format ]
     } cond ;
 
 ERROR: cannot-convert obj ;
@@ -89,7 +89,7 @@ M: integer write-msgpack
             { [ dup 0xffff <= ] [ 0xcd write1 2 >be write ] }
             { [ dup 0xffffffff <= ] [ 0xce write1 4 >be write ] }
             { [ dup 0xffffffffffffffff <= ] [ 0xcf write1 8 >be write ] }
-            [ cannot-convert ]
+            [ throw-cannot-convert ]
         } cond
     ] [
         {
@@ -98,7 +98,7 @@ M: integer write-msgpack
             { [ dup -0x8000 >= ] [ 0xd1 write1 2 >be write ] }
             { [ dup -0x80000000 >= ] [ 0xd2 write1 4 >be write ] }
             { [ dup -0x8000000000000000 >= ] [ 0xd3 write1 8 >be write ] }
-            [ cannot-convert ]
+            [ throw-cannot-convert ]
         } cond
     ] if ;
 
@@ -111,7 +111,7 @@ M: string write-msgpack
         { [ dup 0xff <= ] [ 0xd9 write1 write1 ] }
         { [ dup 0xffff <= ] [ 0xda write1 2 >be write ] }
         { [ dup 0xffffffff <= ] [ 0xdb write1 4 >be write ] }
-        [ cannot-convert ]
+        [ throw-cannot-convert ]
     } cond output-stream get utf8 encode-string ;
 
 M: byte-array write-msgpack
@@ -119,7 +119,7 @@ M: byte-array write-msgpack
         { [ dup 0xff <= ] [ 0xc4 write1 write1 ] }
         { [ dup 0xffff <= ] [ 0xc5 write1 2 >be write ] }
         { [ dup 0xffffffff <= ] [ 0xc6 write1 4 >be write ] }
-        [ cannot-convert ]
+        [ throw-cannot-convert ]
     } cond write ;
 
 : write-array-header ( n -- )
@@ -127,7 +127,7 @@ M: byte-array write-msgpack
         { [ dup 0xf <= ] [ 0x90 bitor write1 ] }
         { [ dup 0xffff <= ] [ 0xdc write1 2 >be write ] }
         { [ dup 0xffffffff <= ] [ 0xdd write1 4 >be write ] }
-        [ cannot-convert ]
+        [ throw-cannot-convert ]
     } cond ;
 
 M: sequence write-msgpack
@@ -138,7 +138,7 @@ M: sequence write-msgpack
         { [ dup 0xf <= ] [ 0x80 bitor write1 ] }
         { [ dup 0xffff <= ] [ 0xde write1 2 >be write ] }
         { [ dup 0xffffffff <= ] [ 0xdf write1 4 >be write ] }
-        [ cannot-convert ]
+        [ throw-cannot-convert ]
     } cond ;
 
 M: assoc write-msgpack
index aa62a4391d78dda9e6be8f59d81c0b3f2cac47d1..0ff11df21357cd16ce01ec65eecff54d57b9c3f2 100644 (file)
@@ -53,7 +53,7 @@ ERROR: invalid-perlin-noise-table table ;
 
 : validate-table ( table -- table )
     dup { [ byte-array? ] [ length 512 >= ] } 1&&
-    [ invalid-perlin-noise-table ] unless ;
+    [ throw-invalid-perlin-noise-table ] unless ;
 
 ! XXX doesn't work when v is nan or |v| >= 2^31
 : floor-vector ( v -- v' )
index 4f4e5fb7e18fc005e78cd0fe0b26bee49c78eb11..f9b7dde26205c76ddf14759a3d8ffc9857039ce8 100644 (file)
@@ -21,7 +21,7 @@ __kernel void square(
 
 ERROR: cl-error err ;
 : cl-success ( err -- )
-    dup CL_SUCCESS = [ drop ] [ cl-error ] if ;
+    dup CL_SUCCESS = [ drop ] [ throw-cl-error ] if ;
 
 :: cl-string-array ( str -- alien )
     str ascii encode 0 suffix :> str-buffer
index 8325be9a9cf169765f4e7fdaa95026c33a6185c3..2a9819c642d7be7deb21e87544e868a4402f4da7 100644 (file)
@@ -13,10 +13,10 @@ SPECIALIZED-ARRAYS: void* char size_t ;
 ERROR: cl-error err ;
 
 : cl-success ( err -- )
-    dup CL_SUCCESS = [ drop ] [ cl-error ] if ; inline
+    dup CL_SUCCESS = [ drop ] [ throw-cl-error ] if ; inline
 
 : cl-not-null ( err -- )
-    dup f = [ cl-error ] [ drop ] if ; inline
+    dup f = [ throw-cl-error ] [ drop ] if ; inline
 
 : info-data-size ( handle name info-quot -- size_t )
     [ 0 f 0 size_t <ref> ] dip [ call cl-success ] 2keep drop size_t deref ; inline
@@ -354,7 +354,7 @@ M: cl-filter-linear  filter-mode-constant drop CL_FILTER_LINEAR ;
     {
         { CL_BUILD_PROGRAM_FAILURE [
             program-handle device id>> program-build-log program-handle
-            clReleaseProgram cl-success cl-error f ] }
+            clReleaseProgram cl-success throw-cl-error f ] }
         { CL_SUCCESS [ cl-program new-disposable program-handle >>handle ] }
         [ program-handle clReleaseProgram cl-success cl-success f ]
     } case ;
index 13814015a847a224d8a9e8c4e0cde3a378edb5f9..a4e0b15b9b2d5a6eb1c7c57d4b32307df9ef11f3 100644 (file)
@@ -25,7 +25,7 @@ ERROR: no-pair-method a b generic ;
 
 : pair-generic-definition ( word -- def )
     [ sorted-pair-methods [ first2 pair-method-cond ] map ]
-    [ [ no-pair-method ] curry suffix ] bi 1quotation
+    [ [ throw-no-pair-method ] curry suffix ] bi 1quotation
     [ 2dup [ class-of ] compare +gt+ eq? ?swap ] [ cond ] surround ;
 
 : make-pair-generic ( word -- )
index 201b91e5e7b3f918a88a19731800a48d4ef53c9d..4835248cc6e660815f9a86806c3cfd06e3de943d 100644 (file)
@@ -31,7 +31,7 @@ M: pair set-at
 ERROR: cannot-delete-key pair ;
 
 M: pair delete-at
-    [ cannot-delete-key ] [
+    [ throw-cannot-delete-key ] [
         [ delete-at ] [ 2drop ] if-hash
     ] if-key ; inline
 
index e17eeaa71e611b1a2ccf0aacb1c2c53f0497a78c..cad0bd4875f434c131158ae05fa7418407290fd7 100644 (file)
@@ -31,7 +31,7 @@ ERROR: pcre-error value ;
     ] [ 2drop f ] if* ;
 
 : check-bad-option ( err value what -- value )
-    rot 0 = [ drop ] [ bad-option ] if ;
+    rot 0 = [ drop ] [ throw-bad-option ] if ;
 
 : pcre-config ( what -- value )
     [
@@ -81,7 +81,7 @@ CONSTANT: default-opts flags{ PCRE_UTF8 PCRE_UCP }
     default-opts { c-string int } [ f pcre_compile ] with-out-parameters ;
 
 : <pcre> ( expr -- pcre )
-    dup (pcre) 2array swap [ 2nip ] [ malformed-regexp ] if* ;
+    dup (pcre) 2array swap [ 2nip ] [ throw-malformed-regexp ] if* ;
 
 : <pcre-extra> ( pcre -- pcre-extra )
     0 { c-string } [ pcre_study ] with-out-parameters drop ;
@@ -104,7 +104,7 @@ CONSTANT: empty-match-opts flags{ PCRE_NOTEMPTY_ATSTART PCRE_ANCHORED }
         [ ofs>> ]
         [ exec-opts>> ]
     } cleave exec over dup -1 < [
-        PCRE_ERRORS number>enum pcre-error
+        PCRE_ERRORS number>enum throw-pcre-error
     ] [
         -1 = [
             2drop dup exec-opts>> 0 =
index 50d0feebd14a60a951aa2d34c18bcb4a9e2a1d25..9979a3be5e4705709e7e342b3320241c922c17ec 100644 (file)
@@ -198,7 +198,7 @@ ERROR: no-card card deck ;
 
 : draw-specific-card ( card deck -- card )
     [ >ckf ] dip
-    2dup index [ swap remove-nth! drop ] [ no-card ] if* ;
+    2dup index [ swap remove-nth! drop ] [ throw-no-card ] if* ;
 
 : start-hands ( seq -- seq' deck )
     <deck> [ '[ [ _ draw-specific-card ] map ] map ] keep ;
@@ -248,7 +248,7 @@ ERROR: bad-suit-symbol ch ;
         { CHAR: D CHAR: D }
         { CHAR: H CHAR: H }
         { CHAR: C CHAR: C }
-    } ?at [ bad-suit-symbol ] unless ;
+    } ?at [ throw-bad-suit-symbol ] unless ;
 
 : card> ( string -- card )
     1 over [ symbol>suit ] change-nth >ckf ;
index b397a0b28716145dd9a757151928d3ad9cedbd42..4d856b82c092044a49b962170ff3aa8f30ebe184 100644 (file)
@@ -7,12 +7,12 @@ IN: progress-bars
 ERROR: invalid-percent x ;
 
 : check-percent ( x -- x )
-    dup 0 1 between? [ invalid-percent ] unless ;
+    dup 0 1 between? [ throw-invalid-percent ] unless ;
 
 ERROR: invalid-length x ;
 
 : check-length ( x -- x )
-    dup { [ 0 > ] [ integer? ] } 1&& [ invalid-length ] unless ;
+    dup { [ 0 > ] [ integer? ] } 1&& [ throw-invalid-length ] unless ;
 
 : (make-progress-bar) ( percent len completed-ch pending-ch -- string )
     [ [ * >integer ] keep over - ] 2dip
index 5b4f0b328324b0d26f9e66459611c7dc538439f1..0121bf8cf1b277174a11b766a1fb583d8e184f53 100644 (file)
@@ -24,7 +24,7 @@ ERROR: redis-error message ;
     <redis-response> ;
 
 : handle-error ( string -- * )
-    redis-error ;
+    throw-redis-error ;
 
 PRIVATE>
 
index b6eefd214785192277c39d659655c6e38248bd0a..8fe2473a4a729caf154057058e6e3f406af9de62 100644 (file)
@@ -68,7 +68,7 @@ ERROR: unsupported-resolv.conf-option string ;
         { [ "rotate" ?head ] [ drop t >>rotate? ] }
         { [ "no-check-names" ?head ] [ drop t >>no-check-names? ] }
         { [ "inet6" ?head ] [ drop t >>inet6? ] }
-        [ unsupported-resolv.conf-option ]
+        [ throw-unsupported-resolv.conf-option ]
     } cond drop ;
 
 ERROR: unsupported-resolv.conf-line string ;
@@ -81,7 +81,7 @@ ERROR: unsupported-resolv.conf-line string ;
         { [ "search" ?head ] [ parse-search ] }
         { [ "sortlist" ?head ] [ parse-sortlist ] }
         { [ "options" ?head ] [ parse-option ] }
-        [ unsupported-resolv.conf-line ]
+        [ throw-unsupported-resolv.conf-line ]
     } cond ;
 
 PRIVATE>
index e32503e76bf6ae4423c2d3bc717619222a639ee2..c6c74bbd46d594b48b1cd9ba7e6b05e87dff09a4 100644 (file)
@@ -36,7 +36,7 @@ PREDICATE: role < mixin-class
 
 : check-for-slot-overlap ( class roles-and-superclass slots -- )
     [ [ role-or-tuple-slot-names ] map concat ] [ slot-names ] bi* append
-    duplicates dup empty? [ 2drop ] [ role-slot-overlap ] if ;
+    duplicates dup empty? [ 2drop ] [ throw-role-slot-overlap ] if ;
 
 : roles>slots ( roles-and-superclass slots -- superclass slots' )
     [
@@ -44,7 +44,7 @@ PREDICATE: role < mixin-class
         dup length {
             { 0 [ drop tuple ] }
             { 1 [ first ] }
-            [ drop multiple-inheritance-attempted ]
+            [ drop throw-multiple-inheritance-attempted ]
         } case
         swap [ role-slots ] map concat
     ] dip append ;
index 0790cde7d993aefea4c7ae4877675d7d1daec68b..142904e008b56010e51a7b486d8871c9a78aa91d 100644 (file)
@@ -13,7 +13,7 @@ classes [ H{ } clone ] initialize
 ERROR: no-class name ;
 
 : lookup-class ( class -- class )
-    classes get ?at [ no-class ] unless ;
+    classes get ?at [ throw-no-class ] unless ;
 
 : define-class ( class superclass ivars -- class-word )
     [ create-class ] [ lookup-class ] [ ] tri*
index 3a7d29e6dac5728e6b25e7d7546853b000ab813d..42ffccb400ad01f3d27d5d185b794d3d3c8dfb8b 100644 (file)
@@ -47,7 +47,7 @@ M: bad-identifier summary drop "Unknown identifier" ;
         [ local-reader ]
         [ ivar-reader ]
         [ drop class-name ]
-        [ drop bad-identifier ]
+        [ drop throw-bad-identifier ]
     } 2|| ;
 
 : local-writer ( name lexenv -- local )
@@ -63,5 +63,5 @@ M: bad-identifier summary drop "Unknown identifier" ;
     {
         [ local-writer ]
         [ ivar-writer ]
-        [ drop bad-identifier ]
+        [ drop throw-bad-identifier ]
     } 2|| ;
index 6de20afc6d33aaff1713ce2fbce4b07ccd33de73..ae58d6c0b9fee1e30519539dfa350685a3181a87 100644 (file)
@@ -11,7 +11,7 @@ IN: smalltalk.parser
 ERROR: bad-number str ;
 
 : check-number ( str -- n )
-    >string dup string>number [ ] [ bad-number ] ?if ;
+    >string dup string>number [ ] [ throw-bad-number ] ?if ;
 
 EBNF: parse-smalltalk
 
index 1417c07eeddfe2207f4724ca340031248347877c..c8f2c3212a69221034f527d3b7215e9372bedb53 100644 (file)
@@ -74,7 +74,7 @@ TYPED: checksum-header ( seq: byte-array -- n )
         [
             binary [ read-tar-header ] with-byte-reader
             dup checksum>>
-        ] dip = [ checksum-error ] unless
+        ] dip = [ throw-checksum-error ] unless
     ] if ;
 
 ERROR: unknown-typeflag ch ;
index 4541a15eca34c04cad80305d4bbb701921d049d5..181a891ea296903d6aa47fb19554e034be6fd596 100644 (file)
@@ -12,7 +12,7 @@ ERROR: fica-base-unknown ;
         { 2009 106800 }
         { 2008 102000 }
         { 2007  97500 }
-    } at [ fica-base-unknown ] unless* ;
+    } at [ throw-fica-base-unknown ] unless* ;
 
 : fica-tax ( salary w4 -- x )
     year>> fica-base-rate min fica-tax-rate * ;
index 3372a07e8277541bca715ba555d67347be4ece36..4093e41e932cd6a537777c0a476e620d1b57ed01 100644 (file)
@@ -18,7 +18,7 @@ CONSTANT: MAGIC 0o432
 ERROR: bad-magic ;
 
 : check-magic ( n -- )
-    MAGIC = [ bad-magic ] unless ;
+    MAGIC = [ throw-bad-magic ] unless ;
 
 TUPLE: terminfo-header names-bytes boolean-bytes #numbers
 #strings string-bytes ;
index 998353eab4bccb8e85a8a25179a0ca83342013c0..02a81ee96c8f0bfae0ba591bea7fc4e53c3a36b4 100644 (file)
@@ -27,7 +27,7 @@ PACKED-STRUCT: ttinfo
 ERROR: bad-magic ;
 
 : check-magic ( -- )
-    4 read "TZif" sequence= [ bad-magic ] unless ;
+    4 read "TZif" sequence= [ throw-bad-magic ] unless ;
 
 TUPLE: tzfile header transition-times local-times types abbrevs
 leaps is-std is-gmt ;
index 6bc2242074c836cbbeb071f8204f3e9750d266cf..51ada98c935ee1f0e62da1ef7e5bacbc7f012a4d 100644 (file)
@@ -34,7 +34,7 @@ M: dimensions-not-equal summary drop "Dimensions do not match" ;
 
 : check-dimensions ( d d -- )
     [ dimensions 2array ] same?
-    [ dimensions-not-equal ] unless ;
+    [ throw-dimensions-not-equal ] unless ;
 
 : 2values ( dim dim -- val val ) [ value>> ] bi@ ;
 
index 111ea991592d9b2a16fca566b27ac8dbe2dab5b9..d1020037d92041edaefe340cf9fb1f6702fa2599 100644 (file)
@@ -22,7 +22,7 @@ M: no-such-state summary drop "No such state" ;
 
 MEMO: string>state ( string -- state )
     dup states [ name>> = ] with find nip
-    [ ] [ no-such-state ] ?if ;
+    [ ] [ throw-no-such-state ] ?if ;
 
 TUPLE: city
 first-zip name state latitude longitude gmt-offset dst-offset ;
index c1d23e0d9ac7c000e240ca401d97c822cd14d45d..f30b3da56b81581c622454e27e2886bb766f64c7 100644 (file)
@@ -11,7 +11,7 @@ IN: uu
 ERROR: bad-length seq ;
 
 : check-length ( seq -- seq )
-    dup length 45 > [ bad-length ] when ; inline
+    dup length 45 > [ throw-bad-length ] when ; inline
 
 :: binary>ascii ( seq -- seq' )
     0 :> char!
@@ -41,7 +41,7 @@ ERROR: illegal-character ch ;
 
 : check-illegal-character ( ch -- ch )
     dup { [ CHAR: \s < ] [ CHAR: \s 64 + > ] } 1||
-    [ illegal-character ] when ;
+    [ throw-illegal-character ] when ;
 
 :: ascii>binary ( seq -- seq' )
     0 :> char!
index 8e1c30fae34d51a309183daa8480b30ce2be3a5a..1792fdc3cb36b6b48525627613411f3f702d5bf1 100644 (file)
@@ -23,6 +23,6 @@ ERROR: git-revision-not-found path ;
 : use-vocab-rev ( vocab-name rev -- )
     [ create-vocab vocab-source-path dup ] dip git-object-id
     [ [ input-stream get swap parse-stream call( -- ) ] with-git-object-stream ]
-    [ git-revision-not-found ] if* ;
+    [ throw-git-revision-not-found ] if* ;
 
 SYNTAX: USE-REV: scan-token scan-token use-vocab-rev ;
index 058ead1e53927d0098e697d01f6b7d7fb92dc094..09d2908c77a30389897d248b7e38e7f2213b633b 100644 (file)
@@ -22,7 +22,7 @@ ERROR: yaml-no-document ;
 <PRIVATE
 
 : yaml-initialize-assert-ok ( ? -- )
-    [ libyaml-initialize-error ] unless ;
+    [ throw-libyaml-initialize-error ] unless ;
 
 : (libyaml-parser-error) ( parser -- )
     {
@@ -33,10 +33,10 @@ ERROR: yaml-no-document ;
         [ problem_mark>> ]
         [ context>> ]
         [ context_mark>> ]
-    } cleave [ clone ] 7 napply libyaml-parser-error ;
+    } cleave [ clone ] 7 napply throw-libyaml-parser-error ;
 
 : (libyaml-emitter-error) ( emitter -- )
-    [ error>> ] [ problem>> ] bi [ clone ] bi@ libyaml-emitter-error ;
+    [ error>> ] [ problem>> ] bi [ clone ] bi@ throw-libyaml-emitter-error ;
 
 : yaml-parser-assert-ok ( ? parser -- )
     swap [ drop ] [ (libyaml-parser-error) ] if ;
@@ -60,7 +60,7 @@ SYMBOL: anchors
 
 : assert-anchor-exists ( anchor -- )
     anchors get 2dup at* nip
-    [ 2drop ] [ yaml-undefined-anchor ] if ;
+    [ 2drop ] [ throw-yaml-undefined-anchor ] if ;
 
 : deref-anchor ( event -- obj )
     data>> alias>> anchor>>
@@ -182,7 +182,7 @@ DEFER: parse-mapping
 : expect-event ( parser event type -- )
     [
         [ next-event type>> ] dip 2dup =
-        [ 2drop ] [ 1array yaml-unexpected-event ] if
+        [ 2drop ] [ 1array throw-yaml-unexpected-event ] if
     ] with-destructors ;
 
 ! Same as 'with', but for combinators that
@@ -257,7 +257,7 @@ M: assoc apply-merge-keys
         parser event next-event type>> {
             { YAML_DOCUMENT_START_EVENT [ t ] }
             { YAML_STREAM_END_EVENT [ f ] }
-            [ { YAML_DOCUMENT_START_EVENT YAML_STREAM_END_EVENT } yaml-unexpected-event ]
+            [ { YAML_DOCUMENT_START_EVENT YAML_STREAM_END_EVENT } throw-yaml-unexpected-event ]
         } case
     ] with-destructors [
         parser event parse-yaml-doc t
@@ -283,7 +283,7 @@ PRIVATE>
     [
         init-parser
         [ YAML_STREAM_START_EVENT expect-event ]
-        [ ?parse-yaml-doc [ yaml-no-document ] unless ] 2bi
+        [ ?parse-yaml-doc [ throw-yaml-no-document ] unless ] 2bi
     ] with-destructors ;
 
 : yaml-docs> ( str -- arr )
index 89710e782285383ce40f583358c59bc6bb50d1d8..d6fbc2a7af9b59ab458f53dda864a140754db333 100644 (file)
@@ -154,7 +154,7 @@ ERROR: zone-not-found name ;
 
 : find-zone ( string -- rules )
     raw-zone-map
-    [ last ] assoc-map ?at [ zone-not-found ] unless ;
+    [ last ] assoc-map ?at [ throw-zone-not-found ] unless ;
 
 : find-zone-rules ( string -- zone rules )
     find-zone dup rules/save>> find-rules ;