Fix conflict
commit
73dfa2ae65
|
@ -54,4 +54,12 @@ IN: linked-assocs.test
|
|||
{ [ [ 1- ] bi@ ] [ 2 / ] } "second" pick set-at
|
||||
4 6 pick values [ first 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
|
|
@ -10,7 +10,7 @@ TUPLE: nibble-array
|
|||
|
||||
<PRIVATE
|
||||
|
||||
: nibble BIN: 1111 ; inline
|
||||
CONSTANT: nibble BIN: 1111
|
||||
|
||||
: nibbles>bytes ( m -- n ) 1 + 2/ ; inline
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays definitions kernel ui.commands
|
||||
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
|
||||
|
||||
SYMBOL: +keyboard+
|
||||
|
@ -33,8 +33,11 @@ M: operation command-word command>> command-word ;
|
|||
|
||||
SYMBOL: operations
|
||||
|
||||
operations [ <linked-hash> ] initialize
|
||||
|
||||
: 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 )
|
||||
object-operations [ operation-gesture = ] with find nip ;
|
||||
|
@ -53,10 +56,14 @@ SYMBOL: operations
|
|||
: default-flags ( -- assoc )
|
||||
H{ { +keyboard+ f } { +primary+ f } { +secondary+ f } } ;
|
||||
|
||||
: (define-operation) ( operation -- )
|
||||
dup [ command>> ] [ predicate>> ] bi
|
||||
2array operations get set-at ;
|
||||
|
||||
: define-operation ( pred command flags -- )
|
||||
default-flags swap assoc-union
|
||||
dupd define-command <operation>
|
||||
operations get push ;
|
||||
(define-operation) ;
|
||||
|
||||
: modify-operation ( translator operation -- operation )
|
||||
clone
|
||||
|
|
|
@ -12,8 +12,6 @@ ui.commands ui.gadgets.editors ui.gestures ui.operations
|
|||
ui.tools.deploy models ;
|
||||
IN: ui.tools.operations
|
||||
|
||||
V{ } clone operations set-global
|
||||
|
||||
! Objects
|
||||
[ drop t ] \ inspector H{
|
||||
{ +primary+ t }
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Doug Coleman
|
Loading…
Reference in New Issue