Check-in [f75ee55997]

Login
FlightAware bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:New TIP #515. Fix link in TIP #514.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:f75ee55997daa1296616051cb4af5dbf9e7265b8db61ef03334d8be9b13d6303
User & Date: jan.nijtmans 2018-09-07 09:52:12
Context
2018-09-07
13:41
Created TIP 516: More OO Slot Operations check-in: 0299230758 user: dkf tags: trunk
09:52
New TIP #515. Fix link in TIP #514. check-in: f75ee55997 user: jan.nijtmans tags: trunk
2018-09-06
12:54
Describe TCL_IO_FAILURE and TCL_AUTO_LENGTH. Also describe the changes to ckalloc()/Tcl_Alloc() and friends. check-in: 90090d1fd8 user: jan.nijtmans tags: trunk
Changes

Changes to index.json.

1

2
3
4
5
6
7
8
...
511
512
513
514
515
516
517
518
519
{"tip": {

	"514":{"url":"./tip/514.md","keywords":"Tcl","created":"20-Aug-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 514: Platform differences in handling int/wide","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
	"513":{"url":"./tip/513.md","keywords":"Tcl,data structure","created":"02-Aug-2017","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 513: Better support for 'agendas' as arrays, dictionaries or lists","author":["Florian Murr <florian.murr@siemens.com>"],"is-jest":false},
	"512":{"url":"./tip/512.md","keywords":"Tcl","created":"25-June-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 512: No stub for Tcl_SetExitProc()","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
	"511":{"url":"./tip/511.md","keywords":"Tcl,threads","created":"14-June-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 511: Implement Tcl_AsyncMarkFromSignal()","author":["Christian Werner <undroidwish@googlemail.com>"],"is-jest":false},
	"510":{"url":"./tip/510.md","keywords":"Tk","created":"5-Jun-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 510: Add Rbc to Tk","author":["René Zaumseil <r.zaumseil@freenet.de>"],"is-jest":false},
	"509":{"url":"./tip/509.md","keywords":"Tcl,threads","created":"24-May-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 509: Implement reentrant mutexes on all platforms","author":["Frédéric Bonnet <fredericbonnet@free.fr>"],"is-jest":false},
	"508":{"url":"./tip/508.md","keywords":"Tcl,array","created":"13-May-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 508: New subcommand [array default]","author":["Frédéric Bonnet <fredericbonnet@free.fr>"],"is-jest":false},
................................................................................
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <ericm@ajubasolutions.com>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news comp.lang.tcl","author":["Brent Welch <welch@acm.org>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Larry W. Virden <lvirden@cas.org>","Larry W. Virden <lvirden@yahoo.com>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Don Porter <dgp@users.sourceforge.net>","Mo DeJong <no@spam.com>","Larry W. Virden <lvirden@yahoo.com>","Kevin Kenny <kennykb@acm.org>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","post-history":"","state":"Active","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <donal.fellows@cs.man.ac.uk>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <ouster@pacbell.net>"],"is-jest":false},
	"@min": 0,
	"@max": 514
}, "@timestamp": 1536090607}

>







 







|
|
1
2
3
4
5
6
7
8
9
...
512
513
514
515
516
517
518
519
520
{"tip": {
	"515":{"url":"./tip/515.md","created":"7-Sept-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 515: Level Value Reform","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
	"514":{"url":"./tip/514.md","keywords":"Tcl","created":"20-Aug-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 514: Platform differences in handling int/wide","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
	"513":{"url":"./tip/513.md","keywords":"Tcl,data structure","created":"02-Aug-2017","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 513: Better support for 'agendas' as arrays, dictionaries or lists","author":["Florian Murr <florian.murr@siemens.com>"],"is-jest":false},
	"512":{"url":"./tip/512.md","keywords":"Tcl","created":"25-June-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 512: No stub for Tcl_SetExitProc()","author":["Jan Nijtmans <jan.nijtmans@gmail.com>"],"is-jest":false},
	"511":{"url":"./tip/511.md","keywords":"Tcl,threads","created":"14-June-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 511: Implement Tcl_AsyncMarkFromSignal()","author":["Christian Werner <undroidwish@googlemail.com>"],"is-jest":false},
	"510":{"url":"./tip/510.md","keywords":"Tk","created":"5-Jun-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 510: Add Rbc to Tk","author":["René Zaumseil <r.zaumseil@freenet.de>"],"is-jest":false},
	"509":{"url":"./tip/509.md","keywords":"Tcl,threads","created":"24-May-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 509: Implement reentrant mutexes on all platforms","author":["Frédéric Bonnet <fredericbonnet@free.fr>"],"is-jest":false},
	"508":{"url":"./tip/508.md","keywords":"Tcl,array","created":"13-May-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"","type":"Project","title":"# TIP 508: New subcommand [array default]","author":["Frédéric Bonnet <fredericbonnet@free.fr>"],"is-jest":false},
................................................................................
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <ericm@ajubasolutions.com>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news comp.lang.tcl","author":["Brent Welch <welch@acm.org>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Larry W. Virden <lvirden@cas.org>","Larry W. Virden <lvirden@yahoo.com>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <a.kupries@westend.com>","Donal K. Fellows <fellowsd@cs.man.ac.uk>","Don Porter <dgp@users.sourceforge.net>","Mo DeJong <no@spam.com>","Larry W. Virden <lvirden@yahoo.com>","Kevin Kenny <kennykb@acm.org>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","post-history":"","state":"Active","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <donal.fellows@cs.man.ac.uk>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <ouster@pacbell.net>"],"is-jest":false},
	"@min": 0,
	"@max": 515
}, "@timestamp": 1536313728}

Changes to index.md.

115
116
117
118
119
120
121







122
123
124
125
126
127
128
<th>#</th>
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
</tr></thead><tbody>








<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/514.md'>514</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 514: Platform differences in handling int/wide</td>
</tr>







>
>
>
>
>
>
>







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<th>#</th>
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
</tr></thead><tbody>

<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/515.md'>515</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 515: Level Value Reform</td>
</tr>
<tr class='project projectdraft projectdraft87 project87'>
<td valign='top'><a href='./tip/514.md'>514</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 514: Platform differences in handling int/wide</td>
</tr>

Changes to tip/514.md.

89
90
91
92
93
94
95
96
97
98
99
100
101

 * If you still really want to protect some command argument from overflowing, Use Tcl\_GetWideIntFromObj() in this command, and use "string is wide" to check for proper range.
   But - still better - is use Tcl\_GetWideIntFromObj(), with falling back to Tcl\_GetBignumFromObj() if the range requires it.
   That's what Tcl itself is doing almost everywhere to prevent under/overflow errors.

# Implementation

Currently, the proposed implementation is available in the [all-wideint branch]
(https://core.tcl.tk/tcl/timeline?r=tip-514).

# Copyright

This document has been placed in the public domain.







|





89
90
91
92
93
94
95
96
97
98
99
100
101

 * If you still really want to protect some command argument from overflowing, Use Tcl\_GetWideIntFromObj() in this command, and use "string is wide" to check for proper range.
   But - still better - is use Tcl\_GetWideIntFromObj(), with falling back to Tcl\_GetBignumFromObj() if the range requires it.
   That's what Tcl itself is doing almost everywhere to prevent under/overflow errors.

# Implementation

Currently, the proposed implementation is available in the [tip-514 branch]
(https://core.tcl.tk/tcl/timeline?r=tip-514).

# Copyright

This document has been placed in the public domain.

Added tip/515.md.

























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# TIP 515: Level Value Reform
	Author:         Jan Nijtmans <jan.nijtmans@gmail.com>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        7-Sept-2018
	Post-History:   
	Tcl-Version:	8.7
-----

# Abstract

Proposes reformed handling of Tcl level values. This TIP is inspired by TIP #502, which handles "index" values, realizing that "level" values have
kind of the same problems as described there.

# Background

Many Tcl programmers may be surprised by these results

	% apply {{} {uplevel -4294967294 {puts OK}}}
	bad level "-4294967294"  (OK, this is expected ....)
	% apply {{} {uplevel -4294967295 {puts OK}}}
	OK
	% apply {{} {uplevel -4294967296 {puts OK}}}
	invalid command name "-4294967296"

I would expect the same "bad level" error in all 3 cases.
Or:

	% proc todo arg {puts $arg}
	% apply {{} {uplevel todo OK}}
	OK
	% proc 2do arg {puts $arg}
	% apply {{} {uplevel 2do OK}}
	bad level "2do"

Why can't we call a command "2do"? The parser appears to be confused because the command name starts with a digit.

# Proposal

Revise the parsing of values used as level values to accept all
integer representations acceptable to **expr**, optionally
preceded by "#".

Although this suggests an unlimited range of valid levels,
in practice all out-of-range levels (either a negative number,
either a number higher than the actual available number of levels) ,
will result in a "bad level" error.

# Compatibility

Examples like the ones in the Background above will incompatibly
change from one outcome to a different outcome.
This is a true incompatibility, but it is difficult to believe anyone
actually desires the outlier behaviors illustrated above, much less has
code that relies on them.

New behavior, one that succeeded in Tcl 8.6 but should actually fail:

	% apply {{} {uplevel -4294967295 {puts OK}}}
	bad level "-4294967295"

Another example, of a situation that failed in Tcl 8.6 but should succeed:

    $ proc 2do arg {puts $arg}
	% apply {{} {uplevel 2do OK}}
	OK

# Implementation

Currently, the proposed implementation is available in the [tip-515 branch]
(https://core.tcl.tk/tcl/timeline?r=tip-515).

# Copyright

This document has been placed in the public domain.