InlineObjectClassDescription.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 24240 5a8ca163fbfc
child 24517 5aaa5e876057
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
     1
"{ Encoding: utf8 }"
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
     2
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 2009 by eXept Software AG
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
              All Rights Reserved
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic' }"
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
18460
8c545d355fd2 class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 16435
diff changeset
    16
"{ NameSpace: Smalltalk }"
8c545d355fd2 class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 16435
diff changeset
    17
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
ClassDescription subclass:#InlineObjectClassDescription
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    22
	category:'Kernel-Classes'
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!InlineObjectClassDescription class methodsFor:'documentation'!
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 2009 by eXept Software AG
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
              All Rights Reserved
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    39
!
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    40
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    41
documentation
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    42
"
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    43
    inline objects are an experimental feature in ST/X
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    44
    (and currently not used by the system).
24240
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    45
    Inline literal objects are created by the parsers/compilers with the following
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    46
    syntax:
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    47
        #{
24240
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    48
            <slotName1>: value .
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    49
            <slotName2>: value .
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    50
            ...
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    51
        }
24240
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    52
    where each value is a literal, separated by period from the next   
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    53
    i.e. similar to the brace-array construct { expr1 . expr2... }
24239
41cb789c936e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22812
diff changeset
    54
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    55
    For every inline object, an anonymous class is created,
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    56
    providing getters and setters for the slots.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    57
    (if literal objects are immutable (which is the default), 
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    58
     no setters are generated)
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    59
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    60
    You cannot add any semantic (i.e. methods) to inline objects -
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    61
    they are only useful as containers with a nicer protocol
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    62
    as compared to dictionaries or arrays.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    63
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    64
    All such created classes will be subclasses of me.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    65
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    66
    [example:]
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    67
        |foo|
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    68
24240
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    69
        foo := #{ 
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    70
                 foo: 'foo value' .
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    71
                 bar: 'bar value' .
24240
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    72
                 baz: 'and obviously: a baz value' .
5a8ca163fbfc #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 24239
diff changeset
    73
                }.
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    74
        foo bar.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    75
        foo baz.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    76
        foo inspect.
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    77
"
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
! !
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
!InlineObjectClassDescription methodsFor:'queries'!
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
name
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "although inline objects have no name, we return something
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
     useful here - there are many places (inspectors) where
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
     a classes name is asked for."
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
16435
0ee7eff89dd7 class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 13019
diff changeset
    87
    ^ #'someInlineObject'
13019
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    88
!
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    89
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    90
nameSpace
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    91
    ^ nil
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    92
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
    93
    "Created: / 13-08-2010 / 18:23:33 / cg"
22812
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    94
!
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    95
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    96
package
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    97
    "return libbasic, so the methods of my subclass-instances (i.e. the inline objects)
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    98
     are not seen as extensions in the browser)"
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
    99
b0111d3bb94e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18485
diff changeset
   100
    ^ InlineObjectClassDescription package
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
! !
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!InlineObjectClassDescription class methodsFor:'documentation'!
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
version
18484
e4b3ae6b91fd class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 18460
diff changeset
   106
    ^ '$Header$'
13019
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
   107
!
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
   108
7606d0f2ba77 added: #nameSpace
Claus Gittinger <cg@exept.de>
parents: 11910
diff changeset
   109
version_CVS
18484
e4b3ae6b91fd class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 18460
diff changeset
   110
    ^ '$Header$'
11910
a0958b306417 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
! !
16435
0ee7eff89dd7 class: InlineObjectClassDescription
Claus Gittinger <cg@exept.de>
parents: 13019
diff changeset
   112