- live browsing of Self object memory -

lobby traitsmessage

CopyDowns: vector

CreatorPath: traits message

Module: message

parent* = traits clonable

accessing

selector = ( selectorString)
selector: = ( selectorString: s asString canonicalize)fix it so prims do not fail
type: =
( 
    [delegated].
    [directedResend].
    [undirectedResend].
    [implicitSelf].
    [normal].
    parent: t sendTo: self)
David wants to remove dynamic inheritance in messages. -- Adam, 3/04

comparing

= =
( 
     (receiver = m receiver)   &&
    [(selector = m selector)   &&
    [(arguments = m arguments) &&
    [((reflect: delegatee) = (reflect: m delegatee)) &&
    [(reflect: methodHolder) = (reflect: m methodHolder)]]]])
hash =
( 
    (reflect: receiver) hash ^^
    selector hash ^^
    (reflect: delegatee) hash ^^
    (reflect: methodHolder) hash)

copying

copy = ( clone arguments: arguments copy)

forking

fork = ( (process copySend: self) resume)
forkForBirthEvent: = ( ( (process copySend: self) birthEvent: evt) resume)

initializing

receiver:Selector: = ( receiver: r Selector: s Arguments: vector)
receiver:Selector:Arguments: =
( 
    receiver: r Selector: s Type: 'normal' Delegatee: nil MethodHolder: nil
      Arguments: a)
receiver:Selector:Type:Delegatee:MethodHolder:Arguments: =
( 
    type: t.
    receiver: r.
    delegatee: d.
    selector: s.
    arguments: a.
    methodHolder: mh)
receiver:Selector:With: = ( receiver: r Selector: s Arguments: (vector copySize: 1) at: 0 Put: a0)
receiver:Selector:With:With: =
( 
    receiver: r Selector: s Arguments: ((vector copySize: 2) at: 0 Put: a0)
                                                             at: 1 Put: a1)
receiver:Selector:With:With:With: =
( 
    receiver: r Selector: s
      Arguments: (((vector copySize: 3) at: 0 Put: a0)
                                        at: 1 Put: a1)
                                        at: 2 Put: a2)
receiver:Selector:With:With:With:With: =
( 
    receiver: r Selector: s
      Arguments: ((((vector copySize: 4) at: 0 Put: a0)
                                         at: 1 Put: a1)
                                         at: 2 Put: a2)
                                         at: 3 Put: a3)

printing

statePrintString = ( (reflect: receiver) name, ' ', statePrintStringWithoutReceiver)
statePrintStringWithoutReceiver =
( 
    selector asSelector
        intersperse: 
            arguments copyMappedBy: [ | :arg | (reflect: arg) name ])
storeStringIfFail: =
( | r <- '' |
    arguments size > 3 ifTrue: [^ fb value: 'too many arguments'].
    r:  'message copy ', 
        ' receiver: (', 
        (receiver storeStringIfFail: [|:e| ^fb value: e]), ')',
        ' Selector: (', 
        (selector storeStringIfFail: [|:e| ^fb value: e]), ')'.
    arguments do: [|:arg. :i|
        r: r, ' With: (', (arg storeStringIfFail: [|:e| ^fb value: e]), ')'.
    ].
    r)
storeStringNeeds = ( message)

sending

sendIfFail: =
( | p |
    "send me and if any errors happen, invoke failBock with the 
     error object as argument"

    p: (process copySend: self)
        causeOfBirth: process this causeOfBirth.
    p resume.
    p waitForSuspension.
    p causeOfDeath = 'terminated'   
      ifTrue: [                  p returnValue  ] 
       False: [ failBlock value: p causeOfError ])

testing

isDirectedResend = false
isImmutableForFilingOut = true
isResend = false
isUndirectedResend = false

types of messages