See attached program. Tried in 4.2.0 Win 10, 5.0.0 r12286 Debian 10.
According to the manual, the program should raise a syntax condition when attempting to set sizecontainer::size to a non-whole number.
Adding a trace statement to the attribute set body shows no activity.
I agree with the manual that this would be a useful feature for attribute validation, but it may be easier to change the manual to reflect what the interpreter appears to do.
Anonymous
You have an error in your program. The lines
sc.size = 1 -- succeeds
say sc.size
don't invoke the attribute methods, but they are rather accessing the compound variable SC.SIZE. These lines should be
sc~size = 1 -- succeeds
say sc~size
using the ~ to invoke the methods.
Oh, how dumb of me.
Thanks for pointing out the error, Rick.