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

Weblog Page

Showing 1041 - 1050 of 1561 Postings (summary)

Re: [Xotcl] constructor initialization problem

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Tue, 9 Dec 2003 14:41:02 +0100

 
 Hi marvin,
 in order to get an instance variable into the scope of an instproc, you have
 to import it via the method instvar

 Below is a simplified version of you script.

 best regards
-gustaf
==============================================
package require XOTcl;
namespace import -force xotcl::*
    
Class Elevator -parameter {{currentFloor 1}}

Elevator instproc request requestFloor {
    my instvar currentFloor

    while {1} {
        if {$currentFloor < $requestFloor} {
            incr currentFloor
            puts "going up...current floor is $currentFloor";
        }
        if {$currentFloor > $requestFloor} {
            incr currentFloor -1
            puts "going down...current floor is $currentFloor";
        }
        if {$currentFloor == $requestFloor} {
            break
        }
    }
    puts "current floor is $currentFloor";
}

set requestFloor 4;

Elevator Ride;
Ride request $requestFloor;
Ride destroy ;
==============================================
-- 
Univ.Prof. Dr.Gustaf Neumann
Abteilung für Wirtschaftsinformatik
WU-Wien, Augasse 2-6, 1090 Wien

Re: [Xotcl] problem with new

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Stefan Sobernig <stefan.sobernig_at_wu-wien.ac.at>
Date: Sat, 04 Apr 2009 14:44:58 +0200

Victor,

> Date: Tue, 24 Mar 2009 19:40:43 -0700
> From: Victor Mayevski <vitick_at_gmail.com>
> Subject: [Xotcl] problem with new
> To: Xotcl_at_alice.wu-wien.ac.at
> Message-ID:
> <eef838c10903241940v7870fd4djfa8b56bd4f6ba8d0_at_mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> In my code, when trying to create a new autonamed instance of one of
> my classes, I get the following error:
>
> [ MyClass new ]
> invalid command name "::xotcl"
>
> I don't even know where to start looking for the cause of this error
> since "new" is a built-in method of XOTcl. This error only happens
> with this particular code, other code works fine. Any
> tips/suggestions?

I never encountered this issue (or sth. apparently similar) in
an isolated piece of XOTcl code. And it is hard to tell from
the two liner as this is most certainly rooted in your application-leve
code (e.g. your MyClass declaration).

Can you provide access to your application's code or compile a
minimal, yet complete test script which reproduces the issue?

//stefan

[Xotcl] Packaging question

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Laurent Duperval <laurent.duperval_at_netergynet.com>
Date: Mon, 11 Dec 2000 08:11:34 -0500 (EST)

Hi,

What is the equivalent of building a tclIndex file for xotcl classes? I want
to build an app which is comprised of a whole bunch of modules. I'd like the
modules to be automatically loaded when I call one of the classes defined in
them. The way I do it now is:

source "module1.tcl"
source "module2.tcl"
.
.
.

There is most likely a better way but I'm not sure what it is.

Thanks,

L

-- 
MY EMAIL ADDRESS HAS CHANGED --> UPDATE YOUR ADDRESSBOOK
Laurent Duperval                   "Montreal winters are an intelligence test,
Netergy Networks - Java Center            and we who are here have failed it."
Phone: (514) 282-8484 ext. 228                                   -Doug Camilli
mailto:laurent.duperval_at_netergynet.com           Penguin Power!

Re: [Xotcl] TIP #257: Object Orientation for Tcl

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Uwe Zdun <uwe.zdun_at_wu-wien.ac.at>
Date: Tue, 27 Sep 2005 12:15:13 +0200

Zoran Vasiljevic wrote:

>
> Am 26.09.2005 um 19:40 schrieb Jeff Hobbs:
>
>>
>> TIP #257: Object Orientation for Tcl
>> http://www.tcl.tk/cgi-bin/tct/tip/257
>>
>
> First of all, this is a step in the right direction which
> should have been done *years* ago already. Many thanks to
> the creators of the TIP for their courage to open this
> can of worms again. I believe there will be many kudos
> *and* resistance from the user base of (all) OO systems
> luring arround in the Tcl community.
>
> We are using XOTcl in a commercial MT-app already 5 years
> and, personally, I doubt that a (new) piece of software
> can reach the stability, performance and functionality
> of XOTcl in a reasonable time. Hey, since the proposal
> is based on XOTcl, why just not adopt XOTcl codebase?
> This would save lots of time and effort. I do understand
> that from syntactical point of view, some XOTcl pieces
> may/should be ommited or changed to satisfy C#/C++/Java
> folks, allright, but I believe this is easier done by
> taking the XOTCl codebase and tweak it, rather to write
> all from scratch.


