Skip to content

Commit

Permalink
change ERROR: words from throw-foo back to foo.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Aug 13, 2015
1 parent a6926b1 commit ceb7505
Show file tree
Hide file tree
Showing 330 changed files with 653 additions and 660 deletions.
4 changes: 2 additions & 2 deletions basis/alien/c-types/c-types.factor
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ UNION: c-type-name
c-type-word pointer ;

: resolve-typedef ( name -- c-type )
dup void? [ throw-no-c-type ] when
dup void? [ no-c-type ] when
dup c-type-name? [ lookup-c-type ] when ;

M: word lookup-c-type
dup "c-type" word-prop resolve-typedef
[ ] [ throw-no-c-type ] ?if ;
[ ] [ no-c-type ] ?if ;

GENERIC: c-type-class ( name -- class )

Expand Down
2 changes: 1 addition & 1 deletion basis/alien/data/data.factor
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ M: bad-byte-array-length summary

: cast-array ( byte-array c-type -- array )
[ binary-object ] dip [ heap-size /mod 0 = ] keep swap
[ <c-direct-array> ] [ throw-bad-byte-array-length ] if ; inline
[ <c-direct-array> ] [ bad-byte-array-length ] if ; inline

: malloc-array ( n c-type -- array )
[ heap-size calloc ] [ <c-direct-array> ] 2bi ; inline
Expand Down
2 changes: 1 addition & 1 deletion basis/alien/endian/endian.factor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ERROR: invalid-signed-conversion n ;
{ 2 [ [ c:short <ref> c:short deref ] ] }
{ 4 [ [ int <ref> int deref ] ] }
{ 8 [ [ longlong <ref> longlong deref ] ] }
[ throw-invalid-signed-conversion ]
[ invalid-signed-conversion ]
} case ; inline

MACRO: byte-reverse ( n signed? -- quot )
Expand Down
4 changes: 2 additions & 2 deletions basis/alien/libraries/libraries.factor
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ M: library dispose dll>> [ dispose ] when* ;

: address-of ( name library -- value )
2dup load-library dlsym-raw
[ 2nip ] [ throw-no-such-symbol ] if* ;
[ 2nip ] [ no-such-symbol ] if* ;

SYMBOL: deploy-libraries

Expand All @@ -89,7 +89,7 @@ deploy-libraries [ V{ } clone ] initialize
: deploy-library ( name -- )
dup libraries get key?
[ deploy-libraries get 2dup member? [ 2drop ] [ push ] if ]
[ "deploy-library failure" throw-no-such-library ] if ;
[ "deploy-library failure" no-such-library ] if ;

HOOK: >deployed-library-path os ( path -- path' )

Expand Down
2 changes: 1 addition & 1 deletion basis/alien/parser/parser.factor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ERROR: bad-array-type ;

: parse-array-type ( name -- c-type )
"[" split unclip
[ [ "]" ?tail [ throw-bad-array-type ] unless parse-datum ] map ]
[ [ "]" ?tail [ bad-array-type ] unless parse-datum ] map ]
[ (parse-c-type) ]
bi* prefix ;

Expand Down
4 changes: 2 additions & 2 deletions basis/base64/base64.factor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CONSTANT: alphabet

: base64>ch ( ch -- ch )
$[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth
[ throw-malformed-base64 ] unless* ; inline
[ malformed-base64 ] unless* ; inline

: (write-lines) ( column byte-array -- column' )
output-stream get dup '[
Expand Down Expand Up @@ -84,7 +84,7 @@ PRIVATE>
4 "\n\r" pick read-ignoring dup length {
{ 0 [ 2drop ] }
{ 4 [ decode4 (decode-base64) ] }
[ throw-malformed-base64 ]
[ malformed-base64 ]
} case ;

PRIVATE>
Expand Down
2 changes: 1 addition & 1 deletion basis/biassocs/biassocs.factor
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ M: no-biassoc-deletion summary
drop "biassocs do not support deletion" ;

M: biassoc delete-at
throw-no-biassoc-deletion ;
no-biassoc-deletion ;

M: biassoc >alist from>> >alist ;

Expand Down
2 changes: 1 addition & 1 deletion basis/bit-arrays/bit-arrays.factor
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PRIVATE>
ERROR: bad-array-length n ;

: <bit-array> ( n -- bit-array )
dup 0 < [ throw-bad-array-length ] when
dup 0 < [ bad-array-length ] when
dup bits>bytes <byte-array>
bit-array boa ; inline

Expand Down
2 changes: 1 addition & 1 deletion basis/bit-sets/bit-sets.factor
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ M: bit-set delete
ERROR: check-bit-set-failed ;

: check-bit-set ( bit-set -- bit-set )
dup bit-set? [ throw-check-bit-set-failed ] unless ; inline
dup bit-set? [ check-bit-set-failed ] unless ; inline

: bit-set-map ( seq1 seq2 quot -- seq )
[ drop [ length ] bi@ [ assert= ] keep ]
Expand Down
6 changes: 3 additions & 3 deletions basis/bitstreams/bitstreams.factor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ERROR: invalid-widthed bits #bits ;
dup 0 < [ neg ] when log2 <=
] if-zero
]
} 2|| [ throw-invalid-widthed ] when ;
} 2|| [ invalid-widthed ] when ;

