- live browsing of Self object memory -

lobby defaultBehavior

This is the default behavior for the lobby and objects that
inherit from it. Most objects in the system inherit from the lobby.

CopyDowns: vector

CreatorPath: defaultBehavior

10 Modules

collectorMaking

& = ( el appendToCollector: (collector copyFirst: self))
appendToCollector: = ( c append: self)_

comparing

!= = ( ( = x ) not)

to nil

ifNil: = ( ifNil: b IfNotNil: [self])
ifNil:IfNotNil: = ( notNilBlk value: self)
ifNotNil: = ( ifNil: [self] IfNotNil: b)
ifNotNil:IfNil: = ( ifNil: nilBlk IfNotNil: notNilBlk)
isNil = ( ifNil: true IfNotNil: false)
isNotNil = ( isNil not)

converting

asOutliner = ( selfObjectModel newOutlinerFor: asMirror)override me to get a specialized outliner
asString = ( printString)

copying

clone =
( 
     _CloneIfFail: [|:error|
        'outOfMemoryError' == error ifFalse: [
          error: error
        ] True: [
          memory allocationFailed.
          _Clone
        ]
    ])
return a shallow copy of the receiver

doubleDispatching

equalsBigInteger: = ( false)_
equalsCanonicalString: = ( false)_
equalsCollection: = ( false)_
equalsColor: = ( false)_
equalsColormapEntry: = ( false)_
equalsDeadActivationMirror: = ( false)_
equalsDictionary: = ( false)_
equalsFloat: = ( false)_
equalsPair: = ( false)_
equalsRectangle: = ( false)_
equalsSet: = ( false)_
equalsSmallInteger: = ( false)_
pairDivide: = ( p copyX: p x / self Y: p y / self)double-dispatching for pairs. 4/91 dmu _
pairDivideCeiling: = ( p copyX: p x /+ self Y: p y /+ self)double-dispatching for pairs. 4/91 dmu _
pairDivideExact: = ( p copyX: p x /= self Y: p y /= self)double-dispatching for pairs. 4/91 dmu _
pairDivideFloor: = ( p copyX: p x /- self Y: p y /- self)double-dispatching for pairs. 4/91 dmu _
pairDivideRound: = ( p copyX: p x /~ self Y: p y /~ self)double-dispatching for pairs. 4/91 dmu _
pairMax: = ( p copyX: (p x max: self) Y: p y max: self)double-dispatching for pairs. 4/91 dmu _
pairMean: = ( p copyX: (p x mean: self) Y: p y mean: self)double-dispatching for pairs. 4/91 dmu _
pairMin: = ( p copyX: (p x min: self) Y: p y min: self)double-dispatching for pairs. 4/91 dmu _
pairMinus: = ( p copyX: p x - self Y: p y - self)double-dispatching for pairs. 4/91 dmu _
pairPlus: = ( p copyX: p x + self Y: p y + self)double-dispatching for pairs. 4/91 dmu _
pairTimes: = ( p copyX: p x * self Y: p y * self)double-dispatching for pairs. 4/91 dmu _

error handling

break =
( | env = lobby |
    env process this isDebugged ifTrue: [halt])
error: =
( | env = lobby |
    "If the error string is too long, the system crashes trying to draw the morphs.
      -- dmu 11/05"
    "Temporary fix for handling errors under Klein and Yoda. -- Adam, 5/06"
    (_TheVMIfFail: [
    env process this suspendAndTrace:
        (env processErrors userError copy
            receiver: self)
            message:  (ensureString: message) copyAtMostWithEllipsis: 2000.
    env process this errorContinueValue] ) vmKitsError: message)
print out an error message and quit from the executing Self code
error:Arguments: =
( | env = lobby |
    env process this suspendAndTrace:
        ((env processErrors userErrorWithArguments copy
            receiver: self)
            message:  (ensureString: message))
            arguments: args.
    env process this errorContinueValue)
halt =
( | env = lobby |
    env process this isDebugged ifFalse: [
        env log fatal:
             'Halt: ', 
             env process this asString,
             env process this objectID asString.
        env process this birthEvent ifNil: [
          env log info: 'To debug this process, type "attach: ', 
            env process this objectIDNumber printString, '"'.
        ] IfNotNil: [|:birthEvent|
          birthEvent sourceHand safelyDo: [
            env selfProcessModel debugProcess: env process this.
          ].
        ].
    ].
    env process this suspend.
    self)
halt: = ( log fatal: msg. halt)
primitiveFailedError:Name: =
( | env = lobby |
    "Temporary fix for handling primitive failure under Klein and Yoda. -- dmu 3/6"
    (_TheVMIfFail: [
    env process this suspendAndTrace:
        ((processErrors primitiveFailed copy
            receiver: self)
            selector: sel)
            error:    error.
    env process this errorContinueValue] ) vmKitsPrimitiveFailedError: error Name: sel)
primitive failure
quietError: =
( | env = lobby |
    env process this suspendWithError:
        (env processErrors userError copy
            receiver: self)
            message:  (ensureString: message).
    env process this errorContinueValue)
