Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2008-03-09 06:52:09 -05:00
commit 828881b1d1
9 changed files with 72 additions and 27 deletions

View File

@ -240,11 +240,14 @@ PREDICATE: unexpected unexpected-eof
: CREATE ( -- word ) scan create-in ; : CREATE ( -- word ) scan create-in ;
: CREATE-CLASS ( -- word ) : create-class ( word vocab -- word )
scan in get create create
dup save-class-location dup save-class-location
dup predicate-word dup set-word save-location ; dup predicate-word dup set-word save-location ;
: CREATE-CLASS ( -- word )
scan in get create-class ;
: word-restarts ( possibilities -- restarts ) : word-restarts ( possibilities -- restarts )
natural-sort [ natural-sort [
[ "Use the word " swap summary append ] keep [ "Use the word " swap summary append ] keep

View File

@ -132,6 +132,7 @@ SYMBOL: build-status
"Did not pass load-everything: " print "load-everything-vocabs" cat "Did not pass load-everything: " print "load-everything-vocabs" cat
"Did not pass test-all: " print "test-all-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. "Benchmarks: " print "benchmarks" eval-file benchmarks.

View File

@ -7,6 +7,8 @@ USING: kernel namespaces sequences assocs builder continuations
tools.browser tools.browser
tools.test tools.test
io.encodings.utf8 io.encodings.utf8
combinators.cleave
help.lint
bootstrap.stage2 benchmark builder.util ; bootstrap.stage2 benchmark builder.util ;
IN: builder.test IN: builder.test
@ -14,8 +16,21 @@ IN: builder.test
: do-load ( -- ) : do-load ( -- )
try-everything keys "../load-everything-vocabs" utf8 [ . ] with-file-writer ; 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 ( -- ) : 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-help-lint ( -- )
"" run-help-lint "../help-lint" utf8 [ typos. ] with-file-writer ;
: do-benchmarks ( -- ) : do-benchmarks ( -- )
run-benchmarks "../benchmarks" utf8 [ . ] with-file-writer ; run-benchmarks "../benchmarks" utf8 [ . ] with-file-writer ;
@ -24,6 +39,7 @@ IN: builder.test
bootstrap-time get "../boot-time" utf8 [ . ] with-file-writer bootstrap-time get "../boot-time" utf8 [ . ] with-file-writer
[ do-load ] runtime "../load-time" utf8 [ . ] with-file-writer [ do-load ] runtime "../load-time" utf8 [ . ] with-file-writer
[ do-tests ] runtime "../test-time" utf8 [ . ] with-file-writer [ do-tests ] runtime "../test-time" utf8 [ . ] with-file-writer
do-help-lint
do-benchmarks ; do-benchmarks ;
MAIN: do-all MAIN: do-all

View File

@ -1,7 +1,6 @@
USING: kernel parser quotations tuples words USING: kernel parser quotations tuples words
namespaces.lib namespaces sequences bake arrays combinators namespaces.lib namespaces sequences arrays combinators
prettyprint strings math.parser new-slots accessors prettyprint strings math.parser sequences.lib math symbols ;
sequences.lib math symbols ;
USE: tools.walker USE: tools.walker
IN: db.sql IN: db.sql

View File

@ -84,7 +84,6 @@ HOOK: insert-tuple* db ( tuple statement -- )
[ bind-tuple ] keep execute-statement ; [ bind-tuple ] keep execute-statement ;
: insert-tuple ( tuple -- ) : insert-tuple ( tuple -- )
! break
dup class db-columns find-primary-key assigned-id? [ dup class db-columns find-primary-key assigned-id? [
insert-assigned insert-assigned
] [ ] [

View File

@ -100,7 +100,7 @@ ARTICLE: "logging.rotation" "Log rotation"
"The " { $vocab-link "logging.insomniac" } " vocabulary automates log rotation." ; "The " { $vocab-link "logging.insomniac" } " vocabulary automates log rotation." ;
ARTICLE: "logging.server" "Log implementation" 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 $nl
"The " { $link log-message } " word sends a message to the server which results in the server executing an internal word:" "The " { $link log-message } " word sends a message to the server which results in the server executing an internal word:"
{ $subsection (log-message) } { $subsection (log-message) }

View File

@ -12,3 +12,15 @@ HELP: SINGLETON:
} { $see-also } { $see-also
POSTPONE: PREDICATE: 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:
} ;

View File

@ -1,10 +1,15 @@
! Copyright (C) 2007 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! 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 IN: singleton
: define-singleton ( token -- )
\ word swap in get create-class
dup [ eq? ] curry define-predicate-class ;
: SINGLETON: : SINGLETON:
\ word scan define-singleton ; parsing
CREATE-CLASS
dup [ eq? ] curry define-predicate-class ; parsing : SINGLETONS:
";" parse-tokens [ define-singleton ] each ; parsing

View File

@ -68,11 +68,11 @@ check_gcc_version() {
} }
set_downloader() { set_downloader() {
test_program_installed wget test_program_installed wget curl
if [[ $? -ne 0 ]] ; then if [[ $? -ne 0 ]] ; then
DOWNLOAD=wget DOWNLOADER=wget
else else
DOWNLOAD="curl -O" DOWNLOADER="curl -O"
fi fi
} }
@ -95,7 +95,6 @@ check_installed_programs() {
ensure_program_installed md5sum md5 ensure_program_installed md5sum md5
ensure_program_installed cut ensure_program_installed cut
case $OS in case $OS in
macosx) ensure_program_installed port;;
netbsd) ensure_program_installed gmake;; netbsd) ensure_program_installed gmake;;
esac esac
check_gcc_version check_gcc_version
@ -203,6 +202,7 @@ echo_build_info() {
echo MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET echo MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET
echo GIT_PROTOCOL=$GIT_PROTOCOL echo GIT_PROTOCOL=$GIT_PROTOCOL
echo GIT_URL=$GIT_URL echo GIT_URL=$GIT_URL
echo DOWNLOADER=$DOWNLOADER
} }
set_build_info() { set_build_info() {
@ -235,6 +235,7 @@ find_build_info() {
find_word_size find_word_size
set_factor_binary set_factor_binary
set_build_info set_build_info
set_downloader
echo_build_info echo_build_info
} }
@ -304,12 +305,12 @@ get_boot_image() {
} }
get_url() { get_url() {
if [[ $DOWNLOAD -eq "" ]] ; then if [[ $DOWNLOADER -eq "" ]] ; then
set_downloader; set_downloader;
fi fi
echo $DOWNLOAD $1 ; echo $DOWNLOADER $1 ;
$DOWNLOAD $1 $DOWNLOADER $1
check_ret $DOWNLOAD check_ret $DOWNLOADER
} }
maybe_download_dlls() { maybe_download_dlls() {
@ -372,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 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 check_ret sudo
} }
install_libraries_port() { install_build_system_port() {
ensure_program_installed port test_program_installed git
yes | sudo port install git-core 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() { usage() {
@ -390,8 +400,8 @@ usage() {
case "$1" in case "$1" in
install) install ;; install) install ;;
install-x11) install_libraries_apt; install ;; install-x11) install_build_system_apt; install ;;
install-macosx) install_libraries_port; install ;; install-macosx) install_build_system_port; install ;;
self-update) update; make_boot_image; bootstrap;; self-update) update; make_boot_image; bootstrap;;
quick-update) update; refresh_image ;; quick-update) update; refresh_image ;;
update) update; update_bootstrap ;; update) update; update_bootstrap ;;