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

Re: [Xotcl] reason for error

From: Gustaf Neumann <neumann_at_wu.ac.at>
Date: Wed, 25 Jul 2012 18:43:10 +0200

Am 25.07.12 16:48, schrieb Victor Mayevski:
> Hello Gustaff,
>
> What is the reason for following error/behavior:
>
> ClassX create c1; #ClassX has several subclasses
> c1 delete method m1
> Error: ::c1: cannot delete object specific method m1
the message says that it cant delete the method "m1", probably because
it does not exist


    package req nx::test

    nx::Class create ClassX
    ClassX create c1

    ? {c1 delete method m1} {::c1: cannot delete object specific method
'm1'}

    # define a method m1 and check, if it exists
    c1 public method m1 {} {...}
    ? {c1 info methods} "m1"

    # delete the method, does no raise an exception
    ? {c1 delete method m1} {}

> I get a similar error for "c1 delete property p1"
> Why am I not able to delete object specific methods/properties?
The following is supposed to work:

    c1 property foo
    ? {c1 info methods} "foo"
    ? {c1 delete property foo} {}
    ? {c1 info methods} ""

-gustaf neumann

-- 
Univ.Prof. Dr. Gustaf Neumann
Institute of Information Systems and New Media
WU Vienna
Augasse 2-6, A-1090 Vienna, AUSTRIA