ProtoObject.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Sep 2006 19:52:31 +0200
changeset 9908 eede5b535b1e
parent 9222 1dccfa01fb06
child 10589 47f2edd1ffc6
permissions -rw-r--r--
extensions sorted by name (to avoid confusing cvs-diff)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8728
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     1
"
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     2
 COPYRIGHT (c) 2004 by eXept Software AG
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     3
              All Rights Reserved
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     4
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     5
 This software is furnished under a license and may be used
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     6
 only in accordance with the terms of that license and with the
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     8
 be provided or otherwise made available to, or used by, any
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
     9
 other person.  No title to or ownership of the software is
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    10
 hereby transferred.
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    11
"
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    12
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic' }"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
nil subclass:#ProtoObject
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:''
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
6912
d2e78827a065 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6911
diff changeset
    19
	category:'Kernel-Objects'
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!ProtoObject class methodsFor:'documentation'!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
8728
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    24
copyright
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    25
"
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    26
 COPYRIGHT (c) 2004 by eXept Software AG
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    27
              All Rights Reserved
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    28
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    29
 This software is furnished under a license and may be used
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    30
 only in accordance with the terms of that license and with the
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    32
 be provided or otherwise made available to, or used by, any
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    33
 other person.  No title to or ownership of the software is
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    34
 hereby transferred.
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    35
"
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    36
!
d70396dc4e96 copyright
Claus Gittinger <cg@exept.de>
parents: 8500
diff changeset
    37
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    a minimum object without much protocol;
7659
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
    41
    Provides the minimum required to prevent inspectors from crashing,
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
    42
    and debuggers from blocking.
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
    43
    (i.e. instead of inheriting from nil, better inherit from this).
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
    44
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    Named after a similar class found in Dolphin-Smalltalk.
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [author:]
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        Claus Gittinger (not much authoring, though)
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
! !
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
!ProtoObject methodsFor:'error handling'!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
doesNotUnderstand:aMessage
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    "this message is sent by the runtime system (VM) when
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
     a message is not understood by some object (i.e. there
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
     is no method for that selector). The original message has
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
     been packed into aMessage (i.e. the receiver, selector and
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     any arguments) and the original receiver is then sent the
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
     #doesNotUnderstand: message.
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     Here, we raise another signal which usually enters the debugger.
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
     You can of course redefine #doesNotUnderstand: in your classes
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
     to implement message delegation, 
8500
10d47cede03c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7661
diff changeset
    64
     or handle the MessageNotUnderstood exception gracefully."
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    <context: #return>
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
8500
10d47cede03c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7661
diff changeset
    68
    ^ MessageNotUnderstood raiseRequestWith:aMessage
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
! !
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
!ProtoObject methodsFor:'queries'!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
class
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "return the receivers class"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
%{  /* NOCONTEXT */
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    RETURN ( __Class(self) );
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
%}
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
*** WARNING
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
***
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
*** this method has been automatically created,
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
*** since all nil-subclasses should respond to some minimum required
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
*** protocol.
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
***
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
*** Inspection and/or debugging of instances may not be possible,
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
*** if you remove/change this method. 
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
"
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
! !
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
!ProtoObject methodsFor:'testing'!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
isBehavior
9222
1dccfa01fb06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8728
diff changeset
    96
    "return true, if the receiver is describing another objects behavior.
1dccfa01fb06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8728
diff changeset
    97
     False is returned here - the method is only redefined in Behavior."
1dccfa01fb06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8728
diff changeset
    98
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    ^ false
7661
71d2cac1b959 some tests aded to avoid trouble in debugger
Claus Gittinger <cg@exept.de>
parents: 7659
diff changeset
   100
!
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
7661
71d2cac1b959 some tests aded to avoid trouble in debugger
Claus Gittinger <cg@exept.de>
parents: 7659
diff changeset
   102
isBlock
71d2cac1b959 some tests aded to avoid trouble in debugger
Claus Gittinger <cg@exept.de>
parents: 7659
diff changeset
   103
    ^ false
7659
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   104
!
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   105
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   106
isException
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   107
    ^ false
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   108
!
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   109
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   110
isExceptionHandler
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   111
    ^ false
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   112
!
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   113
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   114
isJavaObject
4def16a2e6e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6912
diff changeset
   115
    ^ false
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!ProtoObject class methodsFor:'documentation'!
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
version
9222
1dccfa01fb06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8728
diff changeset
   121
    ^ '$Header: /cvs/stx/stx/libbasic/ProtoObject.st,v 1.10 2006-03-06 08:57:28 cg Exp $'
6844
75e52e680723 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
! !