same as error: except does not print to the Self shell.
warning: = ( log warn: string. self)
ensureString: =
( | mir |
    mir: (reflect: msg).
    mir isReflecteeString || [mir isReflecteeByteVector] ifTrue: [
        ^ msg.
    ].
    mir isComplete ifTrue: [ msg printString ] False: ['message = ', mir objectID])
Many of the error handling routines will crash the scheduler, if they are called with a non-string/byte vector message argument. To make the system more robust, this method performs a sanity check on an error message argument.

evaluating

key = ( self) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value = ( self) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value: = ( value) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With: = ( value: a) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With:With: = ( value: a With: b) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With:With:With: = ( value: a With: b With: c) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With:With:With:With: = ( value: a With: b With: c With: d) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With:With:With:With:With: = ( value: a With: b With: c With: d With: e) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.
value:With:With:With:With:With:With: = ( value: a With: b With: c With: d With: e With: f) Convenient behavior for key/value and value* messages. By default, an object is its own key and value. The default value:{With:} messages strip off the trailing argument and retry. For example, this behavior allows a block taking one argument to be substituted for one taking two arguments when only the first argument is of interest.

filing out

isImmutableForFilingOut = false
storeString =
( 
    storeStringIfFail: [ | :e |
        error: 'Cannot find a storeString for this object: ', e])
storeStringIfFail: =
( 
    "Return a string, which when evaluated, will return
     an object with the same value (contents) as the receiver.
     This method is NOT guaranteed to return identity.
     In particular, <<dictionary storeString>> is allowed to return
     'dictionary copyRemoveAll' -- dmu 9/17/93
    "
    fb value: 'unimplemented')
storeStringNeeds =
( 
    "used by transporter to avoid writing out the store string
     for the prototype instead of the object itself"
     "return an empty object to allow storeStrings by default"
     "works for numbers, strings, etc"
     ())

identity

!== = ( ( == x ) not)== and !== should usually be avoided; if you really care about object identities then you should probably be using mirrors, since object identity is a reflective concept.
== = ( _Eq: x)== and !== should usually be avoided; if you really care about object identities then you should probably be using mirrors, since object identity is a reflective concept.
identityHash = ( _IdentityHash)== and !== should usually be avoided; if you really care about object identities then you should probably be using mirrors, since object identity is a reflective concept.

inspecting

inspect: = ( inspectReflectee: reflect: obj. obj)
inspect:Slot: =
( 
    (reflect: obj)
        findFirst: [ | :slot | name = slot key ]
        IfPresent: [ | :slot | inspectReflectee: slot value ]
         IfAbsent: [ 'No such slot in this object.' printLine ].
    obj)
inspectReflectee: =
( | m |
    '( |' print.
    m: list copyRemoveAll.
    aMirror filterBy: [ | :slot |
        slot value isReflecteeAssignment not ] Into: m.
    m    doFirst: [ | :slot. s. |
                    "use basicPrintStringAssignable to avoid
                     printing out annotations"
                    s: slot basicPrintStringAssignable
                         asTextLines indent: 4.
                    s firstLine: s firstLine copyFrom: 3.
                    s print.
                    '.' print. ]
      MiddleLast: [ | :slot |
                    '\n' print.
                    "use basicPrintStringAssignable to avoid
                     printing out annotations"
                    (slot basicPrintStringAssignable
                        asTextLines indent: 4) print.
                    '.' print. ]
         IfEmpty: nil.
    "inspect should print out other info, like vector elements"
    ' |' print.
    aMirror isReflecteeMethod ifTrue: [
        (selfMethodText copyForMethod: aMirror) asCode print.
    ] False: [
        ' ' print.
    ].
    ')' printLine.
    aMirror moduleSummaryString printLine.
    aMirror)

pairing

@ = ( point copyX: self Y: y)create a point

per-process globals

history = ( process this history)
prompt = ( process this prompt)
stderr = ( process this stderr)
stdin = ( process this stdin)
stdout = ( process this stdout)

printing

namePrintString = ( asMirror safeName)Used by printString, supplies the name part of the result.
print = ( printString print. self)Print me out on the standard output.
printLine = ( print. '\n' print. self)
printString =
( | sp |
    sp: statePrintString.
    namePrintString, 
    (sp isEmpty ifTrue: '' False: ['(', sp, ')']))
Objects that print should understand the messages printString, and printStringSize:. Children of the lobby may implement just the message printString and inherit reasonable behavior for the other three messages. (Or may implement printStringState, or printStringName.) To get the UI to print an object, its prototype (not traits) should be annotated with isComplete = true. See nameSize: in traits mirror to understand how this works.
printStringSize: =
( | r |
    r: printString.
    r size  <=  s ifTrue:  r  False: [namePrintString])
An object may implement this if it wants to control the way its printString may be truncated.
statePrintString = ''Part of printString, prints out the specialized state part. Should be overriden in order to print out my state.
printStringSize:Depth: = ( printStringSize: s)Used only for collections. See printStringSize:Depth: in traits collection -- dmu

referencing

objectID = ( '<', objectIDNumber printString, '>')
objectIDNumber = ( _ObjectID)

reflecting

asMirror = ( reflect: self)
reflect: = ( x _Mirror)

testing

isAnnotation = false
isMorph = false