[Xotcl] Default-value substitution using substdefault

Gustaf Neumann neumann at wu.ac.at
Sat Aug 13 12:27:45 CEST 2022


Dear Maxym,

I've looked again into your original problem, concerning measures to address
the problem earlier. The problem is that nx/xotcl are very liberal on 
what is
allowed as a property name (maybe sometimes too liberal). In the example,
the string "srv,substdefault=0b111" is interpreted as the name of the 
property.
When accessing the property, the name abbreviation rules kick in, and 
one can
access it via "-srv", but as well via every other abbreviation such as 
"-srv,subst".
Since the whole spec is treated as a name, "substdefault" does not kick in.

I have added now a warning to complain about suspicious characters in a
property name, that hints an error (here a ",").

We are close to a new release of NSF, but I will wait for your feedback....

all the best

-gustaf


% nx::Class create dzs {
     :property {srv,substdefault=0b111: {[nsf::is object ::nx::Class]}}
     :create o1
   }
::dzs
%
% o1 cget -srv
[nsf::is object ::nx::Class]
% o1 cget -srv,
[nsf::is object ::nx::Class]
% o1 cget -srv,subst
[nsf::is object ::nx::Class]


More information about the Xotcl mailing list