to let the XOTcl folks know: this was just what I responded
to the Tcl core folks when I saw the second version of the TIP. Some of
the changes
proposed are good ideas, others are just personal taste or syntactic
sugar, while still others
seem to be problematic from a conceptual point of view.
I find it hard to discuss all these issues in one big step; to have a
plan to do this
is good -- and moving away from XOTcl's model is not a problem for me --
but doing
all at once, all from scratch, without much experimentation will IMHO mean
a long, long time until we have a stable OO language in the core, which
will likely have
only a mediocre object model design.

Im my opinion, the first step must be to make the Tcl core ready for OO,
meaning
to open the C implementation of Tcl namespaces with extension points for
dispatching
of subcommands (which will be methods in OO languages) and opening up
the callstack
for extensions. These are important conceptual considerations, which are
not easily done, because
a number of overlapping concepts need integration: objects, classes,
namespaces,
ensembles; and: callstack of Tcl, callstack of any OO extension,
uplevel/upvar.
Please note, this cannot be done without designing a dispatch model for
the language
(i.e. in XOTcl's model: the dispatcher bound to the object commands,
self, and next),
and the creation schemes/destruction orders of object/classes/namespaces
must be aligned.

My point is: get these fundamentals of the object system right first,
because once
an official OO core extension is rolled out to the Tcl community, it
might be too late to
do fundamental changes. It seems natural to me, to use the existing
XOTcl code base
as a basis for experimenation and testing and do these changes to the
core first, and once
this is done, think about the details of the OO model. BTW, the issues
mentioned above are
the points where the new object system would benefit most from the
integration
with the core; due to missing extension points these are the points that
are more cumbersome
in XOTcl's C implementation. But at the moment, this is not addressed.
In the TIP it is unclear: will these fundamentals
work similar as in XOTcl or not? How is the plan to merge them with the
core? At the moment,
it is seems as though only a pure extension is planned, which is not a
good idea in my point of view.
Why not benefit from the core integration?

To answer two objections to my earlier post:

1) Backwards compatibility is not an issue here, because we're talking
about pure extensions to the known Tcl concepts. Pure Tcl programs will
run without changes.
2) I'm not at all talking about turning Tcl into an OO-only language. My
point is that each namespace should
have the capability to be lazy and automatically be turned into an
object, so that there are no frictions to
use objects and namespaces together. At the moment, each XOTcl object
lazily aquires a namespace when it needs one,
there's no reason, why this cannot be done the other way round, i.e. the
namespace aquires its object command, when
requested, or the namespace command is bound to a stub which intializes
the object structure at first use.

Cheers,

Uwe

-- 
Uwe Zdun
Department of Information Systems, Vienna University of Economics
Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746
zdun_at_acm.org, uwe.zdun_at_wu-wien.ac.at

[Xotcl] nsf 2.1.0 available via mac ports

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu.ac.at>
Date: Mon, 2 Jan 2017 11:46:56 +0100

Dear all,

NSF 2.1.0 is now available via MacPorts [1]

-gn

[1] https://www.macports.org/

Re: [Xotcl] NX memory leak

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sat, 05 Feb 2011 04:10:37 +0100

Should be fixed in git.
-gustaf

On 05.02.11 01:14, Victor Mayevski wrote:
> Hello Gustaf,
>
> I am using the latest Tcl 8.6 from SourceForge and latest NX on 32bit
> Linux. I am experiencing a pretty bad memory leak when using NX
> objects with attributes. Example code:
>
> time {Object create o; o attribute "[clock clicks] [clock clicks]";o
> destroy} 1000000
>
> Within like 3 minutes the memory usage grows to around 300meg.
>
> Thanks,
>
> Victor
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl

Re: [Xotcl] info method behaviour (interface proposal)

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Tue, 14 Aug 2001 04:10:01 +0200

