-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backwards compatibility for oo.tcl #293
Comments
I'll have a think about this. I'm probably not inclined to bake in backward compatibility, but I'll consider an approach that will make it easy for you to do this in your own code without modifying oo.tcl |
So can't you simply create your own constructor that behaves as you want rather than using the default constructor? e.g.
Just need to do this for each class you create where you want to use the previous behaviour. |
... and that also is easily automated for sugar:
You could even sugar it further than that, pretty easily, by rolling that functionality into your own wrapper of the |
Following on from #248...
Before 5af9d6a, this worked without complaint:
Since then, it generates an error:
t defaultconstructor, v3 is not a class variable
I don't care about v3, I just don't want it to cause any errors (this is a much simplified test-case whereas in reality there are many variables I'm not interested in, but it's huge work to sort in our existing code).
As a workaround, I have been manually patching out the "return -code error..." statement that causes it to fail, restoring previous behaviour.
But I'd rather not have to patch at all, and it would seem that this is fairly easily fixed by adding something like the following change to allow selectable behaviour:
This maintains the current behaviour, but allows regression to the previous e.g.
There may be a better way, but this works for me.
The text was updated successfully, but these errors were encountered: