diff --git a/core/cpu/ppc/ppc.factor b/core/cpu/ppc/ppc.factor index 901b339d7e..75de49acda 100755 --- a/core/cpu/ppc/ppc.factor +++ b/core/cpu/ppc/ppc.factor @@ -13,3 +13,7 @@ namespaces alien.c-types kernel system combinators ; } cond T{ ppc-backend } compiler-backend set-global + +macosx? [ + 4 "double" c-type set-c-type-align +] when diff --git a/core/cpu/x86/32/32.factor b/core/cpu/x86/32/32.factor index 4ed186d769..ecae55e69a 100755 --- a/core/cpu/x86/32/32.factor +++ b/core/cpu/x86/32/32.factor @@ -261,9 +261,9 @@ windows? [ cell "ulonglong" c-type set-c-type-align ] unless -macosx? [ - cell "double" c-type set-c-type-align -] when +windows? [ + 4 "double" c-type set-c-type-align +] unless T{ x86-backend f 4 } compiler-backend set-global diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 50ae55f506..5e8a5630b2 100755 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -155,20 +155,21 @@ SYMBOL: load-help? dup first vocab-heading. dup second print-error drop ; - ! third "Traceback" swap write-object ; : load-failures. ( failures -- ) [ load-error. nl ] each ; +SYMBOL: blacklist + : require-all ( vocabs -- failures ) [ + V{ } clone blacklist set [ - [ - [ require ] - [ error-continuation get 3array , ] - recover - ] each - ] { } make + [ require ] + [ >r vocab-name r> 2array blacklist get push ] + recover + ] each + blacklist get ] with-compiler-errors ; : do-refresh ( modified-sources modified-docs -- ) @@ -182,7 +183,7 @@ SYMBOL: load-help? : refresh-all ( -- ) "" refresh ; GENERIC: (load-vocab) ( name -- vocab ) - +! M: vocab (load-vocab) dup vocab-root [ dup vocab-source-loaded? [ dup load-source ] unless @@ -195,8 +196,25 @@ M: string (load-vocab) M: vocab-link (load-vocab) vocab-name (load-vocab) ; -[ [ dup vocab [ ] [ ] ?if (load-vocab) ] with-compiler-errors ] -load-vocab-hook set-global +TUPLE: blacklisted-vocab name ; + +: blacklisted-vocab ( name -- * ) + \ blacklisted-vocab construct-boa throw ; + +M: blacklisted-vocab error. + "This vocabulary depends on the " write + blacklisted-vocab-name write + " vocabulary which failed to load" print ; + +[ + dup vocab-name blacklist get key? [ + vocab-name blacklisted-vocab + ] [ + [ + dup vocab [ ] [ ] ?if (load-vocab) + ] with-compiler-errors + ] if +] load-vocab-hook set-global : vocab-where ( vocab -- loc ) vocab-source-path dup [ 1 2array ] when ; diff --git a/extra/money/money.factor b/extra/money/money.factor index d742a3be5a..4058ee9e6a 100644 --- a/extra/money/money.factor +++ b/extra/money/money.factor @@ -12,18 +12,21 @@ IN: money "$" % swap number>string 3 group "," join % - "." % number>string 2 48 pad-left % + "." % number>string 2 CHAR: 0 pad-left % ] "" make print ; TUPLE: not-a-decimal ; -: DECIMAL: - scan - "." split dup length 1 2 between? [ - T{ not-a-decimal } throw - ] unless - ?first2 - >r dup ?first CHAR: - = [ drop t "0" ] [ f swap ] if r> + +: not-a-decimal ( -- * ) + T{ not-a-decimal } throw ; + +: parse-decimal ( str -- ratio ) + "." split1 + >r dup "-" head? [ drop t "0" ] [ f swap ] if r> [ dup empty? [ drop "0" ] when ] 2apply dup length - >r [ string>number dup [ T{ not-a-decimal } throw ] unless ] 2apply r> - 10 swap ^ / + swap [ neg ] when parsed ; parsing + >r [ string>number dup [ not-a-decimal ] unless ] 2apply r> + 10 swap ^ / + swap [ neg ] when ; + +: DECIMAL: + scan parse-decimal parsed ; parsing diff --git a/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand b/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand deleted file mode 100644 index 37867a2737..0000000000 --- a/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand +++ /dev/null @@ -1,27 +0,0 @@ - - - - - beforeRunningCommand - nop - command - #!/usr/bin/env ruby - -require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" -puts factor_eval(STDIN.read) - fallbackInput - line - input - selection - keyEquivalent - ^E - name - Eval Selection/Line - output - replaceSelectedText - scope - source.factor - uuid - 8E01DDAF-959B-4237-ADB9-C133A4ACCE90 - - diff --git a/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand b/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand deleted file mode 100644 index 5028bd8db3..0000000000 --- a/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand +++ /dev/null @@ -1,27 +0,0 @@ - - - - - beforeRunningCommand - nop - command - #!/usr/bin/env ruby - -require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" -factor_run(STDIN.read) - fallbackInput - line - input - selection - keyEquivalent - ^~e - name - Run Selection/Line in Listener - output - discard - scope - source.factor - uuid - 15A984BD-BC65-43E8-878A-267788C8DA70 - -