: <widthed> ( bits #bits -- widthed )
check-widthed
Expand Down Expand Up @@ -89,7 +89,7 @@ ERROR: not-enough-widthed-bits widthed n ;

: check-widthed-bits ( widthed n -- widthed n )
2dup { [ nip 0 < ] [ [ #bits>> ] dip < ] } 2||
[ throw-not-enough-widthed-bits ] when ;
[ not-enough-widthed-bits ] when ;

: widthed-bits ( widthed n -- bits )
check-widthed-bits
Expand Down Expand Up @@ -161,7 +161,7 @@ ERROR: not-enough-bits n bit-reader ;
] if ;

:: (peek) ( n bs endian> subseq-endian -- bits )
n bs enough-bits? [ n bs throw-not-enough-bits ] unless
n bs enough-bits? [ n bs not-enough-bits ] unless
bs [ byte-pos>> ] [ bit-pos>> n + ] bi #bits>#bytes dupd +
bs bytes>> subseq endian> execute( seq -- x )
n bs subseq-endian execute( bignum n bs -- bits ) ;
Expand Down
2 changes: 1 addition & 1 deletion basis/bootstrap/help/help.factor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IN: bootstrap.help

t load-help? set-global

[ dup lookup-vocab [ drop ] [ throw-no-vocab ] if ] require-hook [
[ dup lookup-vocab [ drop ] [ no-vocab ] if ] require-hook [
dictionary get values
[ docs-loaded?>> ] reject
[ load-docs ] each
Expand Down
4 changes: 2 additions & 2 deletions basis/bootstrap/image/image.factor
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ ERROR: not-in-image vocabulary word ;

: fixup-word ( word -- offset )
transfer-word dup lookup-object
[ ] [ [ vocabulary>> ] [ name>> ] bi throw-not-in-image ] ?if ;
[ ] [ [ vocabulary>> ] [ name>> ] bi not-in-image ] ?if ;

: fixup-words ( -- )
bootstrapping-image get [ dup word? [ fixup-word ] when ] map! drop ;
Expand Down Expand Up @@ -437,7 +437,7 @@ M: byte-array '
ERROR: tuple-removed class ;

: require-tuple-layout ( word -- layout )
dup tuple-layout [ ] [ throw-tuple-removed ] ?if ;
dup tuple-layout [ ] [ tuple-removed ] ?if ;

: (emit-tuple) ( tuple -- pointer )
[ tuple-slots ]
Expand Down
2 changes: 1 addition & 1 deletion basis/boxes/boxes.factor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ERROR: box-full box ;

: >box ( value box -- )
dup occupied>>
[ throw-box-full ] [ t >>occupied value<< ] if ; inline
[ box-full ] [ t >>occupied value<< ] if ; inline

ERROR: box-empty box ;

Expand Down
2 changes: 1 addition & 1 deletion basis/byte-arrays/hex/hex.factor
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ ERROR: odd-length-hex-string string ;
SYNTAX: HEX{
"}" parse-tokens concat
[ blank? ] reject
dup length even? [ throw-odd-length-hex-string ] unless
dup length even? [ odd-length-hex-string ] unless
2 <groups> [ hex> ] B{ } map-as
suffix! ;
2 changes: 1 addition & 1 deletion basis/cairo/cairo.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ERROR: cairo-error n message ;

: (check-cairo) ( cairo_status_t -- )
dup CAIRO_STATUS_SUCCESS =
[ drop ] [ [ ] [ cairo_status_to_string ] bi throw-cairo-error ] if ;
[ drop ] [ [ ] [ cairo_status_to_string ] bi cairo-error ] if ;

: check-cairo ( cairo -- ) cairo_status (check-cairo) ;

Expand Down
4 changes: 2 additions & 2 deletions basis/calendar/calendar.factor
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ M: not-a-month summary
<PRIVATE

: check-month ( n -- n )
[ throw-not-a-month ] when-zero ;
[ not-a-month ] when-zero ;

PRIVATE>

Expand Down Expand Up @@ -93,7 +93,7 @@ CONSTANT: month-abbreviations-hash

: month-abbreviation-index ( string -- n )
month-abbreviations-hash ?at
[ throw-not-a-month-abbreviation ] unless ;
[ not-a-month-abbreviation ] unless ;

CONSTANT: day-counts { 0 31 28 31 30 31 30 31 31 30 31 30 31 }

Expand Down
2 changes: 1 addition & 1 deletion basis/calendar/format/format.factor
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ M: timestamp year. ( timestamp -- )
ERROR: invalid-timestamp-format ;

: check-timestamp ( obj/f -- obj )
[ throw-invalid-timestamp-format ] unless* ;
[ invalid-timestamp-format ] unless* ;

: read-token ( seps -- token )
[ read-until ] keep member? check-timestamp drop ;
Expand Down
2 changes: 1 addition & 1 deletion basis/checksums/openssl/openssl.factor
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ M: evp-md-context dispose*

: digest-named ( name -- md )
dup EVP_get_digestbyname
[ ] [ throw-unknown-digest ] ?if ;
[ ] [ unknown-digest ] ?if ;

: set-digest ( name ctx -- )
handle>> swap digest-named f EVP_DigestInit_ex ssl-error ;
Expand Down
6 changes: 3 additions & 3 deletions basis/classes/struct/struct.factor
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ M: struct binary-zero? binary-object uchar <c-direct-array> [ 0 = ] all? ; inlin

:: (define-struct-class) ( class slot-specs offsets-quot alignment-quot -- )
slot-specs check-struct-slots
slot-specs empty? [ throw-struct-must-have-slots ] when
slot-specs empty? [ struct-must-have-slots ] when
class redefine-struct-tuple-class
slot-specs offsets-quot call :> unaligned-size
slot-specs alignment-quot call :> alignment
Expand Down Expand Up @@ -376,7 +376,7 @@ PRIVATE>
scan-token {
{ ";" [ f ] }
{ "{" [ parse-struct-slot suffix! t ] }
[ throw-invalid-struct-slot ]
[ invalid-struct-slot ]
} case ;

: parse-struct-definition ( -- class slots )
Expand Down Expand Up @@ -413,7 +413,7 @@ SYNTAX: S@
scan-token {
{ ";" [ f ] }
{ "{" [ parse-struct-slot` t ] }
[ throw-invalid-struct-slot ]
[ invalid-struct-slot ]
} case ;

PRIVATE>
Expand Down
4 changes: 2 additions & 2 deletions basis/cocoa/messages/messages.factor
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ERROR: no-objc-method name ;
objc-methods get at ;

: lookup-method ( selector -- method )
dup ?lookup-method [ ] [ throw-no-objc-method ] ?if ;
dup ?lookup-method [ ] [ no-objc-method ] ?if ;

: lookup-sender ( name -- method )
lookup-method message-senders get at ;
Expand Down Expand Up @@ -196,7 +196,7 @@ ERROR: no-objc-type name ;

: decode-type ( ch -- ctype )
1string dup objc>alien-types get at
[ ] [ throw-no-objc-type ] ?if ;
[ ] [ no-objc-type ] ?if ;

: (parse-objc-type) ( i string -- ctype )
[ [ 1 + ] dip ] [ nth ] 2bi {
Expand Down
2 changes: 1 addition & 1 deletion basis/cocoa/plists/plists.factor
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ERROR: invalid-plist-object object ;
{ NSArray [ (plist-NSArray>) ] }
{ NSDictionary [ (plist-NSDictionary>) ] }
{ NSObject [ ] }
[ throw-invalid-plist-object ]
[ invalid-plist-object ]
} objc-class-case ;

: read-plist ( path -- assoc )
Expand Down
2 changes: 1 addition & 1 deletion basis/colors/constants/constants.factor
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ PRIVATE>
ERROR: no-such-color name ;

: named-color ( name -- color )
dup colors at [ ] [ throw-no-such-color ] ?if ;
dup colors at [ ] [ no-such-color ] ?if ;

SYNTAX: COLOR: scan-token named-color suffix! ;
2 changes: 1 addition & 1 deletion basis/combinators/random/random.factor
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ M: bad-probabilities summary
dup good-probabilities? [
[ dup pair? [ prepare-pair ] [ with-drop ] if ] map
cond>quot
] [ throw-bad-probabilities ] if ;
] [ bad-probabilities ] if ;

MACRO: (casep) ( assoc -- quot ) (casep>quot) ;

Expand Down
2 changes: 1 addition & 1 deletion basis/combinators/short-circuit/smart/smart.factor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERROR: cannot-determine-arity ;

: arity ( quots -- n )
first infer
dup terminated?>> [ throw-cannot-determine-arity ] when
dup terminated?>> [ cannot-determine-arity ] when
effect-height neg 1 + ;

PRIVATE>
Expand Down
2 changes: 1 addition & 1 deletion basis/compiler/cfg/alias-analysis/alias-analysis.factor
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ERROR: vreg-not-new vreg ;

:: set-ac ( vreg ac -- )
#! Set alias class of newly-seen vreg.
vreg vregs>acs get key? [ vreg throw-vreg-not-new ] when
vreg vregs>acs get key? [ vreg vreg-not-new ] when
ac vreg vregs>acs get set-at
vreg ac ac>vregs push ;

Expand Down
2 changes: 1 addition & 1 deletion basis/compiler/cfg/checker/checker.factor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ERROR: bad-successors ;

: check-successors ( bb -- )
dup successors>> [ predecessors>> member-eq? ] with all?
[ throw-bad-successors ] unless ;
[ bad-successors ] unless ;

: check-cfg ( cfg -- )
[ check-successors ] each-basic-block ;
2 changes: 1 addition & 1 deletion basis/compiler/cfg/intrinsics/intrinsics.factor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ERROR: inline-intrinsics-not-supported word quot ;

: enable-intrinsics ( alist -- )
[
over inline? [ throw-inline-intrinsics-not-supported ] when
over inline? [ inline-intrinsics-not-supported ] when
"intrinsic" set-word-prop
] assoc-each ;

Expand Down
2 changes: 1 addition & 1 deletion basis/compiler/cfg/intrinsics/simd/backend/backend.factor
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ MACRO: if-literals-match ( quots -- quot )
! node literals quot
[ _ firstn ] dip call
drop
] [ 2drop throw-bad-simd-intrinsic ] if
] [ 2drop bad-simd-intrinsic ] if
] ;

CONSTANT: [unary] [ ds-drop ds-pop ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ERROR: bad-live-ranges interval ;
: check-ranges ( live-interval -- )
check-allocation? get [
dup ranges>> [ [ from>> ] [ to>> ] bi <= ] all?
[ drop ] [ throw-bad-live-ranges ] if
[ drop ] [ bad-live-ranges ] if
] [ drop ] if ;

: trim-before-ranges ( live-interval -- )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ ERROR: splitting-atomic-interval ;

: check-split ( live-interval n -- )
check-allocation? get [
[ [ start>> ] dip > [ throw-splitting-too-early ] when ]
[ [ end>> ] dip < [ throw-splitting-too-late ] when ]
[ [ start>> ] dip > [ splitting-too-early ] when ]
[ [ end>> ] dip < [ splitting-too-late ] when ]
[
drop [ end>> ] [ start>> ] bi =
[ throw-splitting-atomic-interval ] when
[ splitting-atomic-interval ] when
] 2tri
] [ 2drop ] if ; inline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ERROR: register-already-used live-interval ;
: check-activate ( live-interval -- )
check-allocation? get [
dup [ reg>> ] [ active-intervals-for [ reg>> ] map ] bi member?
[ throw-register-already-used ] [ drop ] if
[ register-already-used ] [ drop ] if
] [ drop ] if ;

: activate ( n live-interval -- keep? )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ERROR: not-spilled-error vreg ;
: vreg>spill-slot ( vreg -- spill-slot )
dup vreg>reg dup spill-slot?
[ nip ]
[ drop leader throw-not-spilled-error ] if ;
[ drop leader not-spilled-error ] if ;

: vregs>regs ( vregs -- assoc )
[ dup vreg>reg ] H{ } map>assoc ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ M: hairy-clobber-insn compute-live-intervals* ( insn -- )
ERROR: bad-live-interval live-interval ;

: check-start ( live-interval -- )
dup start>> -1 = [ throw-bad-live-interval ] [ drop ] if ;
dup start>> -1 = [ bad-live-interval ] [ drop ] if ;

: finish-live-intervals ( live-intervals -- )
[
Expand Down
2 changes: 1 addition & 1 deletion basis/compiler/cfg/linear-scan/numbering/numbering.factor
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ERROR: bad-numbering bb ;

: check-block-numbering ( bb -- )
dup instructions>> [ insn#>> ] map sift [ <= ] monotonic?
[ drop ] [ throw-bad-numbering ] if ;
[ drop ] [ bad-numbering ] if ;

: check-numbering ( cfg -- )
check-numbering? get
Expand Down
Loading

0 comments on commit ceb7505

Please sign in to comment.