No registered users in community xowiki
in last 10 minutes
in last 10 minutes
[Xotcl] error whilst following tutorial
From: Bernard Devlin <bdrunrev_at_gmail.com>
Date: Mon, 22 Dec 2008 19:41:11 +0000
Hi, First of all I'm new to Tcl. I've been reading around it for the past
10 days or so, and I like it very much. I saw there were lots of OO
implementations on top of it, which is kind of mind-blowing when one is used
to languages that have 'the-one-true-way' to do OO.
In the languages I've learned in the past quite often OO just seemed to get
in the way. However, I've finally got to the point in my programming
development where I'm feeling restricted by languages like Python and Java.
Hence my delight at re-discovering Tcl for myself.
When I did a quick survey of the OO implementations in Tcl, I was
immediately drawn to OTcl, and then disappointed to see it hadn't been
enhanced over the last decade. Until I discovered XOTcl :-) This seems to
me to be the most power OO system I've looked at - as powerful as Smalltalk,
only for me Tcl is a more amenable language.
I'm using Artur's 0.83 image of XOTclIDE (which has XOTcl 1.6 bundled inside
it). Of course, I'm really enjoying Artur's IDE. I finally feel like I've
got the right combination of language and toolset to extend my programming
ability. I am so grateful that XOTcl and the IDE have been made publicly
available.
However, following the main XOTcl tutorial (
http://media.wu-wien.ac.at/doc/tutorial.html) in the IDE, I've got a
problem. After running 'do it' on each stage of the tutorial, when I get to
this line:
set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \
-playerRole PLAYER]
I get an error. Here's the stack trace:
::bayernMunich::__#WZ: unable to dispatch method 'name' during
'::bayernMunich::__#WZ name'
::bayernMunich::__#WZ ::xotcl::Object->configure
::Player ::xotcl::Class->create
::Player ::xotcl::Class->new
invoked from within
"Player new -childof ::bayernMunich -name {Franz Beckenbauer} -playerRole
PLAYER"
("eval" body line 1)
invoked from within
"eval Player new -childof [self] $args"
(procedure "newPlayer" line 5)
::bayernMunich ::SoccerTeam->newPlayer
invoked from within
"bayernMunich newPlayer -name "Franz Beckenbauer" \
-playerRole PLAYER"
(in namespace eval "::" script line 1)
invoked from within
"namespace eval :: $string"
(procedure "evalString" line 3)
::IDE::System->evalString
invoked from within
"IDE::System evalString $string"
(procedure "evalString" line 3)
::xotcl::__#HM::_at_editor ::IDE::Editor->evalString
invoked from within
"my evalString $sel"
(procedure "evalSelection" line 5)
::xotcl::__#HM::_at_editor ::IDE::Editor->evalSelection
invoked from within
"::xotcl::__#HM::_at_editor evalSelection"
invoked from within
".workspace1.#workspace1#mb.#workspace1#mb#menu8 invoke active"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke active]"
(procedure "tk::MenuInvoke" line 50)
invoked from within
"tk::MenuInvoke .workspace1.#workspace1#mb.#workspace1#mb#menu8 1"
(command bound to event)
I'm not sure if this is because XOTcl has changed since the tutorial was
written, or if it is because I'm just running through the tutorial in the
workspace.
Regards, Bernard
Date: Mon, 22 Dec 2008 19:41:11 +0000
Hi, First of all I'm new to Tcl. I've been reading around it for the past
10 days or so, and I like it very much. I saw there were lots of OO
implementations on top of it, which is kind of mind-blowing when one is used
to languages that have 'the-one-true-way' to do OO.
In the languages I've learned in the past quite often OO just seemed to get
in the way. However, I've finally got to the point in my programming
development where I'm feeling restricted by languages like Python and Java.
Hence my delight at re-discovering Tcl for myself.
When I did a quick survey of the OO implementations in Tcl, I was
immediately drawn to OTcl, and then disappointed to see it hadn't been
enhanced over the last decade. Until I discovered XOTcl :-) This seems to
me to be the most power OO system I've looked at - as powerful as Smalltalk,
only for me Tcl is a more amenable language.
I'm using Artur's 0.83 image of XOTclIDE (which has XOTcl 1.6 bundled inside
it). Of course, I'm really enjoying Artur's IDE. I finally feel like I've
got the right combination of language and toolset to extend my programming
ability. I am so grateful that XOTcl and the IDE have been made publicly
available.
However, following the main XOTcl tutorial (
http://media.wu-wien.ac.at/doc/tutorial.html) in the IDE, I've got a
problem. After running 'do it' on each stage of the tutorial, when I get to
this line:
set fb [bayernMunich newPlayer -name "Franz Beckenbauer" \
-playerRole PLAYER]
I get an error. Here's the stack trace:
::bayernMunich::__#WZ: unable to dispatch method 'name' during
'::bayernMunich::__#WZ name'
::bayernMunich::__#WZ ::xotcl::Object->configure
::Player ::xotcl::Class->create
::Player ::xotcl::Class->new
invoked from within
"Player new -childof ::bayernMunich -name {Franz Beckenbauer} -playerRole
PLAYER"
("eval" body line 1)
invoked from within
"eval Player new -childof [self] $args"
(procedure "newPlayer" line 5)
::bayernMunich ::SoccerTeam->newPlayer
invoked from within
"bayernMunich newPlayer -name "Franz Beckenbauer" \
-playerRole PLAYER"
(in namespace eval "::" script line 1)
invoked from within
"namespace eval :: $string"
(procedure "evalString" line 3)
::IDE::System->evalString
invoked from within
"IDE::System evalString $string"
(procedure "evalString" line 3)
::xotcl::__#HM::_at_editor ::IDE::Editor->evalString
invoked from within
"my evalString $sel"
(procedure "evalSelection" line 5)
::xotcl::__#HM::_at_editor ::IDE::Editor->evalSelection
invoked from within
"::xotcl::__#HM::_at_editor evalSelection"
invoked from within
".workspace1.#workspace1#mb.#workspace1#mb#menu8 invoke active"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke active]"
(procedure "tk::MenuInvoke" line 50)
invoked from within
"tk::MenuInvoke .workspace1.#workspace1#mb.#workspace1#mb#menu8 1"
(command bound to event)
I'm not sure if this is because XOTcl has changed since the tutorial was
written, or if it is because I'm just running through the tutorial in the
workspace.
Regards, Bernard