Check-in [072c7a281d]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:More formatting tweaking
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 072c7a281d3e418504a7aba1b757e4e6008d31c407ff35bb42c41075bf1a35c1
User & Date: dkf 2018-03-08 14:24:38.073
Context
2018-03-09
10:05
tip490 oo for msgcat: re-changed "option" to "extension" check-in: 016afc2026 user: oehhar tags: trunk
2018-03-08
14:24
More formatting tweaking check-in: 072c7a281d user: dkf tags: trunk
14:19
Split out the discussion. check-in: 0b38fa0683 user: dkf tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to index.json.

cannot compute difference between binary files

Changes to index.md.
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<td valign='top'># TIP 491: Threading Support: phasing out non-threaded builds</td>
</tr>
<tr class='invote'>
<td valign='top'><a href='./tip/490.md'>490</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Voting</td>
<td valign='top'># TIP 490: msgcat for tcloo</td>
</tr>
<tr class='project projectfinal projectfinal87 project87'>
<td valign='top'><a href='./tip/489.md'>489</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Final</td>
<td valign='top'># TIP 489: Add image widget command to the Tk canvas</td>







|







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<td valign='top'># TIP 491: Threading Support: phasing out non-threaded builds</td>
</tr>
<tr class='invote'>
<td valign='top'><a href='./tip/490.md'>490</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Voting</td>
<td valign='top'># TIP 490: msgcat for TclOO</td>
</tr>
<tr class='project projectfinal projectfinal87 project87'>
<td valign='top'><a href='./tip/489.md'>489</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Final</td>
<td valign='top'># TIP 489: Add image widget command to the Tk canvas</td>
Changes to tip/490.md.
1
2
3
4
5
6
7
8
# TIP 490: msgcat for tcloo
	Author:         Harald Oehlmann <[email protected]>
	State:          Voting
	Type:           Project
	Vote:           In progress
	Created:        07-Dec-2017
	Post-History:
	Keywords:       msgcat, oo
|







1
2
3
4
5
6
7
8
# TIP 490: msgcat for TclOO
	Author:         Harald Oehlmann <[email protected]>
	State:          Voting
	Type:           Project
	Vote:           In progress
	Created:        07-Dec-2017
	Post-History:
	Keywords:       msgcat, oo
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
    set message [namespace eval $messagenamespace [list ::msgcat::mc $message]]
    ...
}
</pre>

Examples with the 4 use-cases:

### Use-case 1: the package does not use OO

<pre>
namespace eval ::N1 {
    proc m1 {} {msgcat::mcpackagenamespaceget}
}

% N1::m1
-> ::N1
</pre>

### Use-case 2: call within class definition script

<pre>
% namespace eval ::N2Class {
    oo::class create C1 {puts "pns=[msgcat::mcpackagenamespaceget]"}
}
-> pns=::N2Class
-> ::N2Class::C1
</pre>

### Use-case 3: The package implementation is done by a class

<pre>
namespace eval ::N3Class {
    oo::class create C1
    oo::define C1 method m1 {msgcat::mcpackagenamespaceget}
}

# The class object may be used in another namespace

namespace eval ::N3Obj {
    set O1 [::N3Class::C1 new]
}

% $N3Obj::O1 m1
-> ::N3Class
</pre>

### Use-case 4: The package implementation is done by a classless object

<pre>
namespace eval ::N4 {
    oo::object create O1
    oo::objdefine O1 method m1 {} {msgcat::mcpackagenamespaceget}
}

% N4::O1 m1
-> ::N4
</pre>

### Manually overwrite the package namespace by namespace eval

As stated in the introduction, current oo code might have used an explicit `namespace eval packagenamespace` to make msgcat work. This should still be supported:

<pre>
namespace eval ::N4 {
    oo::object create O1
    oo::objdefine O1 method m1 {} {
        namespace eval ::N5 { msgcat::mcpackagenamespaceget}
    }







|

|
|
|
|

|
|
|

|

|
|
|
|
|
|
|

|

|
|
|
|
|

|

|
|
|

|
|
|

|

|
|
|
|
|

|
|
|

|

|







186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
    set message [namespace eval $messagenamespace [list ::msgcat::mc $message]]
    ...
}
</pre>

Examples with the 4 use-cases:

1. First use case: the package does not use OO

	<pre>
	namespace eval ::N1 {
	    proc m1 {} {msgcat::mcpackagenamespaceget}
	}

	% N1::m1
	-> ::N1
	</pre>

2. Second use case: call within class definition script

	<pre>
	% namespace eval ::N2Class {
	    oo::class create C1 {puts "pns=[msgcat::mcpackagenamespaceget]"}
	}
	-> pns=::N2Class
	-> ::N2Class::C1
	</pre>

3. Third use case: The package implementation is done by a class

	<pre>
	namespace eval ::N3Class {
	    oo::class create C1
	    oo::define C1 method m1 {msgcat::mcpackagenamespaceget}
	}

	# The class object may be used in another namespace

	namespace eval ::N3Obj {
	    set O1 [::N3Class::C1 new]
	}

	% $N3Obj::O1 m1
	-> ::N3Class
	</pre>

4. Fourth use case: The package implementation is done by a classless object

	<pre>
	namespace eval ::N4 {
	    oo::object create O1
	    oo::objdefine O1 method m1 {} {msgcat::mcpackagenamespaceget}
	}

	% N4::O1 m1
	-> ::N4
	</pre>

### Manually overwriting the package namespace by namespace eval

As stated in the introduction, current OO code might have used an explicit `namespace eval packagenamespace` to make msgcat work. This should still be supported:

<pre>
namespace eval ::N4 {
    oo::object create O1
    oo::objdefine O1 method m1 {} {
        namespace eval ::N5 { msgcat::mcpackagenamespaceget}
    }