diff --git a/basis/checksums/md5/md5.factor b/basis/checksums/md5/md5.factor index c74aa550d2..d59976fb7e 100644 --- a/basis/checksums/md5/md5.factor +++ b/basis/checksums/md5/md5.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2006, 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel io io.binary io.files io.streams.byte-array math +USING: alien.c-types kernel io io.binary io.files io.streams.byte-array math math.functions math.parser namespaces splitting grouping strings sequences byte-arrays locals sequences.private macros fry io.encodings.binary math.bitwise checksums accessors @@ -173,9 +173,27 @@ HINTS: (process-md5-block-G) { uint-array md5-state } ; HINTS: (process-md5-block-H) { uint-array md5-state } ; HINTS: (process-md5-block-I) { uint-array md5-state } ; +: byte-array>le ( byte-array -- byte-array ) + little-endian? [ + dup 4 [ + [ [ 1 2 ] dip exchange-unsafe ] + [ [ 0 3 ] dip exchange-unsafe ] bi + ] each + ] unless ; + +: byte-array>uint-array-le ( byte-array -- uint-array ) + byte-array>le byte-array>uint-array ; + +HINTS: byte-array>uint-array-le byte-array ; + +: uint-array>byte-array-le ( uint-array -- byte-array ) + underlying>> byte-array>le ; + +HINTS: uint-array>byte-array-le uint-array ; + M: md5-state checksum-block ( block state -- ) [ - [ byte-array>uint-array ] [ state>> ] bi* { + [ byte-array>uint-array-le ] [ state>> ] bi* { [ (process-md5-block-F) ] [ (process-md5-block-G) ] [ (process-md5-block-H) ] @@ -185,7 +203,7 @@ M: md5-state checksum-block ( block state -- ) nip update-md5 ] 2bi ; -: md5>checksum ( md5 -- bytes ) state>> underlying>> ; +: md5>checksum ( md5 -- bytes ) state>> uint-array>byte-array-le ; M: md5-state clone ( md5 -- new-md5 ) call-next-method diff --git a/basis/io/monitors/monitors-docs.factor b/basis/io/monitors/monitors-docs.factor index f0278e300e..c5f266de56 100644 --- a/basis/io/monitors/monitors-docs.factor +++ b/basis/io/monitors/monitors-docs.factor @@ -112,10 +112,10 @@ $nl { $code "USE: io.monitors" ": watch-loop ( monitor -- )" - " dup next-change . nl nl flush watch-loop ;" + " dup next-change path>> print nl nl flush watch-loop ;" "" ": watch-directory ( path -- )" - " [ t [ watch-loop ] with-monitor ] with-monitors" + " [ t [ watch-loop ] with-monitor ] with-monitors ;" } ; ABOUT: "io.monitors" diff --git a/basis/io/monitors/monitors.factor b/basis/io/monitors/monitors.factor index 7d40a1563a..cc8cea37d2 100644 --- a/basis/io/monitors/monitors.factor +++ b/basis/io/monitors/monitors.factor @@ -60,9 +60,6 @@ SYMBOL: +rename-file+ : run-monitor ( path recursive? quot -- ) '[ [ @ t ] loop ] with-monitor ; inline -: spawn-monitor ( path recursive? quot -- ) - [ '[ _ _ _ run-monitor ] ] [ 2drop "Monitoring " prepend ] 3bi - spawn drop ; { { [ os macosx? ] [ "io.monitors.macosx" require ] } { [ os linux? ] [ "io.monitors.linux" require ] } diff --git a/basis/random/windows/windows.factor b/basis/random/windows/windows.factor index 6dce078d67..83b1fab0d0 100644 --- a/basis/random/windows/windows.factor +++ b/basis/random/windows/windows.factor @@ -1,7 +1,7 @@ USING: accessors alien.c-types byte-arrays combinators.short-circuit continuations destructors init kernel locals namespaces random windows.advapi32 windows.errors -windows.kernel32 ; +windows.kernel32 math.bitwise ; IN: random.windows TUPLE: windows-rng provider type ; @@ -25,7 +25,8 @@ CONSTANT: factor-crypto-container "FactorCryptoContainer" CryptAcquireContextW handle swap ; : acquire-crypto-context ( provider type -- handle ) - 0 (acquire-crypto-context) + CRYPT_MACHINE_KEYSET + (acquire-crypto-context) 0 = [ GetLastError NTE_BAD_KEYSET = [ drop f ] [ win32-error-string throw ] if @@ -34,7 +35,8 @@ CONSTANT: factor-crypto-container "FactorCryptoContainer" ] if ; : create-crypto-context ( provider type -- handle ) - CRYPT_NEWKEYSET (acquire-crypto-context) win32-error=0/f *void* ; + { CRYPT_MACHINE_KEYSET CRYPT_NEWKEYSET } flags + (acquire-crypto-context) win32-error=0/f *void* ; ERROR: acquire-crypto-context-failed provider type ; diff --git a/basis/tuple-arrays/tuple-arrays-docs.factor b/basis/tuple-arrays/tuple-arrays-docs.factor new file mode 100644 index 0000000000..cedf900698 --- /dev/null +++ b/basis/tuple-arrays/tuple-arrays-docs.factor @@ -0,0 +1,25 @@ +IN: tuple-arrays +USING: help.markup help.syntax sequences ; + +HELP: TUPLE-ARRAY: +{ $syntax "TUPLE-ARRAY: class" } +{ $description "Generates a new data type in the current vocabulary named " { $snippet { $emphasis "class" } "-array" } " for holding instances of " { $snippet "class" } ", which must be a tuple class word. Together with the class itself, this also generates words named " { $snippet "<" { $emphasis "class" } "-array>" } " and " { $snippet ">" { $emphasis "class" } "-array" } ", for creating new instances of this tuple array type." } ; + +ARTICLE: "tuple-arrays" "Tuple arrays" +"The " { $vocab-link "tuple-arrays" } " vocabulary implements space-efficient unboxed tuple arrays. Whereas an ordinary array of tuples would consist of pointers to heap-allocated objects, a tuple array stores its elements inline. Calling " { $link nth } " copies an element into a new tuple, and calling " { $link set-nth } " copies an existing tuple's slots into an array." +$nl +"Since value semantics differ from reference semantics, it is best to use tuple arrays with tuples where all slots are declared " { $link read-only } "." +$nl +"Tuple arrays should not be used with inheritance; storing an instance of a subclass in a tuple array will slice off the subclass slots, and getting the same value out again will yield an instance of the superclass. Also, tuple arrays do not get updated if tuples are redefined to add or remove slots, so caution should be exercised when doing interactive development on code that uses tuple arrays." +{ $subsection POSTPONE: TUPLE-ARRAY: } +"An example:" +{ $example + "USE: tuple-arrays" + "IN: scratchpad" + "TUPLE: point x y ;" + "TUPLE-ARRAY: point" + "{ T{ point f 1 2 } T{ point f 1 3 } T{ point f 2 3 } } >point-array first short." + "T{ point f 1 2 }" +} ; + +ABOUT: "tuple-arrays" \ No newline at end of file diff --git a/basis/tuple-arrays/tuple-arrays.factor b/basis/tuple-arrays/tuple-arrays.factor index 35d771416c..761dbd816a 100644 --- a/basis/tuple-arrays/tuple-arrays.factor +++ b/basis/tuple-arrays/tuple-arrays.factor @@ -21,7 +21,7 @@ MACRO: infer-in ( class -- quot ) infer in>> '[ _ ] ; [ new ] [ smart-tuple>array ] bi ; inline : tuple-slice ( n seq -- slice ) - [ n>> [ * dup ] keep + ] [ seq>> ] bi { array } declare slice boa ; inline + [ n>> [ * dup ] keep + ] [ seq>> ] bi slice boa ; inline : read-tuple ( slice class -- tuple ) '[ _ boa-unsafe ] input x ; [ "USE: kernel UNUSE: kernel dup" "unuse-test" parse-stream -] [ error>> error>> error>> no-word-error? ] must-fail-with \ No newline at end of file +] [ error>> error>> error>> no-word-error? ] must-fail-with + +[ ] [ [ "vocabs.loader.test.l" forget-vocab ] with-compilation-unit ] unit-test + +[ + [ "vocabs.loader.test.l" use-vocab ] must-fail + [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> key? ] unit-test + [ ] [ "vocabs.loader.test.l" unuse-vocab ] unit-test + [ f ] [ "vocabs.loader.test.l" manifest get search-vocab-names>> key? ] unit-test +] with-file-vocabs diff --git a/core/vocabs/loader/test/l/l.factor b/core/vocabs/loader/test/l/l.factor new file mode 100644 index 0000000000..10cd35dff2 --- /dev/null +++ b/core/vocabs/loader/test/l/l.factor @@ -0,0 +1,4 @@ +IN: vocabs.loader.test.l +USE: kernel + +"Oops" throw \ No newline at end of file diff --git a/core/vocabs/loader/test/l/tags.txt b/core/vocabs/loader/test/l/tags.txt new file mode 100644 index 0000000000..6bf68304bb --- /dev/null +++ b/core/vocabs/loader/test/l/tags.txt @@ -0,0 +1 @@ +unportable diff --git a/core/vocabs/parser/parser.factor b/core/vocabs/parser/parser.factor index 45084ae8ff..ff55f8e68d 100644 --- a/core/vocabs/parser/parser.factor +++ b/core/vocabs/parser/parser.factor @@ -108,8 +108,8 @@ TUPLE: no-current-vocab ; dup using-vocab? [ vocab-name "Already using ``" "'' vocabulary" surround note. ] [ manifest get - [ [ vocab-name ] dip search-vocab-names>> conjoin ] [ [ load-vocab ] dip search-vocabs>> push ] + [ [ vocab-name ] dip search-vocab-names>> conjoin ] 2bi ] if ; @@ -121,8 +121,8 @@ TUPLE: no-current-vocab ; : unuse-vocab ( vocab -- ) dup using-vocab? [ manifest get - [ [ vocab-name ] dip search-vocab-names>> delete-at ] [ [ load-vocab ] dip search-vocabs>> delq ] + [ [ vocab-name ] dip search-vocab-names>> delete-at ] 2bi ] [ drop ] if ; diff --git a/extra/webapps/mason/download.xml b/extra/webapps/mason/download.xml index af4ac0214d..7e50f958cd 100644 --- a/extra/webapps/mason/download.xml +++ b/extra/webapps/mason/download.xml @@ -1,12 +1,18 @@ + + - + + Factor binary package for <t:label t:name="platform" /> +
Logo
+

Factor binary package for

Requirements:

diff --git a/extra/webapps/mason/mason.factor b/extra/webapps/mason/mason.factor index 4d42617520..f7aadb9a54 100644 --- a/extra/webapps/mason/mason.factor +++ b/extra/webapps/mason/mason.factor @@ -15,18 +15,19 @@ TUPLE: mason-app < dispatcher ; : download-link ( builder label -- xml ) [ - [ URL" download" ] dip + [ URL" http://builds.factorcode.org/download" ] dip [ os>> "os" set-query-param ] [ cpu>> "cpu" set-query-param ] bi ] dip link ; : download-grid-cell ( cpu os -- xml ) - builder new swap >>os swap >>cpu select-tuple dup - [ + builder new swap >>os swap >>cpu select-tuple [ dup last-release>> dup [ "." split1 drop 16 tail* 6 head* download-link ] [ 2drop f ] if - ] when - [XML <-> XML] ; + [XML
<->
XML] + ] [ + [XML XML] + ] if* ; CONSTANT: oses { @@ -47,22 +48,26 @@ CONSTANT: cpus : download-grid ( -- xml ) oses - [ values [ [XML <-> XML] ] map ] + [ values [ [XML <-> XML] ] map ] [ keys cpus [ [ nip second ] [ first ] 2bi [ swap download-grid-cell - ] curry map [XML <-><-> XML] + ] curry map + [XML <-><-> XML] ] with map - ] bi [XML <->
<->
XML] ; + ] bi + [XML + + <-> + <-> +
OS/CPU
+ XML] ; : ( -- action ) - [ - download-grid - xml>string "text/html" - ] >>display ; + [ download-grid xml>string "text/html" ] >>display ; : validate-os/cpu ( -- ) { @@ -132,16 +137,16 @@ CONSTANT: cpus os>> { { "winnt" "Windows XP (also tested on Vista)" } { "macosx" "Mac OS X 10.5 Leopard" } - { "linux" "Linux 2.6.16 with GLIBC 2.4" } + { "linux" "Ubuntu Linux 9.04 (other distributions may also work)" } { "freebsd" "FreeBSD 7.0" } { "netbsd" "NetBSD 4.0" } - { "openbsd" "OpenBSD 4.2" } + { "openbsd" "OpenBSD 4.4" } } at ] [ dup cpu>> "x86.32" = [ os>> { - { [ dup { "winnt" "linux" } member? ] [ drop "Intel Pentium 4, Core Duo, or other x86 chip with SSE2 support. Note that 32-bit Athlon XP processors do not support SSE2." ] } - { [ dup { "freebsd" "netbsd" "openbsd" } member? ] [ drop "Intel Pentium Pro or better" ] } + { [ dup { "winnt" "linux" "freebsd" } member? ] [ drop "Intel Pentium 4, Core Duo, or other x86 chip with SSE2 support. Note that 32-bit Athlon XP processors do not support SSE2." ] } + { [ dup { "netbsd" "openbsd" } member? ] [ drop "Intel Pentium Pro or better" ] } { [ t ] [ drop f ] } } cond ] [ drop f ] if diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index d7b132d4f2..207ae9ab34 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -23,7 +23,8 @@ webapps.pastebin webapps.planet webapps.wiki webapps.user-admin -webapps.help ; +webapps.help +webapps.mason ; IN: websites.concatenative : test-db ( -- db ) "resource:test.db" ; @@ -95,6 +96,7 @@ SYMBOL: dh-file test-db "planet.factorcode.org" add-responder home "docs" append-path test-db "docs.factorcode.org" add-responder home "cgi" append-path "gitweb.factorcode.org" add-responder + "builds.factorcode.org" add-responder main-responder set-global ; : ( -- config )