Merge branch 'master' of git://factorcode.org/git/factor into row-polymorphism

db4
Joe Groff 2010-03-12 14:36:13 -08:00
commit 8687a7e283
7 changed files with 41 additions and 24 deletions

View File

@ -14,9 +14,6 @@ HELP: <recaptcha>
HELP: recaptcha-error HELP: recaptcha-error
{ $var-description "Set to the error string returned by the recaptcha server." } ; { $var-description "Set to the error string returned by the recaptcha server." } ;
HELP: recaptcha-valid?
{ $var-description "Set to " { $link t } " if the user solved the last recaptcha correctly." } ;
HELP: validate-recaptcha HELP: validate-recaptcha
{ $description "Validates a recaptcha using the recaptcha web service API." } ; { $description "Validates a recaptcha using the recaptcha web service API." } ;
@ -45,14 +42,9 @@ ARTICLE: "furnace.recaptcha" "Recaptcha support for Furnace"
{ $subsections <recaptcha> } { $subsections <recaptcha> }
"Validating recaptcha:" "Validating recaptcha:"
{ $subsections validate-recaptcha } { $subsections validate-recaptcha }
"Symbols set after validation:" "Symbol set after validation:"
{ $subsections { $subsections recaptcha-error }
recaptcha-valid?
recaptcha-error
}
"An example:" "An example:"
{ $subsections { $subsections "recaptcha-example" } ;
"recaptcha-example"
} ;
ABOUT: "furnace.recaptcha" ABOUT: "furnace.recaptcha"

View File

@ -108,5 +108,3 @@ M: cord v/n '[ _ v/n ] cord-map ; inline
M: cord norm-sq [ norm-sq ] cord-both + ; inline M: cord norm-sq [ norm-sq ] cord-both + ; inline
M: cord distance v- norm ; inline M: cord distance v- norm ; inline

View File

@ -141,7 +141,7 @@ TUPLE: depends-on-final class ;
[ \ depends-on-final add-conditional-dependency ] bi ; [ \ depends-on-final add-conditional-dependency ] bi ;
M: depends-on-final satisfied? M: depends-on-final satisfied?
class>> final-class? ; class>> { [ class? ] [ final-class? ] } 1&& ;
: init-dependencies ( -- ) : init-dependencies ( -- )
H{ } clone dependencies set H{ } clone dependencies set

View File

@ -1,6 +1,6 @@
USING: accessors effects eval kernel layouts math namespaces USING: accessors effects eval kernel layouts math namespaces
quotations tools.test typed words words.symbol quotations tools.test typed words words.symbol
compiler.tree.debugger prettyprint ; compiler.tree.debugger prettyprint definitions compiler.units ;
IN: typed.tests IN: typed.tests
TYPED: f+ ( a: float b: float -- c: float ) TYPED: f+ ( a: float b: float -- c: float )
@ -149,3 +149,12 @@ SYMBOL: a-symbol
a-symbol get a-symbol get
] with-variable ] with-variable
] unit-test ] unit-test
! Forgetting an unboxed final class should work
TUPLE: forget-class { x read-only } ; final
TYPED: forget-fail ( a: forget-class -- ) drop ;
[ ] [ [ \ forget-class forget ] with-compilation-unit ] unit-test
[ ] [ [ \ forget-fail forget ] with-compilation-unit ] unit-test

View File

@ -74,3 +74,12 @@ HELP: considered
{ $description "When called after a call to " { $link find-path } ", return a list of nodes " { $description "When called after a call to " { $link find-path } ", return a list of nodes "
"which have been examined during the A* exploration." "which have been examined during the A* exploration."
} ; } ;
ARTICLE: "astar" "A* algorithm"
"The " { $vocab-link "astar" } " vocabulary implements a graph search algorithm for finding the least-cost path from one node to another." $nl
"Make an A* object:"
{ $subsections <astar> }
"Find a path between nodes:"
{ $subsections find-path } ;
ABOUT: "astar"

View File

@ -1,11 +1,12 @@
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov. ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs benchmark bootstrap.stage2 compiler.errors USING: accessors assocs benchmark bootstrap.stage2
source-files.errors generic help.html help.lint io.directories compiler.errors source-files.errors generic help.html help.lint
io.encodings.utf8 io.files kernel mason.common math namespaces io.directories io.encodings.utf8 io.files kernel mason.common
prettyprint sequences sets sorting tools.test tools.time math namespaces prettyprint sequences sets sorting tools.test
words system io tools.errors vocabs.hierarchy vocabs.errors tools.time words system io tools.errors vocabs vocabs.files
vocabs.refresh locals ; vocabs.hierarchy vocabs.errors vocabs.refresh locals
source-files compiler.units ;
IN: mason.test IN: mason.test
: do-load ( -- ) : do-load ( -- )
@ -32,6 +33,12 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
test-all-errors-file test-all-errors-file
do-step ; do-step ;
: cleanup-tests ( -- )
! Free up some code heap space
[
vocabs [ vocab-tests [ forget-source ] each ] each
] with-compilation-unit ;
: do-help-lint ( -- ) : do-help-lint ( -- )
help-lint-all lint-failures get values help-lint-all lint-failures get values
help-lint-vocabs-file help-lint-vocabs-file
@ -67,6 +74,7 @@ M: method word-vocabulary "method-generic" word-prop word-vocabulary ;
[ do-load ] benchmark load-time-file to-file [ do-load ] benchmark load-time-file to-file
[ generate-help ] benchmark html-help-time-file to-file [ generate-help ] benchmark html-help-time-file to-file
[ do-tests ] benchmark test-time-file to-file [ do-tests ] benchmark test-time-file to-file
cleanup-tests
[ do-help-lint ] benchmark help-lint-time-file to-file [ do-help-lint ] benchmark help-lint-time-file to-file
[ do-benchmarks ] benchmark benchmark-time-file to-file [ do-benchmarks ] benchmark benchmark-time-file to-file
do-compile-errors do-compile-errors

View File

@ -1,7 +1,8 @@
! Copyright (c) 2010 Aaron Schaefer. All rights reserved. ! Copyright (c) 2010 Aaron Schaefer. All rights reserved.
! The contents of this file are licensed under the Simplified BSD License ! The contents of this file are licensed under the Simplified BSD License
! A copy of the license is available at http://factorcode.org/license.txt ! A copy of the license is available at http://factorcode.org/license.txt
USING: grouping kernel math math.ranges project-euler.common sequences ; USING: grouping kernel math math.ranges project-euler.common
sequences sequences.cords ;
IN: project-euler.206 IN: project-euler.206
! http://projecteuler.net/index.php?section=problems&id=206 ! http://projecteuler.net/index.php?section=problems&id=206
@ -33,7 +34,7 @@ CONSTANT: hi 1389026570
{ 1 2 3 4 5 6 7 8 9 0 } = ; { 1 2 3 4 5 6 7 8 9 0 } = ;
: candidates ( -- seq ) : candidates ( -- seq )
lo lo 40 + [ hi 100 <range> ] bi@ append ; lo lo 40 + [ hi 100 <range> ] bi@ cord-append ;
PRIVATE> PRIVATE>