View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] XOTcl parameter command

From: Uwe Zdun <uwe.zdun_at_wu-wien.ac.at>
Date: Fri, 16 Apr 2004 17:44:59 +0200

Hi Attilio!

Attilio Dona` wrote:

>
> Hy,
>
> Thanks to XOTcl I'm rethinking the OO paradigm and doing metaprogramming
> easier.
>

thanks!!

> 1. Parameter introspection
>
> I use the Metaclass concept to model metainfos and use the parameter
> command to add meta-attributes runtime.
> As already You pointed out the parameter introspection (className info
> parameter) mechanism is not correct, so it is needed some parsing, with
> euristic regexp, to extract the parameters info.
>
> Also the command:
>
> className info parameter parameterName
>
> doesn't work as expected, because it ignores parameterName
>
> Have you planned to release in the near future the fix to this problem?
>
I agree, we should fix this for the next release ...

>
> 2 Parameter strange behavoir
>
> When using Parameter command I have noticed same strange behavoirs, for
> examples:
>
> case 1:
> Class X -parameter {{-x 100}}
> ::X
>
> case 2:
> Class X -parameter [list {-x 100}]
> wrong # args: ....
>
> case 1 and 2 are perfectly equivalent, so I think there is same strange
> parsing inside a C function. Also note that this is true only for
> "negative"
> attribute, ie: Class X -parameter [list {x 100}] work as expected.
>
this is because -... has a meaning for the paramters, like widget
options,
and is substituted, if you don't put two brackets around it {{..}} ...
see language
reference for more explanation.

As this is a normal substitution in Tcl, you can get around this problem
by backslashing
the "-":

Class X -parameter [list {\-x 100}]

this works.

Uwe

> Attilio
>
>
>
>
> --------------------------------------------------------------------
> CONFIDENTIALITY NOTICE
> This message and its attachments are addressed solely to the persons
> above and may contain confidential information. If you have received
> the message in error, be informed that any use of the content hereof
> is prohibited. Please return it immediately to the sender and delete
> the message. Should you have any questions, please contact us by
> replying to webmaster_at_telecomitalia.it
> <mailto:webmaster_at_telecomitalia.it>.
> Thank you
> www.telecomitalia.it
> <http://www.telecomitalia.it>
> --------------------------------------------------------------------