[Xotcl] reason for error

Gustaf Neumann neumann at wu.ac.at
Wed Jul 25 18:43:10 CEST 2012


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



More information about the Xotcl mailing list