diff --git a/core/alien/alien-tests.factor b/core/alien/alien-tests.factor index ca475bf80a..aedad25906 100644 --- a/core/alien/alien-tests.factor +++ b/core/alien/alien-tests.factor @@ -64,3 +64,7 @@ cell 8 = [ [ 0 B{ 1 2 3 } alien-address ] unit-test-fails [ 1 1 ] unit-test-fails + +[ f ] [ 0 B{ 1 2 3 } pinned-c-ptr? ] unit-test + +[ "( displaced alien )" ] [ 0 B{ 1 2 3 } unparse ] unit-test diff --git a/core/alien/alien.factor b/core/alien/alien.factor index 564efd72df..32157dcb90 100644 --- a/core/alien/alien.factor +++ b/core/alien/alien.factor @@ -18,7 +18,7 @@ PREDICATE: alien pinned-alien underlying-alien pinned-c-ptr? ; UNION: pinned-c-ptr - alien POSTPONE: f ; + pinned-alien POSTPONE: f ; UNION: c-ptr alien bit-array byte-array float-array POSTPONE: f ; diff --git a/core/alien/c-types/c-types-tests.factor b/core/alien/c-types/c-types-tests.factor index ee2d8b309b..c988446e20 100644 --- a/core/alien/c-types/c-types-tests.factor +++ b/core/alien/c-types/c-types-tests.factor @@ -68,3 +68,7 @@ TYPEDEF: int* MyIntArray TYPEDEF: uchar* MyLPBYTE [ t ] [ "char*" c-type "MyLPBYTE" c-type eq? ] unit-test + +[ + 0 B{ 1 2 3 4 } +] unit-test-fails diff --git a/core/alien/syntax/syntax.factor b/core/alien/syntax/syntax.factor index d204390d00..ed1520e9a1 100644 --- a/core/alien/syntax/syntax.factor +++ b/core/alien/syntax/syntax.factor @@ -3,7 +3,7 @@ USING: arrays alien alien.c-types alien.structs kernel math namespaces parser sequences words quotations math.parser splitting effects prettyprint prettyprint.sections -prettyprint.backend assocs ; +prettyprint.backend assocs combinators ; IN: alien.syntax parsing M: alien pprint* - dup expired? [ - drop "( alien expired )" text - ] [ - \ ALIEN: [ alien-address pprint* ] pprint-prefix - ] if ; + { + { [ dup expired? ] [ drop "( alien expired )" text ] } + { [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] } + { [ t ] [ \ ALIEN: [ alien-address pprint* ] pprint-prefix ] } + } cond ; M: dll pprint* dll-path dup "DLL\" " pprint-string ; diff --git a/core/vocabs/loader/loader-docs.factor b/core/vocabs/loader/loader-docs.factor index 160177cdf6..d4ef697a15 100644 --- a/core/vocabs/loader/loader-docs.factor +++ b/core/vocabs/loader/loader-docs.factor @@ -120,10 +120,6 @@ HELP: vocab-tests-path { $values { "vocab" "a vocabulary specifier" } { "path/f" "a pathname string or " { $link f } } } { $description "Outputs a pathname where the unit tests for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ; -HELP: (refresh) -{ $values { "prefix" string } { "seq" "a sequence of strings" } } -{ $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk. Also outputs a sequence of reloaded vocabularies." } ; - HELP: refresh { $values { "prefix" string } } { $description "Reloads source files and documentation belonging to loaded vocabularies whose names are prefixed by " { $snippet "prefix" } " which have been modified on disk." } ; @@ -131,7 +127,7 @@ HELP: refresh HELP: refresh-all { $description "Reloads source files and documentation for all loaded vocabularies which have been modified on disk." } ; -{ refresh (refresh) refresh-all } related-words +{ refresh refresh-all } related-words HELP: vocab-file-contents { $values { "vocab" "a vocabulary specifier" } { "name" string } { "seq" "a sequence of lines, or " { $link f } } } diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 48ff041b6c..e9dc4f3e55 100644 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -119,9 +119,10 @@ SYMBOL: load-help? "To define one, refer to \\ MAIN: help" print ] ?if ; -: modified ( assoc -- seq ) - [ nip dup [ source-modified? ] when ] assoc-subset - keys ; +: modified ( seq quot -- seq ) + [ dup ] swap compose { } map>assoc + [ nip ] assoc-subset + [ nip source-modified? ] assoc-subset keys ; inline : vocab-path+ ( vocab path -- newpath ) swap vocab-root dup [ swap path+ ] [ 2drop f ] if ; @@ -136,19 +137,26 @@ SYMBOL: load-help? dup vocab-docs vocab-path+ ; : modified-sources ( vocabs -- seq ) - [ dup vocab-source-path ] { } map>assoc modified ; + [ vocab-source-path ] modified ; : modified-docs ( vocabs -- seq ) - [ dup vocab-docs-path ] { } map>assoc modified ; + [ vocab-docs-path ] modified ; -: (refresh) ( prefix -- seq ) +: update-roots ( vocabs -- ) + [ dup find-vocab-root swap vocab set-vocab-root ] each ; + +: to-refresh ( prefix -- seq ) child-vocabs - dup modified-sources swap modified-docs 2dup + dup update-roots + dup modified-sources swap modified-docs ; + +: do-refresh ( modified-sources modified-docs -- ) + 2dup [ f swap set-vocab-docs-loaded? ] each [ f swap set-vocab-source-loaded? ] each - append prune dup [ [ require ] each ] no-parse-hook ; + append prune [ [ require ] each ] no-parse-hook ; -: refresh ( prefix -- ) (refresh) drop ; +: refresh ( prefix -- ) to-refresh do-refresh ; : refresh-all ( -- ) "" refresh ; diff --git a/core/bootstrap/help/authors.txt b/extra/bootstrap/help/authors.txt similarity index 100% rename from core/bootstrap/help/authors.txt rename to extra/bootstrap/help/authors.txt diff --git a/core/bootstrap/help/help.factor b/extra/bootstrap/help/help.factor similarity index 100% rename from core/bootstrap/help/help.factor rename to extra/bootstrap/help/help.factor diff --git a/core/bootstrap/help/summary.txt b/extra/bootstrap/help/summary.txt similarity index 100% rename from core/bootstrap/help/summary.txt rename to extra/bootstrap/help/summary.txt diff --git a/core/bootstrap/io/authors.txt b/extra/bootstrap/io/authors.txt similarity index 100% rename from core/bootstrap/io/authors.txt rename to extra/bootstrap/io/authors.txt diff --git a/core/bootstrap/io/io.factor b/extra/bootstrap/io/io.factor similarity index 100% rename from core/bootstrap/io/io.factor rename to extra/bootstrap/io/io.factor diff --git a/core/bootstrap/io/summary.txt b/extra/bootstrap/io/summary.txt similarity index 100% rename from core/bootstrap/io/summary.txt rename to extra/bootstrap/io/summary.txt diff --git a/core/bootstrap/math/math.factor b/extra/bootstrap/math/math.factor similarity index 100% rename from core/bootstrap/math/math.factor rename to extra/bootstrap/math/math.factor diff --git a/core/bootstrap/math/summary.txt b/extra/bootstrap/math/summary.txt similarity index 100% rename from core/bootstrap/math/summary.txt rename to extra/bootstrap/math/summary.txt diff --git a/core/bootstrap/tools/authors.txt b/extra/bootstrap/tools/authors.txt similarity index 100% rename from core/bootstrap/tools/authors.txt rename to extra/bootstrap/tools/authors.txt diff --git a/core/bootstrap/tools/summary.txt b/extra/bootstrap/tools/summary.txt similarity index 100% rename from core/bootstrap/tools/summary.txt rename to extra/bootstrap/tools/summary.txt diff --git a/core/bootstrap/tools/tools.factor b/extra/bootstrap/tools/tools.factor similarity index 100% rename from core/bootstrap/tools/tools.factor rename to extra/bootstrap/tools/tools.factor diff --git a/core/bootstrap/ui/authors.txt b/extra/bootstrap/ui/authors.txt similarity index 100% rename from core/bootstrap/ui/authors.txt rename to extra/bootstrap/ui/authors.txt diff --git a/core/bootstrap/ui/summary.txt b/extra/bootstrap/ui/summary.txt similarity index 100% rename from core/bootstrap/ui/summary.txt rename to extra/bootstrap/ui/summary.txt diff --git a/core/bootstrap/ui/tools/authors.txt b/extra/bootstrap/ui/tools/authors.txt similarity index 100% rename from core/bootstrap/ui/tools/authors.txt rename to extra/bootstrap/ui/tools/authors.txt diff --git a/core/bootstrap/ui/tools/summary.txt b/extra/bootstrap/ui/tools/summary.txt similarity index 100% rename from core/bootstrap/ui/tools/summary.txt rename to extra/bootstrap/ui/tools/summary.txt diff --git a/core/bootstrap/ui/tools/tools.factor b/extra/bootstrap/ui/tools/tools.factor similarity index 100% rename from core/bootstrap/ui/tools/tools.factor rename to extra/bootstrap/ui/tools/tools.factor diff --git a/core/bootstrap/ui/ui.factor b/extra/bootstrap/ui/ui.factor similarity index 100% rename from core/bootstrap/ui/ui.factor rename to extra/bootstrap/ui/ui.factor diff --git a/extra/tools/test/test.factor b/extra/tools/test/test.factor index bc9dd0ffeb..88f94a7fd6 100644 --- a/extra/tools/test/test.factor +++ b/extra/tools/test/test.factor @@ -76,4 +76,5 @@ TUPLE: expected-error ; : test-all ( -- ) "" test ; -: test-changes ( -- ) "" (refresh) run-vocab-tests ; +: test-changes ( -- ) + "" to-refresh dupd do-refresh run-vocab-tests ; diff --git a/vm/os-linux-arm.c b/vm/os-linux-arm.c index 217fb58fa7..39a3da0b3f 100644 --- a/vm/os-linux-arm.c +++ b/vm/os-linux-arm.c @@ -8,6 +8,9 @@ void flush_icache(CELL start, CELL len) identically to the below assembly. */ /* result = syscall(__ARM_NR_cacheflush,start,start + len,0); */ + /* Assembly swiped from + http://lists.arm.linux.org.uk/pipermail/linux-arm/2002-July/003931.html + */ __asm__ __volatile__ ( "mov r0, %1\n" "sub r1, %2, #1\n"