diff --git a/basis/english/authors.txt b/basis/english/authors.txt index 4a2a0fd9d7..010c37eb3d 100644 --- a/basis/english/authors.txt +++ b/basis/english/authors.txt @@ -1,2 +1,2 @@ John Benediktsson -Cat Stevens \ No newline at end of file +Cat Stevens diff --git a/basis/furnace/auth/auth-docs.factor b/basis/furnace/auth/auth-docs.factor index a05dd3c605..c6dbf6e419 100644 --- a/basis/furnace/auth/auth-docs.factor +++ b/basis/furnace/auth/auth-docs.factor @@ -1,14 +1,6 @@ USING: byte-arrays checksums.sha furnace.auth.providers furnace.auth.providers.db help.markup help.syntax http kernel math strings vocabs words.symbol ; -"furnace.auth.basic" require -"furnace.auth.features.deactivate-user" require -"furnace.auth.features.edit-profile" require -"furnace.auth.features.recover-password" require -"furnace.auth.features.registration" require -"furnace.auth.login" require -"furnace.auth.providers.assoc" require -"furnace.auth.providers.null" require IN: furnace.auth HELP: diff --git a/basis/io/encodings/euc-kr/summary.txt b/basis/io/encodings/euc-kr/summary.txt index 1802f177ba..9fe8bb3cf3 100644 --- a/basis/io/encodings/euc-kr/summary.txt +++ b/basis/io/encodings/euc-kr/summary.txt @@ -1 +1 @@ -Korean text encodings \ No newline at end of file +Korean text encodings diff --git a/basis/io/standard-paths/windows/platforms.txt b/basis/io/standard-paths/windows/platforms.txt index d493d3459b..8e1a55995e 100644 --- a/basis/io/standard-paths/windows/platforms.txt +++ b/basis/io/standard-paths/windows/platforms.txt @@ -1 +1 @@ -windows \ No newline at end of file +windows diff --git a/basis/opengl/capabilities/summary.txt b/basis/opengl/capabilities/summary.txt index d31b63b8d4..ff26ccddaa 100644 --- a/basis/opengl/capabilities/summary.txt +++ b/basis/opengl/capabilities/summary.txt @@ -1 +1 @@ -Testing for OpenGL versions and extensions \ No newline at end of file +Testing for OpenGL versions and extensions diff --git a/basis/opengl/framebuffers/summary.txt b/basis/opengl/framebuffers/summary.txt index 3ef713ac13..1cf4e169f0 100644 --- a/basis/opengl/framebuffers/summary.txt +++ b/basis/opengl/framebuffers/summary.txt @@ -1 +1 @@ -Rendering to offscreen textures using the GL_EXT_framebuffer_object extension \ No newline at end of file +Rendering to offscreen textures using the GL_EXT_framebuffer_object extension diff --git a/basis/opengl/shaders/summary.txt b/basis/opengl/shaders/summary.txt index c55f76668f..6c5813d290 100644 --- a/basis/opengl/shaders/summary.txt +++ b/basis/opengl/shaders/summary.txt @@ -1 +1 @@ -OpenGL Shading Language (GLSL) support \ No newline at end of file +OpenGL Shading Language (GLSL) support diff --git a/basis/ui/backend/cocoa/views/views.factor b/basis/ui/backend/cocoa/views/views.factor index a6bdcf8239..82cf7b8525 100644 --- a/basis/ui/backend/cocoa/views/views.factor +++ b/basis/ui/backend/cocoa/views/views.factor @@ -198,6 +198,7 @@ M: send-touchbar-command send-queued-gesture cached-lines get-global clear-assoc ] [ drop ] if + self -> update ] when ] ; diff --git a/basis/windows/ddk/hid/summary.txt b/basis/windows/ddk/hid/summary.txt index 71ad299177..569fa1b120 100644 --- a/basis/windows/ddk/hid/summary.txt +++ b/basis/windows/ddk/hid/summary.txt @@ -1 +1 @@ -Bindings to the HID section of the Windows DDK \ No newline at end of file +Bindings to the HID section of the Windows DDK diff --git a/basis/windows/handles/platforms.txt b/basis/windows/handles/platforms.txt index d493d3459b..8e1a55995e 100644 --- a/basis/windows/handles/platforms.txt +++ b/basis/windows/handles/platforms.txt @@ -1 +1 @@ -windows \ No newline at end of file +windows diff --git a/basis/windows/surface-dial/platforms.txt b/basis/windows/surface-dial/platforms.txt index d493d3459b..8e1a55995e 100644 --- a/basis/windows/surface-dial/platforms.txt +++ b/basis/windows/surface-dial/platforms.txt @@ -1 +1 @@ -windows \ No newline at end of file +windows diff --git a/basis/xdg/xdg.factor b/basis/xdg/xdg.factor index 7f12a28de1..fd3093d0df 100644 --- a/basis/xdg/xdg.factor +++ b/basis/xdg/xdg.factor @@ -1,29 +1,29 @@ ! Copyright (C) 2015 John Benediktsson ! See http://factorcode.org/license.txt for BSD license -USING: environment memoize sequences splitting ; +USING: environment sequences splitting ; IN: xdg ! http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html -MEMO: xdg-data-home ( -- path ) +: xdg-data-home ( -- path ) "XDG_DATA_HOME" os-env [ "~/.local/share" ] when-empty ; -MEMO: xdg-config-home ( -- path ) +: xdg-config-home ( -- path ) "XDG_CONFIG_HOME" os-env [ "~/.config" ] when-empty ; -MEMO: xdg-cache-home ( -- path ) +: xdg-cache-home ( -- path ) "XDG_CACHE_HOME" os-env [ "~/.cache" ] when-empty ; -MEMO: xdg-data-dirs ( -- paths ) +: xdg-data-dirs ( -- paths ) "XDG_DATA_DIRS" os-env ":" split harvest [ { "/usr/local/share" "/usr/share" } ] when-empty ; -MEMO: xdg-config-dirs ( -- paths ) +: xdg-config-dirs ( -- paths ) "XDG_CONFIG_DIRS" os-env ":" split harvest [ { "/etc/xdg" } ] when-empty ; -MEMO: xdg-runtime-dir ( -- path/f ) +: xdg-runtime-dir ( -- path/f ) "XDG_RUNTIME_DIR" os-env ; ! TODO: check runtime secure permissions diff --git a/core/stack-checker/stack-checker-docs.factor b/core/stack-checker/stack-checker-docs.factor index 6919e69417..4ea0abc31c 100644 --- a/core/stack-checker/stack-checker-docs.factor +++ b/core/stack-checker/stack-checker-docs.factor @@ -20,7 +20,7 @@ ARTICLE: "inference-combinators" "Combinator stack effects" { "The combinator must be called with a quotation that is either literal or built from literal quotations, " { $link curry } ", and " { $link compose } ". (Note that quotations that use " { $vocab-link "fry" } " or " { $vocab-link "locals" } " use " { $link curry } " and " { $link compose } " from the perspective of the stack checker.)" } { "If the word is declared " { $link \ inline } ", the combinator may additionally be called on one of the word's input parameters or with quotations built from the word's input parameters, literal quotations, " { $link curry } ", and " { $link compose } ". When inline, a word is itself considered to be a combinator, and its callers must in turn satisfy these conditions." } } -"If neither condition holds, the stack checker throws a " { $link unknown-macro-input } " or " { $link bad-macro-input } " error. To make the code compile, a runtime checking combinator such as " { $link \ \call( } " must be used instead. See " { $link "inference-escape" } " for details. An inline combinator can be called with an unknown quotation by " { $link curry } "ing the quotation onto a literal quotation that uses " { $link \ \call( } "." +"If neither condition holds, the stack checker throws an " { $link unknown-macro-input } " or " { $link bad-macro-input } " error. To make the code compile, a runtime checking combinator such as " { $link \ \call( } " must be used instead. See " { $link "inference-escape" } " for details. An inline combinator can be called with an unknown quotation by " { $link curry } "ing the quotation onto a literal quotation that uses " { $link \ \call( } "." { $heading "Input stack effects" } "Inline combinators will verify the stack effect of their input quotations if they are declared in the combinator's stack effect. See " { $link "effects-variables" } " for details." { $heading "Examples" } @@ -61,7 +61,7 @@ $nl } ; ARTICLE: "inference-branches" "Branch stack effects" -"Conditionals such as " { $link if } " and combinators built on top have the same restrictions as " { $link \ inline } " combinators (see " { $link "inference-combinators" } ") with the additional requirement that all branches leave the stack at the same height. If this is not the case, the stack checker throws a " { $link unbalanced-branches-error } "." +"Conditionals such as " { $link if } " and combinators built on top have the same restrictions as " { $link \ inline } " combinators (see " { $link "inference-combinators" } ") with the additional requirement that all branches leave the stack at the same height. If this is not the case, the stack checker throws an " { $link unbalanced-branches-error } "." $nl "If all branches leave the stack at the same height, then the stack effect of the conditional is just the maximum of the stack effect of each branch. For example," { $example "[ [ + ] [ drop ] if ] infer." "( x x x -- x )" } @@ -72,7 +72,7 @@ ARTICLE: "inference-recursive-combinators" "Recursive combinator stack effects" $nl "Combinators which are recursive require additional care. In addition to being declared " { $link \ inline } ", they must be declared " { $link \ recursive } ". There are three restrictions that only apply to combinators with this declaration:" { $heading "Input quotation declaration" } -"Input parameters which are quotations must be annotated as much in the stack effect. For example, the following will not infer:" +"Input parameters which are quotations must be annotated as such in the stack effect. For example, the following will not infer:" { $unchecked-example ": bad ( quot -- ) [ call ] keep bad ; inline recursive" "[ [ ] bad ] infer." "Cannot apply “call” to a run-time computed value\nmacro call" } "The following is correct:" { $example ": good ( quot: ( -- ) -- ) [ call ] keep good ; inline recursive" "[ [ ] good ] infer." "( -- )" } diff --git a/extra/backtrack/summary.txt b/extra/backtrack/summary.txt index d2d3918a98..bbfe645305 100644 --- a/extra/backtrack/summary.txt +++ b/extra/backtrack/summary.txt @@ -1 +1 @@ -Simple non-determinism \ No newline at end of file +Simple non-determinism diff --git a/extra/cap/summary.txt b/extra/cap/summary.txt index 3246a88354..c0921ff1b1 100644 --- a/extra/cap/summary.txt +++ b/extra/cap/summary.txt @@ -1 +1 @@ -Creating and displaying screenshots of Factor \ No newline at end of file +Creating and displaying screenshots of Factor diff --git a/extra/compiler/cfg/graphviz/platforms.txt b/extra/compiler/cfg/graphviz/platforms.txt index 47e0a6946a..509143d863 100644 --- a/extra/compiler/cfg/graphviz/platforms.txt +++ b/extra/compiler/cfg/graphviz/platforms.txt @@ -1 +1 @@ -unix \ No newline at end of file +unix diff --git a/extra/compiler/cfg/gvn/testing/platforms.txt b/extra/compiler/cfg/gvn/testing/platforms.txt index 47e0a6946a..509143d863 100644 --- a/extra/compiler/cfg/gvn/testing/platforms.txt +++ b/extra/compiler/cfg/gvn/testing/platforms.txt @@ -1 +1 @@ -unix \ No newline at end of file +unix diff --git a/extra/curses/listener/authors.txt b/extra/curses/listener/authors.txt index 4f30515bbb..156a81af57 100644 --- a/extra/curses/listener/authors.txt +++ b/extra/curses/listener/authors.txt @@ -1 +1 @@ -Philipp Brüschweiler \ No newline at end of file +Philipp Brüschweiler diff --git a/extra/etc-hosts/etc-hosts.factor b/extra/etc-hosts/etc-hosts.factor index 6bdd6f8060..4e102bba1d 100644 --- a/extra/etc-hosts/etc-hosts.factor +++ b/extra/etc-hosts/etc-hosts.factor @@ -7,7 +7,7 @@ IN: etc-hosts HOOK: hosts-path os ( -- path ) M: windows hosts-path - "SystemRoot" os-env "/System32/drivers/etc/hosts" append-path ; + "SystemRoot" os-env "System32/drivers/etc/hosts" append-path ; M: unix hosts-path "/etc/hosts" ; diff --git a/extra/imap/imap.factor b/extra/imap/imap.factor index 892b94de44..048fce0464 100644 --- a/extra/imap/imap.factor +++ b/extra/imap/imap.factor @@ -1,8 +1,10 @@ -USING: accessors arrays assocs calendar calendar.english calendar.format -calendar.parser formatting fry grouping io io.crlf io.encodings.ascii -io.encodings.binary io.encodings.string io.encodings.utf7 io.encodings.utf8 -io.sockets io.sockets.secure io.streams.duplex io.streams.string kernel math -math.parser sequences splitting strings ; +USING: accessors arrays assocs calendar calendar.english +calendar.format calendar.parser formatting fry grouping io +io.crlf io.encodings.ascii io.encodings.binary +io.encodings.string io.encodings.utf7 io.encodings.utf8 +io.sockets io.sockets.secure io.streams.duplex io.streams.string +kernel math math.parser multiline pcre sequences +sequences.extras strings ; QUALIFIED: pcre IN: imap @@ -46,9 +48,9 @@ CONSTANT: IMAP4_SSL_PORT 993 : read-response-chunk ( stop-expr -- item ? ) read-?crlf ascii decode swap dupd pcre:findall [ - dup "^.*{(\\d+)}$" pcre:findall + dup [[ ^.*{(\d+)}$]] pcre:findall [ - dup "^\\* (\\d+) [A-Z-]+ (.*)$" pcre:findall + dup [[ ^\* (\d+) [A-Z-]+ (.*)$]] pcre:findall [ ] [ nip first third second ] if-empty ] [ @@ -61,7 +63,7 @@ CONSTANT: IMAP4_SSL_PORT 993 : read-response ( tag -- lines ) "^%s (BAD|NO|OK) (.*)$" sprintf - '[ _ read-response-chunk [ suffix ] dip ] { } swap loop + '[ _ read-response-chunk ] loop>array* unclip-last first2 [ check-status ] keep suffix ; : write-command ( command literal tag -- ) @@ -80,24 +82,24 @@ CONSTANT: IMAP4_SSL_PORT 993 first " " split 2 tail ; : parse-list-folders ( str -- folder ) - "\\* LIST \\(([^\\)]+)\\) \"([^\"]+)\" \"([^\"]+)\"" pcre:findall + [[ \* LIST \(([^\)]+)\) "([^"]+)" "?([^"]+)"?]] pcre:findall first rest values [ utf7imap4 decode ] map ; : parse-select-folder ( seq -- count ) - [ "\\* (\\d+) EXISTS" pcre:findall ] map harvest + [ [[ \* (\d+) EXISTS]] pcre:findall ] map harvest [ f ] [ first first last last string>number ] if-empty ; ! Returns uid if the server supports the UIDPLUS extension. : parse-append-mail ( seq -- uid/f ) - [ "\\[APPENDUID (\\d+) \\d+\\]" pcre:findall ] map harvest + [ [=[ \[APPENDUID (\d+) \d+\]]=] pcre:findall ] map harvest [ f ] [ first first last last string>number ] if-empty ; : parse-status ( seq -- assoc ) - first "\\* STATUS \"[^\"]+\" \\(([^\\)]+)\\)" pcre:findall first last last + first [[ \* STATUS "[^"]+" \(([^\)]+)\)]] pcre:findall first last last " " split 2 group [ string>number ] assoc-map ; : parse-store-mail-line ( str -- pair/f ) - "\\(FLAGS \\(([^\\)]+)\\) UID (\\d+)\\)" pcre:findall [ f ] [ + [[ \(FLAGS \(([^\)]+)\) UID (\d+)\)]] pcre:findall [ f ] [ first rest values first2 [ " " split ] dip string>number swap 2array ] if-empty ; @@ -124,6 +126,8 @@ PRIVATE> "LIST \"%s\" *" sprintf "" command-response but-last [ parse-list-folders ] map ; +: list-all-folders ( -- folders ) "" list-folders ; + : select-folder ( mailbox -- count ) >utf7imap4 "SELECT \"%s\"" sprintf "" command-response parse-select-folder ; @@ -168,7 +172,8 @@ PRIVATE> ] dip utf8 encode command-response parse-append-mail ; : store-mail ( uids command flags -- mail-flags ) - [ comma-list ] 2dip "UID STORE %s %s %s" sprintf "" command-response + [ comma-list ] 2dip "UID STORE %s %s %s" sprintf + "" command-response parse-store-mail ; ! High level API diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index 4a3c81803b..4a46207950 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -141,7 +141,11 @@ MEMO: glossary ( -- assoc ) : parse-timestamp ( str -- str' ) [ now [ year>> ] [ month>> ] bi ] dip 2 cut 2 cut 2 cut drop [ string>number ] tri@ - 0 instant timestamp>rfc822 ; + over 24 = [ + [ drop 0 ] dip 0 instant 1 days time+ + ] [ + 0 instant + ] if timestamp>rfc822 ; CONSTANT: compass-directions H{ { 0.0 "N" } diff --git a/extra/models/illusion/summary.txt b/extra/models/illusion/summary.txt index 8ea7cf1e7d..a1b4916c02 100644 --- a/extra/models/illusion/summary.txt +++ b/extra/models/illusion/summary.txt @@ -1 +1 @@ -Two Way Arrows \ No newline at end of file +Two Way Arrows diff --git a/extra/notifications/macos/authors.txt b/extra/notifications/macos/authors.txt new file mode 100644 index 0000000000..7c1b2f2279 --- /dev/null +++ b/extra/notifications/macos/authors.txt @@ -0,0 +1 @@ +Doug Coleman diff --git a/extra/notifications/macos/macos.factor b/extra/notifications/macos/macos.factor new file mode 100644 index 0000000000..a2345f7b87 --- /dev/null +++ b/extra/notifications/macos/macos.factor @@ -0,0 +1,19 @@ +! Copyright (C) 2018 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: cocoa cocoa.application cocoa.classes kernel locals ; +IN: notifications.macos + +IMPORT: NSUserNotification +IMPORT: NSUserNotificationCenter + +:: make-notification ( title text -- notification ) + NSUserNotification -> alloc -> init -> autorelease + [ title -> setTitle: ] keep + [ text -> setInformativeText: ] keep ; + +: send-notification ( title text -- ) + make-notification + [ + NSUserNotificationCenter -> defaultUserNotificationCenter + ] dip + -> deliverNotification: ; diff --git a/extra/notifications/macos/platforms.txt b/extra/notifications/macos/platforms.txt new file mode 100644 index 0000000000..6e806f449e --- /dev/null +++ b/extra/notifications/macos/platforms.txt @@ -0,0 +1 @@ +macosx diff --git a/extra/opengl/demo-support/summary.txt b/extra/opengl/demo-support/summary.txt index eca681450f..b3d3bafdec 100644 --- a/extra/opengl/demo-support/summary.txt +++ b/extra/opengl/demo-support/summary.txt @@ -1 +1 @@ -Common support for OpenGL demos \ No newline at end of file +Common support for OpenGL demos diff --git a/extra/readline-listener/platforms.txt b/extra/readline-listener/platforms.txt index 47e0a6946a..509143d863 100644 --- a/extra/readline-listener/platforms.txt +++ b/extra/readline-listener/platforms.txt @@ -1 +1 @@ -unix \ No newline at end of file +unix diff --git a/extra/readline/ffi/platforms.txt b/extra/readline/ffi/platforms.txt index 47e0a6946a..509143d863 100644 --- a/extra/readline/ffi/platforms.txt +++ b/extra/readline/ffi/platforms.txt @@ -1 +1 @@ -unix \ No newline at end of file +unix diff --git a/extra/readline/platforms.txt b/extra/readline/platforms.txt index 47e0a6946a..509143d863 100644 --- a/extra/readline/platforms.txt +++ b/extra/readline/platforms.txt @@ -1 +1 @@ -unix \ No newline at end of file +unix diff --git a/extra/sequences/extras/extras.factor b/extra/sequences/extras/extras.factor index 83455a2af8..815bb22b10 100644 --- a/extra/sequences/extras/extras.factor +++ b/extra/sequences/extras/extras.factor @@ -445,12 +445,18 @@ PRIVATE> : last? ( ... seq quot: ( ... elt -- ... ? ) -- ... ? ) [ last ] dip call ; inline : nth? ( ... n seq quot: ( ... elt -- ... ? ) -- ... ? ) [ nth ] dip call ; inline -: loop>sequence ( quot exemplar -- seq ) +: loop>sequence ( quot: ( -- obj/f ) exemplar -- seq ) [ '[ [ @ [ [ , ] when* ] keep ] loop ] ] dip make ; inline -: loop>array ( quot -- seq ) +: loop>array ( quot: ( -- obj/f ) -- seq ) { } loop>sequence ; inline +: loop>sequence* ( quot: ( -- obj ? ) exemplar -- seq ) + [ '[ [ @ [ [ , ] when* ] [ ] bi* ] loop ] ] dip make ; inline + +: loop>array* ( quot: ( -- obj ? ) -- seq ) + { } loop>sequence* ; inline +