From d35239bdd4c7c19c2d74c1514b1a27a713e4bc50 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 8 Mar 2008 11:41:49 -0600 Subject: [PATCH 1/8] don't require port on mac if they have git --- misc/factor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/factor.sh b/misc/factor.sh index 3a6d2d64f9..a823bf7b0e 100755 --- a/misc/factor.sh +++ b/misc/factor.sh @@ -95,7 +95,7 @@ check_installed_programs() { ensure_program_installed md5sum md5 ensure_program_installed cut case $OS in - macosx) ensure_program_installed port;; + macosx) ensure_program_installed git port;; netbsd) ensure_program_installed gmake;; esac check_gcc_version From da29219d7b3fe0e87cb54e6ae4c8ae0810471fe0 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 8 Mar 2008 11:44:28 -0600 Subject: [PATCH 2/8] better fix for misc/factor.sh --- misc/factor.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/factor.sh b/misc/factor.sh index a823bf7b0e..ed2c0ce130 100755 --- a/misc/factor.sh +++ b/misc/factor.sh @@ -95,7 +95,6 @@ check_installed_programs() { ensure_program_installed md5sum md5 ensure_program_installed cut case $OS in - macosx) ensure_program_installed git port;; netbsd) ensure_program_installed gmake;; esac check_gcc_version From 07e89862263294e47f0dc1c3f3614f27fbb3c4df Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 8 Mar 2008 12:00:40 -0600 Subject: [PATCH 3/8] fix some issues with the misc/factor.sh script --- misc/factor.sh | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/misc/factor.sh b/misc/factor.sh index ed2c0ce130..0ad44430c8 100755 --- a/misc/factor.sh +++ b/misc/factor.sh @@ -68,11 +68,11 @@ check_gcc_version() { } set_downloader() { - test_program_installed wget + test_program_installed wget curl if [[ $? -ne 0 ]] ; then - DOWNLOAD=wget + DOWNLOADER=wget else - DOWNLOAD="curl -O" + DOWNLOADER="curl -O" fi } @@ -202,6 +202,7 @@ echo_build_info() { echo MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET echo GIT_PROTOCOL=$GIT_PROTOCOL echo GIT_URL=$GIT_URL + echo DOWNLOADER=$DOWNLOADER } set_build_info() { @@ -234,6 +235,7 @@ find_build_info() { find_word_size set_factor_binary set_build_info + set_downloader echo_build_info } @@ -303,12 +305,12 @@ get_boot_image() { } get_url() { - if [[ $DOWNLOAD -eq "" ]] ; then + if [[ $DOWNLOADER -eq "" ]] ; then set_downloader; fi - echo $DOWNLOAD $1 ; - $DOWNLOAD $1 - check_ret $DOWNLOAD + echo $DOWNLOADER $1 ; + $DOWNLOADER $1 + check_ret $DOWNLOADER } maybe_download_dlls() { @@ -371,14 +373,23 @@ make_boot_image() { } -install_libraries_apt() { +install_build_system_apt() { + ensure_program_installed yes yes | sudo apt-get install sudo libc6-dev libfreetype6-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make check_ret sudo } -install_libraries_port() { - ensure_program_installed port - yes | sudo port install git-core +install_build_system_port() { + test_program_installed git + if [[ $? -ne 1 ]] ; then + ensure_program_installed yes + echo "git not found." + echo "This script requires either git-core or port." + echo "If it fails, install git-core or port and try again." + ensure_program_installed port + echo "Installing git-core with port...this will take awhile." + yes | sudo port install git-core + fi } usage() { @@ -389,8 +400,8 @@ usage() { case "$1" in install) install ;; - install-x11) install_libraries_apt; install ;; - install-macosx) install_libraries_port; install ;; + install-x11) install_build_system_apt; install ;; + install-macosx) install_build_system_port; install ;; self-update) update; make_boot_image; bootstrap;; quick-update) update; refresh_image ;; update) update; update_bootstrap ;; From 3b7d630a84ebc72bcf1805f502059683d8fce472 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 8 Mar 2008 12:01:48 -0600 Subject: [PATCH 4/8] implement CREATE-CLASS with create-class add SINGLETONS: --- core/parser/parser.factor | 7 +++++-- extra/singleton/singleton-docs.factor | 12 ++++++++++++ extra/singleton/singleton.factor | 15 ++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/core/parser/parser.factor b/core/parser/parser.factor index 8e1927c043..cc84084258 100755 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -240,11 +240,14 @@ PREDICATE: unexpected unexpected-eof : CREATE ( -- word ) scan create-in ; -: CREATE-CLASS ( -- word ) - scan in get create +: create-class ( word vocab -- word ) + create dup save-class-location dup predicate-word dup set-word save-location ; +: CREATE-CLASS ( -- word ) + scan in get create-class ; + : word-restarts ( possibilities -- restarts ) natural-sort [ [ "Use the word " swap summary append ] keep diff --git a/extra/singleton/singleton-docs.factor b/extra/singleton/singleton-docs.factor index 4ebbc9b71d..358d1a5bf6 100644 --- a/extra/singleton/singleton-docs.factor +++ b/extra/singleton/singleton-docs.factor @@ -12,3 +12,15 @@ HELP: SINGLETON: } { $see-also POSTPONE: PREDICATE: } ; + +HELP: SINGLETONS: +{ $syntax "SINGLETONS: classes... ;" +} { $values + { "classes" "new singletons to define" } +} { $description + "Defines a new singleton for each class in the list." +} { $examples + { $example "SINGLETONS: foo bar baz ;" "" } +} { $see-also + POSTPONE: SINGLETON: +} ; diff --git a/extra/singleton/singleton.factor b/extra/singleton/singleton.factor index f859cec5c0..1451283f23 100644 --- a/extra/singleton/singleton.factor +++ b/extra/singleton/singleton.factor @@ -1,10 +1,15 @@ -! Copyright (C) 2007 Doug Coleman. +! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: classes.predicate kernel parser quotations words ; +USING: classes.predicate kernel namespaces parser quotations +sequences words ; IN: singleton +: define-singleton ( token -- ) + \ word swap in get create-class + dup [ eq? ] curry define-predicate-class ; : SINGLETON: - \ word - CREATE-CLASS - dup [ eq? ] curry define-predicate-class ; parsing + scan define-singleton ; parsing + +: SINGLETONS: + ";" parse-tokens [ define-singleton ] each ; parsing From d7d64b202f19ed6ec9cc4374e8625352b093b520 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 8 Mar 2008 12:02:19 -0600 Subject: [PATCH 5/8] minor cleanup --- extra/db/sql/sql.factor | 5 ++--- extra/db/tuples/tuples.factor | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/extra/db/sql/sql.factor b/extra/db/sql/sql.factor index 062eab8bc8..1de4bdfb5a 100755 --- a/extra/db/sql/sql.factor +++ b/extra/db/sql/sql.factor @@ -1,7 +1,6 @@ USING: kernel parser quotations tuples words -namespaces.lib namespaces sequences bake arrays combinators -prettyprint strings math.parser new-slots accessors -sequences.lib math symbols ; +namespaces.lib namespaces sequences arrays combinators +prettyprint strings math.parser sequences.lib math symbols ; USE: tools.walker IN: db.sql diff --git a/extra/db/tuples/tuples.factor b/extra/db/tuples/tuples.factor index bc7fcba034..32055ccedc 100755 --- a/extra/db/tuples/tuples.factor +++ b/extra/db/tuples/tuples.factor @@ -84,7 +84,6 @@ HOOK: insert-tuple* db ( tuple statement -- ) [ bind-tuple ] keep execute-statement ; : insert-tuple ( tuple -- ) - ! break dup class db-columns find-primary-key assigned-id? [ insert-assigned ] [ From 57c772303f73acdb9fedc7d2db497ee3d3ee4e6c Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sat, 8 Mar 2008 22:46:57 -0600 Subject: [PATCH 6/8] builder.test: Show tests which fail in addition to vocabularies --- extra/builder/test/test.factor | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor index d03be0781a..e92efaf8fc 100644 --- a/extra/builder/test/test.factor +++ b/extra/builder/test/test.factor @@ -7,6 +7,7 @@ USING: kernel namespaces sequences assocs builder continuations tools.browser tools.test io.encodings.utf8 + combinators.cleave bootstrap.stage2 benchmark builder.util ; IN: builder.test @@ -14,8 +15,18 @@ IN: builder.test : do-load ( -- ) try-everything keys "../load-everything-vocabs" utf8 [ . ] with-file-writer ; +! : do-tests ( -- ) +! run-all-tests keys "../test-all-vocabs" utf8 [ . ] with-file-writer ; + : do-tests ( -- ) - run-all-tests keys "../test-all-vocabs" utf8 [ . ] with-file-writer ; + run-all-tests + "../test-all-vocabs" utf8 + [ + [ keys . ] + [ test-failures. ] + bi + ] + with-file-writer ; : do-benchmarks ( -- ) run-benchmarks "../benchmarks" utf8 [ . ] with-file-writer ; From 959aef925fac06e8be512e6a2a2c45a7897eac2c Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sun, 9 Mar 2008 03:48:19 -0600 Subject: [PATCH 7/8] logging-docs: typo --- extra/logging/logging-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/logging/logging-docs.factor b/extra/logging/logging-docs.factor index 715b1551b9..a7750fe388 100755 --- a/extra/logging/logging-docs.factor +++ b/extra/logging/logging-docs.factor @@ -100,7 +100,7 @@ ARTICLE: "logging.rotation" "Log rotation" "The " { $vocab-link "logging.insomniac" } " vocabulary automates log rotation." ; ARTICLE: "logging.server" "Log implementation" -"The " { $vocab-link "logging.server" } " vocabulary implements a concurrent log server using " { $vocab-link "concurrency" } ". User code never interacts with the server directly, instead ot uses the words in the " { $link "logging" } " vocabulary. The server is used to synchronize access to log files and ensure that log rotation can proceed in an orderly fashion." +"The " { $vocab-link "logging.server" } " vocabulary implements a concurrent log server using " { $vocab-link "concurrency" } ". User code never interacts with the server directly, instead it uses the words in the " { $link "logging" } " vocabulary. The server is used to synchronize access to log files and ensure that log rotation can proceed in an orderly fashion." $nl "The " { $link log-message } " word sends a message to the server which results in the server executing an internal word:" { $subsection (log-message) } From 6f2a435498db0b6fee1cbafa65a3c983f6d52ef5 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sun, 9 Mar 2008 04:49:35 -0600 Subject: [PATCH 8/8] builder: Include help-lint results in report --- extra/builder/builder.factor | 1 + extra/builder/test/test.factor | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/extra/builder/builder.factor b/extra/builder/builder.factor index 747f0cd1e5..68f525ec6c 100644 --- a/extra/builder/builder.factor +++ b/extra/builder/builder.factor @@ -132,6 +132,7 @@ SYMBOL: build-status "Did not pass load-everything: " print "load-everything-vocabs" cat "Did not pass test-all: " print "test-all-vocabs" cat + "help-lint results:" print "help-lint" cat "Benchmarks: " print "benchmarks" eval-file benchmarks. diff --git a/extra/builder/test/test.factor b/extra/builder/test/test.factor index e92efaf8fc..dd3c640a84 100644 --- a/extra/builder/test/test.factor +++ b/extra/builder/test/test.factor @@ -8,6 +8,7 @@ USING: kernel namespaces sequences assocs builder continuations tools.test io.encodings.utf8 combinators.cleave + help.lint bootstrap.stage2 benchmark builder.util ; IN: builder.test @@ -28,6 +29,9 @@ IN: builder.test ] with-file-writer ; +: do-help-lint ( -- ) + "" run-help-lint "../help-lint" utf8 [ typos. ] with-file-writer ; + : do-benchmarks ( -- ) run-benchmarks "../benchmarks" utf8 [ . ] with-file-writer ; @@ -35,6 +39,7 @@ IN: builder.test bootstrap-time get "../boot-time" utf8 [ . ] with-file-writer [ do-load ] runtime "../load-time" utf8 [ . ] with-file-writer [ do-tests ] runtime "../test-time" utf8 [ . ] with-file-writer + do-help-lint do-benchmarks ; MAIN: do-all \ No newline at end of file