Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-09-17
08:51 • Ticket [929a918ec1] docs should say oo::configurable can only be mixed in with o... artifact: 3f6ccf4666 user: dkf
2024-09-03
20:24 • Ticket [929a918ec1]: 3 changes artifact: 4cf93d82c0 user: dmcooke
2024-07-10
07:18 • Add attachment obj5-bad.tcl to ticket [929a918ec1] artifact: 86d133046b user: mnsummerfield
2024-07-09
10:34 • Ticket [929a918ec1] docs should say oo::configurable can only be mixed in with o... artifact: c512141ca0 user: oehhar
10:04 • New ticket [929a918ec1]. artifact: 1387d8267a user: mnsummerfield

docs should say oo::configurable can only be mixed in with oo::configurable

Open929a918ec1b4adf0381fc1fc4609297185019ba8Created 2 years agoUpdated 2 years ago
Descriptionplain2024-07-09 10:04:54
Page: https://www.tcl.tk/man/tcl9.0/TclCmd/configurable.html#M5 This is
the description section.

I suggest adding a sentence something like:

    Note that oo::configurable classes can only be mixed in (using
`mixin`) with _other_ oo::configurable classes, not with plain oo::class
classes.

The reason for suggesting this is that I tried mixing in an oo::class with
an oo::configurable and got a very confusing "unknown method "configure":"
error message.
oehharplain2024-07-09 10:34:02
Great ! Could you give a somple sample for the error case.
Maybe, the issue is not intentional or the error message may be imporved.

Thanks,
Harald
dmcookemarkdown2024-09-03 20:24:28

This is because the mixin slot works by replacement by default. So the bare statement mixin V replaces the ::oo::configuresupport::configurable mixin that the oo::configurable metaclass adds.

It should work if you use mixin -append V instead.

I don't know why mixin defaults to replacement, instead of appending (like variable does). It doesn't make any sense.

dkfmarkdown2024-09-17 08:51:28

The real problem comes if someone joins two class hierarchies that use the property list slots in different ways (such as oo::configurable and some of the stuff that's been mooted for Tk megawidgets, though in that case they also fight over the meaning of configure as a method). There really isn't a good way around that.

I guess we need a bit better documentation to describe the limits of what's possible.

Log in (anonymous is fine) to add a comment.