From: Aaron Schaefer Date: Tue, 24 Mar 2009 06:41:53 +0000 (-0400) Subject: Merge branch 'master' of git://factorcode.org/git/factor X-Git-Tag: 0.94~2190 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=fd6aba04a138ea7fc472b5b550c3c8580e826a43 Merge branch 'master' of git://factorcode.org/git/factor * 'master' of git://factorcode.org/git/factor: (113 commits) Round mouse co-ordinates Fix bunny deployment Fix site-watcher tests make multimethods tests pass make ecdsa unportable for now check pango-1.0 cocoa.messages: cleanup Move synopsis* from definitions to see Faster PEG compile times; inline less, use execute( instead delete factor/ every time after a build is finished. you can easily check it out by knowing the git-id Condomization wraps lambdas in condoms to protect them from macro-transmitted diseases. cond, case and other macros work better now if lambdas appear where quotations are expected Fixing compile errors, test failures and help lint failures Add a missing step to the tutorial. Add stack declarations to primitives during bootstrap now that ( is just a comment and won't affect HELP: anymore OpenSSL checksum => native implementation kernel doesn't need to depend on classes.tuple.private Remove useless declarations Fixing unit tests for syntax change tools.disassembler now uses udis on Windows Add promises unit tests ... Conflicts: extra/project-euler/001/001.factor --- fd6aba04a138ea7fc472b5b550c3c8580e826a43 diff --cc extra/project-euler/001/001.factor index c9145c9b73,de4345db68..17f8d0386d --- a/extra/project-euler/001/001.factor +++ b/extra/project-euler/001/001.factor @@@ -1,6 -1,6 +1,6 @@@ -! Copyright (c) 2007 Aaron Schaefer. +! Copyright (c) 2007, 2008 Aaron Schaefer, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. - USING: kernel math math.ranges sequences ; + USING: kernel math math.ranges sequences project-euler.common ; IN: project-euler.001 ! http://projecteuler.net/index.php?section=problems&id=1 @@@ -51,11 -51,4 +51,11 @@@ PRIVATE ! [ euler001b ] 100 ave-time ! 0 ms run / 0 ms GC ave time - 100 trials + +: euler001c ( -- answer ) + 1000 [ { 3 5 } [ mod 0 = ] with contains? ] filter sum ; + +! [ euler001c ] 100 ave-time +! 0 ms ave run time - 0.06 SD (100 trials) + - MAIN: euler001 + SOLUTION: euler001