> Such think sould be implemented internally (and not so unclean) and can be
> used also for procs and mixins (instance or class).
>
> $object info fullMethods myMethod
> sould return list
> {methodName methodType definitionPlace}
>
> for example
>
> Class A
> A instproc foo1
> A instproc foo2
> Class B
> B instproc foo1
>
> B b
> b proc foo3
>
> b info fullMethods
>
> >{foo3 proc b} {foo1 instproc B} {foo2 instproc A}

 this is more or less what we have currently scheduled for 0.86
 used as result for [self next] and [.. procsearch ....].
 actually, having another order, such it has the same order
 as in the definition.

 {b foo3 proc} {B instproc foo1} {A instproc foo2}

 however, it would be still nicer to have methods as objects.

 {m1 m2 m3}
 
  [m1 class] -> Proc
  [m2 class] -> Instproc
  [m3 name] -> foo2

 this would allow more methods on procs/instprocs and this is
 extensible with more metadata (e.g. pre/post conditions,
 c-code vs. tcl-code -> getting rid of the distinction of instcommand vs.
 instprocs ....).
 
 Another interesting idea is to use aggregations for methods.
 
   Class C
   C proc f {} {...}
   C instproc m {} {...}

 would lead to
  C::f
  C::m
 where C::f amd C::m being of class Proc or Instproc
 
 one could even use

   Class C
   Proc C::f {} {...}
   Instproc C::m {} {....}

 In the most straightforward case, this would exclude having instproc and
 procs of the same name, which is not great
 (OTH, other OO languages do not allow these either)... the cool part is
 that it is very easy to find out, where the command is defined, and
 moving, renaming etc. could work with the standard move/rename etc. methods,
 and "info procs" is not much more than a specialized "info children"....the
 long list of things in "info info" can be reduce....

 but there are as well many arguments against it. one thing is memory consumption.
 to even think about it, we should find a way of defining lightweight objects....

 -gustaf

PS: no, i am not thinking about implementing it, i am just thinking loudly.
 
 

[Xotcl] Affiliate Programs and MORE !!!

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Roxanne <123kash_at_excite.com>
Date: Thu, 3 Aug 2006 19:17:41 -0400 (EDT)



Hi friends,

On my site you will find advertising and affiliate programs.

I use these on a daily basis to advertise and promote my programs.

All are 100% free to join.

It does not cost anything to look now !!

You will find something that will help you to succeed.

Go to http://myweb.ecomplanet.com/rock1929/

To your success,

Roxanne Johnson


Ps:You have to check out this site:
Just Found Over 200 places to Advertise---*AWESOME SITE*
http://www.nexusgate.com/nexus/?go=3561


More sites to Consider!!



FREE ADVERTISING at its best !!
http://textomatic.com/?rockie1


Free Ad Blasting Software

http://www.internetmoneytools.com/listspawner/refer.php?rid=17


ZonedForAds---Awesome Site!!!
http://zonedforads.com/sl/g.php?r=4471


Mr Overdeliver is doing it Again !!
http://www.mroverdeliver.com/mrod/?partner=5465


Signup for free and receive $10 as a Free Reward:
http://hits4pay.com/members/index.cgi?123kash

You Have to see it to Believe it!!!
http://www.viralmarketinggiveaway.com/vmg/?go=5715


Launchnet---*Better Internet Services*
http://www.telebay.com/newfiegirl/launchnet.html

Gary Mccaffreys *FREE POWER AFFILIATES KIT*

http://www.poweraffiliatekit.com/?id=2335

Earn $$$ With Your Pals ! !
http://earnpals.com/?10196

Blast your ADS to THOUSANDS of Blogs with1 CLICK !!

http://blogadblasting.com/?123kash


Good Luck!!!


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

[Xotcl] [NX] Passing arguments to an object's constructor

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Arthur Schreiber <schreiber.arthur_at_googlemail.com>
Date: Mon, 28 Nov 2011 21:53:35 +0100

Hello everyone,

Is there any way to pass arguments to the init method in NX (as in XOTcl)?
Or is using object parameters on initialization the preferred way in NX
to initialize an objects instance variables?

Thanks,
Arthur

Re: [Xotcl] Troubles with upvar and the trace mechanism from the tutorial.

Created by hypermail2xowiki importer, last modified by Stefan Sobernig 02 Jan 2017, at 11:15 PM

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sun, 19 Nov 2006 22:02:40 +0100

Ramam,

you should change "upvar" to "my upvar" as in the following method

X instproc bar {ar args} {
  puts "bar"
  my upvar $ar arr
  puts "upvard"
  barray arr
}

otherwise you will upvar to the filter. The plain tcl upvar is not
very useful, when interceptors are added/removed dynamically.

Therefore, xotcl provides the methods "upvar" and "uplevel"
to achieve interceptor transparency. This means that an upvar/uplevel
refers always to the last non-interceptor method (skipping
filters and mixins).

