extensions.st
author Claus Gittinger <cg@exept.de>
Wed, 23 Aug 2006 15:43:08 +0200
changeset 1668 96c1701345c5
parent 1667 ebfdab14f2fb
child 1759 78e481899a63
permissions -rw-r--r--
checkin from browser

"{ Package: 'stx:libbasic2' }"
!

!Object methodsFor:'converting'!

!! anObject
    "return a cons with the receiver as car and the argument as cdr"

    ^ Cons car:self cdr:anObject

    "
     (1 !! 2)                
     (#car !! #cdr)          
     (1 !! (2 !! (3 !! nil)))    
     (1 !! 2) !! (2 !! 3)    
    "
! !

!Object methodsFor:'dependents-st/v event simulation'!

when:eventSymbol send:selector to:anObject
    "install an ST/V-style interest forwarder.
     Here, we use the nonWeakDependencies."

    self addInterest:(InterestConverterWithParameters
                            destination:anObject 
                            selector:selector 
                            aspect:eventSymbol).

    "
     |p b|

     b := [Transcript showCR:'the point changed'].

     p := Point new.
     p whem:#foo:bar: send:#value:value: to:[:a :b | Transcript show:'foo: '; show:a; show:' bar: '; showCR:b].
     Transcript showCR:'now changing'.
     p triggerEvent:#foo:bar: withArguments:#('fooArg' 'barArg').
     p retracrtInterests.
    "
! !