Revision: 3582
Author: hans
URL: http://bknr.net/trac/changeset/3582
Experimental new allocator
A trunk/projects/bos/m2/test-allocation.lisp
Added: trunk/projects/bos/m2/test-allocation.lisp
===================================================================
--- trunk/projects/bos/m2/test-allocation.lisp (rev 0)
+++ trunk/projects/bos/m2/test-allocation.lisp 2008-07-23 12:29:36 UTC (rev 3582)
@@ -0,0 +1,39 @@
+(in-package :bos.m2)
+
+(defun try-allocation (n x y pred)
+ "Try to find N free square meters that are adjacent and that begin
+at X and Y. PRED is a predicate function of two arguments that
+returns a true value if the arguments specify the coordinates of an
+allocatable square meter."
+ (unless (funcall pred x y)
+ (error "sqm ~A/~A not allocatable" x y))
+ (let ((allocated (make-hash-table :test #'equal))
+ (connected (list (list x y)))
+ (border-queue (bos.web::make-queue)))
+ (labels
+ ((try-get (&rest key)
+ (when (and (not (gethash key allocated))
+ (apply pred key))
+ (setf (gethash key allocated) t)
+ (bos.web::enqueue key border-queue)
+ key))
+ (get-next-neighbor (x y)
+ "Return the next neighbor of M2 that can be allocated or NIL if none of the neighbor can be allocated."
+ (or (try-get (1+ x) y)
+ (try-get x (1+ y))
+ (try-get (1- x) y)
+ (try-get x (1- y)))))
+ (dotimes (i (1- n)
+ (append connected (bos.web::elements border-queue)))
+ (tagbody
+ retry
+ (let ((next (get-next-neighbor x y)))
+ (unless next
+ (cond
+ ((bos.web::queue-empty-p border-queue)
+ (return nil))
+ (t
+ (push (list x y) connected)
+ (multiple-value-setq (x y)
+ (values-list (bos.web::dequeue border-queue)))
+ (go retry))))))))))
\ No newline at end of file
Revision: 3581
Author: edi
URL: http://bknr.net/trac/changeset/3581
Update to current dev version
U trunk/thirdparty/cl-ppcre/CHANGELOG
D trunk/thirdparty/cl-ppcre/README
U trunk/thirdparty/cl-ppcre/api.lisp
A trunk/thirdparty/cl-ppcre/charmap.lisp
U trunk/thirdparty/cl-ppcre/charset.lisp
A trunk/thirdparty/cl-ppcre/chartest.lisp
D trunk/thirdparty/cl-ppcre/cl-ppcre-test.system
A trunk/thirdparty/cl-ppcre/cl-ppcre-unicode/
A trunk/thirdparty/cl-ppcre/cl-ppcre-unicode/packages.lisp
A trunk/thirdparty/cl-ppcre/cl-ppcre-unicode/resolver.lisp
A trunk/thirdparty/cl-ppcre/cl-ppcre-unicode.asd
U trunk/thirdparty/cl-ppcre/cl-ppcre.asd
D trunk/thirdparty/cl-ppcre/cl-ppcre.system
U trunk/thirdparty/cl-ppcre/closures.lisp
U trunk/thirdparty/cl-ppcre/convert.lisp
D trunk/thirdparty/cl-ppcre/doc/benchmarks.2002-12-22.txt
U trunk/thirdparty/cl-ppcre/doc/index.html
U trunk/thirdparty/cl-ppcre/errors.lisp
U trunk/thirdparty/cl-ppcre/lexer.lisp
D trunk/thirdparty/cl-ppcre/lispworks-defsystem.lisp
D trunk/thirdparty/cl-ppcre/load.lisp
U trunk/thirdparty/cl-ppcre/optimize.lisp
U trunk/thirdparty/cl-ppcre/packages.lisp
U trunk/thirdparty/cl-ppcre/parser.lisp
D trunk/thirdparty/cl-ppcre/perltest.pl
D trunk/thirdparty/cl-ppcre/ppcre-tests.lisp
A trunk/thirdparty/cl-ppcre/regex-class-util.lisp
U trunk/thirdparty/cl-ppcre/regex-class.lisp
U trunk/thirdparty/cl-ppcre/repetition-closures.lisp
U trunk/thirdparty/cl-ppcre/scanner.lisp
U trunk/thirdparty/cl-ppcre/specials.lisp
A trunk/thirdparty/cl-ppcre/test/
A trunk/thirdparty/cl-ppcre/test/packages.lisp
A trunk/thirdparty/cl-ppcre/test/perl-tests.lisp
A trunk/thirdparty/cl-ppcre/test/perltest.pl
A trunk/thirdparty/cl-ppcre/test/perltestdata
A trunk/thirdparty/cl-ppcre/test/perltestinput
A trunk/thirdparty/cl-ppcre/test/simple
A trunk/thirdparty/cl-ppcre/test/tests.lisp
A trunk/thirdparty/cl-ppcre/test/unicode-tests.lisp
A trunk/thirdparty/cl-ppcre/test/unicodetestdata
D trunk/thirdparty/cl-ppcre/testdata
D trunk/thirdparty/cl-ppcre/testinput
U trunk/thirdparty/cl-ppcre/util.lisp
Change set too large, please see URL above
Revision: 3579
Author: edi
URL: http://bknr.net/trac/changeset/3579
Import dev version of CL-UNICODE
A trunk/thirdparty/cl-unicode/
A trunk/thirdparty/cl-unicode/CHANGELOG.txt
A trunk/thirdparty/cl-unicode/alias.lisp
A trunk/thirdparty/cl-unicode/api.lisp
A trunk/thirdparty/cl-unicode/build/
A trunk/thirdparty/cl-unicode/build/char-info.lisp
A trunk/thirdparty/cl-unicode/build/data/
A trunk/thirdparty/cl-unicode/build/data/BidiMirroring.txt
A trunk/thirdparty/cl-unicode/build/data/Blocks.txt
A trunk/thirdparty/cl-unicode/build/data/DerivedAge.txt
A trunk/thirdparty/cl-unicode/build/data/DerivedCoreProperties.txt
A trunk/thirdparty/cl-unicode/build/data/Jamo.txt
A trunk/thirdparty/cl-unicode/build/data/PropList.txt
A trunk/thirdparty/cl-unicode/build/data/README.txt
A trunk/thirdparty/cl-unicode/build/data/Scripts.txt
A trunk/thirdparty/cl-unicode/build/data/UnicodeData.txt
A trunk/thirdparty/cl-unicode/build/dump.lisp
A trunk/thirdparty/cl-unicode/build/read.lisp
A trunk/thirdparty/cl-unicode/build/util.lisp
A trunk/thirdparty/cl-unicode/cl-unicode.asd
A trunk/thirdparty/cl-unicode/clean.cmd
A trunk/thirdparty/cl-unicode/conditions.lisp
A trunk/thirdparty/cl-unicode/derived.lisp
A trunk/thirdparty/cl-unicode/doc/
A trunk/thirdparty/cl-unicode/doc/index.html
A trunk/thirdparty/cl-unicode/packages.lisp
A trunk/thirdparty/cl-unicode/specials.lisp
A trunk/thirdparty/cl-unicode/test/
A trunk/thirdparty/cl-unicode/test/packages.lisp
A trunk/thirdparty/cl-unicode/test/properties
A trunk/thirdparty/cl-unicode/test/simple
A trunk/thirdparty/cl-unicode/test/tests.lisp
A trunk/thirdparty/cl-unicode/test-functions.lisp
A trunk/thirdparty/cl-unicode/util.lisp
Change set too large, please see URL above
Revision: 3578
Author: edi
URL: http://bknr.net/trac/changeset/3578
Tag 1.4.1 version as well
A tags/thirdparty/cl-ppcre-1.4.1/
Copied: tags/thirdparty/cl-ppcre-1.4.1 (from rev 3577, trunk/thirdparty/cl-ppcre)
Revision: 3577
Author: edi
URL: http://bknr.net/trac/changeset/3577
Import 1.4.1 version of CL-PPCRE
A trunk/thirdparty/cl-ppcre/
A trunk/thirdparty/cl-ppcre/CHANGELOG
A trunk/thirdparty/cl-ppcre/README
A trunk/thirdparty/cl-ppcre/api.lisp
A trunk/thirdparty/cl-ppcre/charset.lisp
A trunk/thirdparty/cl-ppcre/cl-ppcre-test.asd
A trunk/thirdparty/cl-ppcre/cl-ppcre-test.system
A trunk/thirdparty/cl-ppcre/cl-ppcre.asd
A trunk/thirdparty/cl-ppcre/cl-ppcre.system
A trunk/thirdparty/cl-ppcre/closures.lisp
A trunk/thirdparty/cl-ppcre/convert.lisp
A trunk/thirdparty/cl-ppcre/doc/
A trunk/thirdparty/cl-ppcre/doc/benchmarks.2002-12-22.txt
A trunk/thirdparty/cl-ppcre/doc/index.html
A trunk/thirdparty/cl-ppcre/errors.lisp
A trunk/thirdparty/cl-ppcre/lexer.lisp
A trunk/thirdparty/cl-ppcre/lispworks-defsystem.lisp
A trunk/thirdparty/cl-ppcre/load.lisp
A trunk/thirdparty/cl-ppcre/optimize.lisp
A trunk/thirdparty/cl-ppcre/packages.lisp
A trunk/thirdparty/cl-ppcre/parser.lisp
A trunk/thirdparty/cl-ppcre/perltest.pl
A trunk/thirdparty/cl-ppcre/ppcre-tests.lisp
A trunk/thirdparty/cl-ppcre/regex-class.lisp
A trunk/thirdparty/cl-ppcre/repetition-closures.lisp
A trunk/thirdparty/cl-ppcre/scanner.lisp
A trunk/thirdparty/cl-ppcre/specials.lisp
A trunk/thirdparty/cl-ppcre/testdata
A trunk/thirdparty/cl-ppcre/testinput
A trunk/thirdparty/cl-ppcre/util.lisp
Change set too large, please see URL above
Revision: 3576
Author: edi
URL: http://bknr.net/trac/changeset/3576
Remove 1.3.2 release of CL-PPCRE, to be replaced
D trunk/thirdparty/cl-ppcre-1.3.2/