best regards
-gustaf neumann



Shishir Ramam schrieb:
>
> I am passing an array name by reference across an instproc.
>
> The vanilla version works just fine (see creation of x1 midway through
> the code segment).
>
> To add some debugging in, I essentially used the trace example from
> the tutorial, and funnily,
> the upvar stopped doing it's job (see error on creating x2 towards the
> end of the code segment).
>
> To get rudimentary debug control of the parray proc, I copied it into
> a proc called barray. None of the logic is changed -
> just my crude attempt at adding breadcrumbs.
>
> I have included the output at the end of the code segment.
>
> Running Windows XP Pro + Active Tcl 8.4.13 + XoTcl 1.4.0.
>
> thanks for all help.
> -shishir
>
> <CODE SEGMENT>
> package require XOTcl
> namespace import ::xotcl::*
>
>
> proc barray {a {pattern "*"}} {
> puts "barray"
> upvar 1 $a arr
> if {![array exists arr]} {
> error "\"$a\" isn't an array"
> }
> set maxl 0
> foreach name [lsort [array names arr $pattern]] {
> if {[string length $name] > $maxl} {
> set maxl [string length $name]
> }
> }
> set maxl [expr {$maxl + [string length $a] + 2}]
> foreach name [lsort [array names arr $pattern]] {
> set nameString [format %s(%s) $a $name]
> puts stdout [format "%-*s = %s" $maxl $nameString $arr($name)]
> }
> }
>
> Class X
>
> X instproc bar {ar args} {
> puts "bar"
> upvar $ar arr
> puts "upvard"
> barray arr
> }
>
>
>
> X instproc init {args} {
> array set arr {a 1 b 2}
> parray arr
> my bar arr
> }
>
> X x1
>
>
> Object Trace
> Trace set traceStream stdout
> Trace proc openTraceFile name {
> my set traceStream [open $name w]
> }
> Trace proc closeTraceFile {} {
> close $Trace::traceStream
> my set traceStream stdout
> }
> Trace proc puts line {
> puts $Trace::traceStream $line
> }
> Trace proc add className {
> $className instfilter [concat [$className info filter] traceFilter]
> }
>
> Object instproc traceFilter args {
> # don't trace the Trace object
> if {[string equal [self] ::Trace]} {return [next]}
> set context "[self class]->[self callingproc]"
> set method [self calledproc]
> switch -- $method {
> proc -
> instproc {::set dargs [list [lindex $args 0] [lindex $args 1] ...] }
> default {::set dargs $args }
> }
> Trace::puts "CALL $context> [self]->$method $dargs"
> set result [next]
> Trace::puts "EXIT $context> [self]->$method ($result)"
> return $result
> }
>
> Trace add X
>
> X x2
>
> </CODE SEGMENT>
>
> ------------
>
> <OUTPUT>
> arr(a) = 1
> arr(b) = 2
> bar
> upvard
> barray
> arr(a) = 1
> arr(b) = 2
> CALL ::xotcl::Object->> ::x2->cleanup
> EXIT ::xotcl::Object->> ::x2->cleanup ()
> CALL ::xotcl::Object->> ::x2->configure
> EXIT ::xotcl::Object->> ::x2->configure (0)
> CALL ::xotcl::Object->> ::x2->init
> arr(a) = 1
> arr(b) = 2
> CALL ::xotcl::Object->init> ::x2->bar arr
> bar
> upvard
> barray
> "arr" isn't an array
> </OUTPUT>
>
> ----
>
> <ERRORINFO>
> % set errorInfo
> "arr" isn't an array
> while executing
> "error "\"$a\" isn't an array""
> (procedure "barray" line 5)
> invoked from within
> "barray arr"
> (procedure "bar" line 6)
> invoked from within
> "next"
> (procedure "bar" line 13)
> ::x2 ::xotcl::Object->traceFilter
> invoked from within
> "my bar arr"
> (procedure "init" line 5)
> invoked from within
> "next"
> (procedure "init" line 13)
> ::x2 ::xotcl::Object->traceFilter
> ::X ::xotcl::Class->recreate
> ::X ::xotcl::Class->create
> ::X ::xotcl::Class->unknown
> invoked from within
> "X x2"
> (file "c:/temp/trace_trouble.tcl" line 81)
> invoked from within
> "source c:/temp/trace_trouble.tcl"
> </ERRORINFO>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>

Next Page