More small fixes

darcs
slava 2006-10-19 18:12:47 +00:00
parent 6a71e81ae7
commit 346063e9ac
5 changed files with 7 additions and 25 deletions

View File

@ -10,6 +10,7 @@
+ ui:
- menu should stay up if mouse button released
- completion is not ideal: eg, search for "buttons"
- some way of intercepting all gestures
- slider needs to be modelized

View File

@ -33,8 +33,8 @@ USING: errors kernel sequences math sequences-internals namespaces arrays ;
-rot (^mod)
] if ; foldable
: powers ( n x -- { 1 x x^2 x^3 ... } )
#! Output sequence has n elements.
: powers ( n x -- seq )
#! Output sequence has n elements, { 1 x x^2 x^3 ... }
<array> 1 [ * ] accumulate ;
: ** ( u v -- u*v' ) conjugate * ; inline

View File

@ -1,3 +1,3 @@
PROVIDE: contrib/postgresql
{ "libpq.factor" "postgresql.factor" }
{ "postgresql-test" } ;
{ "postgresql-test.factor" } ;

View File

@ -58,7 +58,8 @@ TUPLE: no-method object generic ;
: methods* ( dispatch# word -- assoc )
#! Make a class->method association, together with a
#! default delegating method at the end.
dup methods -rot default-method add* ;
dup methods -rot empty-method object bootstrap-word
swap 2array add* ;
: method-alist>quot ( dispatch# word base-class -- quot )
bootstrap-word swap simplify-alist
@ -91,25 +92,6 @@ TUPLE: no-method object generic ;
: small-generic? ( word -- ? ) generic-tags length 3 <= ;
: build-class-vtable ( vtable pair -- )
dup first hashcode pick length rem rot nth push ;
: <class-vtable> ( dispatch# word assoc -- table )
>r dupd default-method r>
[ length 3 + [ drop 1array >vector ] map-with ] keep
[ dupd build-class-vtable ] each
[ object method-alist>quot ] map-with ;
: class-generic ( dispatch# word -- quot )
dup methods dup empty? [
drop default-method
] [
[
pick picker % [ class hashcode ] %
<class-vtable> dup length , \ rem , , \ dispatch ,
] [ ] make
] if ;
: standard-combination ( word dispatch# -- quot )
swap {
{ [ dup tag-generic? ] [ num-tags \ tag type-generic ] }

View File

@ -77,8 +77,7 @@ SYMBOL: parse-hook
dup parsing-file dup record-file
[ ?resource-path <file-reader> ] keep parse-stream
] [
over parse-file-restarts <condition> rethrow drop
parse-file
over parse-file-restarts condition drop parse-file
] recover ;
: run-file ( file -- ) parse-file call ;