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