Fix conflict

db4
Slava Pestov 2009-02-16 21:47:35 -06:00
commit 73dfa2ae65
8 changed files with 20 additions and 6 deletions

View File

@ -54,4 +54,12 @@ IN: linked-assocs.test
{ [ [ 1- ] bi@ ] [ 2 / ] } "second" pick set-at { [ [ 1- ] bi@ ] [ 2 / ] } "second" pick set-at
4 6 pick values [ first call ] each 4 6 pick values [ first call ] each
+ swap values <reversed> [ second call ] each + swap values <reversed> [ second call ] each
] unit-test
{ V{ { "az" 1 } { "by" 2 } { "cx" 3 } } } [
<linked-hash>
1 "az" pick set-at
2 "by" pick set-at
3 "cx" pick set-at
>alist
] unit-test ] unit-test

View File

@ -10,7 +10,7 @@ TUPLE: nibble-array
<PRIVATE <PRIVATE
: nibble BIN: 1111 ; inline CONSTANT: nibble BIN: 1111
: nibbles>bytes ( m -- n ) 1 + 2/ ; inline : nibbles>bytes ( m -- n ) 1 + 2/ ; inline

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays definitions kernel ui.commands USING: accessors arrays definitions kernel ui.commands
ui.gestures sequences strings math words generic namespaces ui.gestures sequences strings math words generic namespaces
hashtables help.markup quotations assocs fry call ; hashtables help.markup quotations assocs fry call linked-assocs ;
IN: ui.operations IN: ui.operations
SYMBOL: +keyboard+ SYMBOL: +keyboard+
@ -33,8 +33,11 @@ M: operation command-word command>> command-word ;
SYMBOL: operations SYMBOL: operations
operations [ <linked-hash> ] initialize
: object-operations ( obj -- operations ) : object-operations ( obj -- operations )
operations get [ predicate>> call( obj -- ? ) ] with filter ; operations get values
[ predicate>> call( obj -- ? ) ] with filter ;
: gesture>operation ( gesture object -- operation/f ) : gesture>operation ( gesture object -- operation/f )
object-operations [ operation-gesture = ] with find nip ; object-operations [ operation-gesture = ] with find nip ;
@ -53,10 +56,14 @@ SYMBOL: operations
: default-flags ( -- assoc ) : default-flags ( -- assoc )
H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ; H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ;
: (define-operation) ( operation -- )
dup [ command>> ] [ predicate>> ] bi
2array operations get set-at ;
: define-operation ( pred command flags -- ) : define-operation ( pred command flags -- )
default-flags swap assoc-union default-flags swap assoc-union
dupd define-command <operation> dupd define-command <operation>
operations get push ; (define-operation) ;
: modify-operation ( translator operation -- operation ) : modify-operation ( translator operation -- operation )
clone clone

View File

@ -12,8 +12,6 @@ ui.commands ui.gadgets.editors ui.gestures ui.operations
ui.tools.deploy models ; ui.tools.deploy models ;
IN: ui.tools.operations IN: ui.tools.operations
V{ } clone operations set-global
! Objects ! Objects
[ drop t ] \ inspector H{ [ drop t ] \ inspector H{
{ +primary+ t } { +primary+ t }

View File

@ -0,0 +1 @@
Doug Coleman