diff --git a/basis/editors/etexteditor/authors.txt b/basis/editors/etexteditor/authors.txt new file mode 100755 index 0000000000..7b1e3b7fa0 --- /dev/null +++ b/basis/editors/etexteditor/authors.txt @@ -0,0 +1 @@ +Kibleur Christophe \ No newline at end of file diff --git a/basis/editors/etexteditor/etexteditor.factor b/basis/editors/etexteditor/etexteditor.factor new file mode 100755 index 0000000000..316bd24cfa --- /dev/null +++ b/basis/editors/etexteditor/etexteditor.factor @@ -0,0 +1,18 @@ +! Copyright (C) 2008 Kibleur Christophe. +! See http://factorcode.org/license.txt for BSD license. +USING: editors io.files io.launcher kernel math.parser +namespaces sequences windows.shell32 make ; +IN: editors.etexteditor + +: etexteditor-path ( -- str ) + \ etexteditor-path get-global [ + program-files "e\\e.exe" append-path + ] unless* ; + +: etexteditor ( file line -- ) + [ + etexteditor-path , + [ , ] [ "--line" , number>string , ] bi* + ] { } make run-detached drop ; + +[ etexteditor ] edit-hook set-global diff --git a/basis/editors/etexteditor/summary.txt b/basis/editors/etexteditor/summary.txt new file mode 100755 index 0000000000..46537003d9 --- /dev/null +++ b/basis/editors/etexteditor/summary.txt @@ -0,0 +1 @@ +etexteditor integration diff --git a/basis/editors/etexteditor/tags.txt b/basis/editors/etexteditor/tags.txt new file mode 100755 index 0000000000..6bf68304bb --- /dev/null +++ b/basis/editors/etexteditor/tags.txt @@ -0,0 +1 @@ +unportable diff --git a/basis/random/random.factor b/basis/random/random.factor index 242a9b8f31..5c93606ab5 100755 --- a/basis/random/random.factor +++ b/basis/random/random.factor @@ -13,17 +13,13 @@ GENERIC: seed-random ( tuple seed -- ) GENERIC: random-32* ( tuple -- r ) GENERIC: random-bytes* ( n tuple -- byte-array ) - - M: object random-bytes* ( n tuple -- byte-array ) - [ [ 4 /i ] keep adjust-random ] dip - over 4 * - [ '[ _ random-32* 4 >le _ push-all ] times ] keep ; + [ [ ] keep 4 /mod ] dip tuck + [ pick '[ _ random-32* 4 >le _ push-all ] times ] + [ + over zero? + [ 2drop ] [ random-32* 4 >le swap head over push-all ] if + ] 2bi* ; M: object random-32* ( tuple -- r ) 4 random-bytes* le> ; @@ -37,15 +33,13 @@ M: f random-bytes* ( n obj -- * ) no-random-number-generator ; M: f random-32* ( obj -- * ) no-random-number-generator ; : random-bytes ( n -- byte-array ) - [ - dup adjust-random random-generator get random-bytes* - ] keep head-slice >byte-array ; + random-generator get random-bytes* ; bignum ] + [ random-bytes >byte-array byte-array>bignum ] [ 3 shift 2^ ] bi / * >integer ; PRIVATE> diff --git a/basis/stack-checker/stack-checker-docs.factor b/basis/stack-checker/stack-checker-docs.factor index a9df463703..f208178b10 100644 --- a/basis/stack-checker/stack-checker-docs.factor +++ b/basis/stack-checker/stack-checker-docs.factor @@ -27,7 +27,7 @@ ARTICLE: "inference-combinators" "Combinator stack effects" "Consider a combinator such as " { $link keep } ". The combinator itself does not have a stack effect, because it applies " { $link call } " to a potentially arbitrary quotation. However, since the combinator is declared " { $link POSTPONE: inline } ", a given usage of it can have a stack effect:" { $example "[ [ 2 + ] keep ] infer." "( object -- object object )" } "Another example is the " { $link compose } " combinator. Because it is decared " { $link POSTPONE: inline } ", we can infer the stack effect of applying " { $link call } " to the result of " { $link compose } ":" -{ $example "[ 2 [ + ] curry [ sq ] compose ] infer." "( -- object object )" } +{ $example "[ 2 [ + ] curry [ sq ] compose ] infer." "( -- object )" } "Incidentally, this example demonstrates that the stack effect of nested currying and composition can also be inferred." $nl "A general rule of thumb is that any word which applies " { $link call } " or " { $link curry } " to one of its inputs must be declared " { $link POSTPONE: inline } "." diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index e1076775fa..2811801266 100644 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -263,3 +263,12 @@ SYMBOL: examples-flag [ example ] times "}" print ] with-variable ; + +: scaffold-rc ( path -- ) + [ touch-file ] [ "Click to edit: " write . ] bi ; + +: scaffold-factor-boot-rc ( -- ) + home ".factor-boot-rc" append-path scaffold-rc ; + +: scaffold-factor-rc ( -- ) + home ".factor-rc" append-path scaffold-rc ;