Check-in [0299230758]

Login

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

Overview
Comment:Created TIP 516: More OO Slot Operations
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:0299230758b9a38553c1f0e38298bd600cc6e28a22cac348e343e174d700c1f0
User & Date: dkf 2018-09-07 13:41:04
Context
2018-09-08
12:53
TIP 516: xref to implementation and some notes based on that experience check-in: e6d31c3d8a user: dkf tags: trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

1

2
3
4
5
6
7
8
...
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},
................................................................................
	"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}

>







 







|
|
1
2
3
4
5
6
7
8
9
...
513
514
515
516
517
518
519
520
521
{"tip": {
	"516":{"url":"./tip/516.md","keywords":"Tcl, TclOO","created":"7-Sept-2018","post-history":"","state":"Draft","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 516: More OO Slot Operations","author":["Donal K. Fellows <donal.k.fellows@manchester.ac.uk>"],"is-jest":false},
	"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},
................................................................................
	"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": 516
}, "@timestamp": 1536327640}

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/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>







>
>
>
>
>
>
>







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/516.md'>516</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top'># TIP 516: More OO Slot Operations</td>
</tr>
<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>

Added tip/516.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
# TIP 516: More OO Slot Operations
	Author:         Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        7-Sept-2018
	Post-History:   
	Tcl-Version:	8.7
	Keywords:       Tcl, TclOO
-----

# Abstract

This TIP proposes to add some more operations to slots by updating the class
that implements them.

# Rationale

Currently slots support **setting** (i.e., replacing all current slot items
with a different list of items), **appending** (i.e., adding onto the end of
the list), and **clearing** (i.e., setting the list to an empty list); the
former two cases are moderated by the need for slot items to be unique, but
that is a constraint enforced at the lower level. However, other basic
operations are conceivable too, such as **prepending** an item
and **removing** an item (with the latter needing a little care as it requires
normalisation of the slot items). An example of how this last use case might
be useful is when _removing_ a behaviour from an object by _removing_ a mixin
from it; that's possible to do with the existing code, but quite awkward
because it requires replacing the list of slot items with another list, and so
it is an operation that we should provide by default.

# Proposal

This will add two new methods to the `::oo::Slot` class:

  * _slot_ `-prepend` ?_item_ ...?

    This inserts the _item_ (or items) at the front of the list of items in
    the slot. If there are no such arguments given, this does nothing; it is
    not an error to prepend no items.

  * _slot_ `-remove` ?_item_ ...?

    This removes the _item_ (or items) from the list of items in the slot. If
    an _item_ is not present in the slot, this does nothing; it is not an
    error to remove a non-present item. If there are no such items in the
    arguments, this does nothing; it is not an error to remove no items.

# Implementation

To be done...

# Copyright

This document has been placed in the public domain.