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

Weblog Page

Showing 641 - 650 of 1561 Postings (summary)

[Xotcl] xotcl::upvar-compat isn't compatible

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

From: Jeff Hobbs <jeffh_at_activestate.com>
Date: Wed, 07 May 2008 13:18:00 -0700

Someone asked on chat why the unknown stuff (e.g., typing an unknown
command name into the console) in tkcon "broke" after doing:

package require xotcl::upvar-compat

I looked at the code there, and the uplevel redef isn't actually
compatible because it ignores error codes. Instead of:

        ::xotcl::tcl_uplevel 1 \
                [list eval ::xotcl::tcl_uplevel $lvl $args]

you need something like:

        set code [catch {::xotcl::tcl_uplevel 1 \
                [list eval ::xotcl::tcl_uplevel $lvl $args]} msg]
        return -code $code $msg

Just an FYI for anyone using it. I'm not sure what effect this would
have, if any, on the xotcl use case.

Regards,

Jeff

[Xotcl] re: install problem

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

From: jim <jamesmc_at_localnet.com>
Date: Tue, 9 Dec 2003 06:33:56 -0500

Hi Uwe-
 
I finally figured out what i was doing wrong that was causing my mail to
get held up by a moderator. I use multiple accounts for email.
I signed up to the mail list and was using one of my other mail accounts
to try and post to the list so it didnt recognize me as a list
member. I solved the install problems actually a few hours ago.
 
sorry everyone for the multiple posts. i will try to watch what account
i am using so it wont happen again.
 
thanks,
marvin

Re: [Xotcl] coroutines

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: Thu, 30 Sep 2010 08:21:30 +0200

  On 29.09.10 19:58, Victor Mayevski wrote:
> Thank you Gustaf,
>
> Part of my original question, which still stands, was "would it be worth it?"
>
> It seems that the example you provided can be done with XOTcl alone, no need for coroutine. Is there any case where coroutine would actually give some extra power to XOTcl? Forgive me, I am not a C programmer so the concept of NRE or stackless TCL is a little foggy to me.
In general, everything done with coroutines can be computed
as well without it. At the end, coroutines are a question
of style. There is hope that for certain classes of
problems, coroutines help to reduce complexity for the
developer (who has learned how to use coroutines). Typical
application areas are generators (i.e. technically speaking
infinite loops that are suspended after each result, the
generator example) and event driven programs suspending from
time to time their execution. While traditionally event
driven programs require to split up the logic into small
functions (i have to admit to like this), coroutines
facilitate a linear programming style.

Coroutines are certainly an interesting concept. Whether or
not it is "being worth it" can only be estimated by the eye
of the beholder.

-gustaf neumann

[Xotcl] Re: [Xotcl] destroy logic

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

From: Uwe Zdun <uwe.zdun_at_uni-essen.de>
Date: Thu, 18 Jan 2001 18:31:31 +0100

On Thursday 18 January 2001 14:56, Kristoffer Lawson wrote:
> Is operation of the destroy method documented in more detail
> somewhere? What I'm concerned about is how destroy works when method calls
> to an object are still active? Obviously if a method itself calls destroy,
> the object will appear to exist until the method returns. But can this
> method still call other methods?
>

yes. What XOTcl does if it encounters a destroy in a method is to look
up whether the object is still referenced on the callstack or not. If not,
the object is directly destroyed. Otherwise every occurence of the object's
command on the callstack is marked as destroyed. During popping of the
callstack, for each command marked as destroyed, the reference count is
decremented by one. When no more references to the object are on the callstack
the object is physically destroyed.

Thanks for the hint ... I've just put this explanation into the langRef


> The difficult question, I suppose, is what happens if say a fileevent is
> activated which destroys an object that still has a method running? We are
> coming up with some strange errors in our application for just this kind
> of situation and I'm wondering if in fact the object if destroys when this
> fileevent is run (which would differ from the situation that a method
> itself calls destroy -- which still allows the method itself to run
> normally). The problem is that exactly replicating this isn't easy. It
> pops up in some situations. We get errors like "[self] called after
> destroy" apparently in the middle of a method that is still running, the
> destroy probably coming from an external influence.
>

After an object has left the callstack once, it is in the responsibility of
the application to care for correct destroys. If that ain't the case,
probably we have a bug here? Its hard to tell with the given information ...
if you could isolate a smaller script & send it to me, it would be easier to
tell what the problem is & how to solve it.

Unfortunately, its nearly never easy to spot problems with complex
(asynchronous) object destroys ;)

--Uwe

-- 
Uwe Zdun
Specification of Software Systems, University of Essen
Phone: +49 201 81 00 332, Fax: +49 201 81 00 398
zdun_at_xotcl.org, uwe.zdun_at_uni-essen.de

[Xotcl] Re: [Xotcl] European Tcl meeting

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

From: Catherine Letondal <letondal_at_pasteur.fr>
Date: Tue, 30 Jan 2001 10:09:48 +0100

Kristoffer Lawson wrote:
>
> Is there any plans for an XOTcl presence there? I was thinking of going
> and it'd be great to meet the developers and/or users. It might also be
> worthwhile presenting some systems people have used XOTcl for, along with
> an actual presentation of the project.

This would be great! When and where will this meeting take place? The only
information I could find is about last year's meeting (www.tu-harburg.de/skf/tcltk/ ).

--
Catherine Letondal -- Pasteur Institute Computing Center

[Xotcl] compilation problem

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

From: Bernd Eidenschink <eidenschink_at_web.de>
Date: Thu, 20 Jul 2006 09:24:56 +0200

Hi!

I try to compile XOTcl 1.4.0 against Tcl 8.4.13 for using it with Naviserver
(Head).

I do the usual
./configure --enable-threads --prefix=/usr/local/ns

and after that, make, that barks:

[...]
./generic/xotcl.c: In function ‘AutonameIncr’:
./generic/xotcl.c:1718: warning: implicit declaration of
function ‘TclIncrVar2’
./generic/xotcl.c:1718: warning: assignment makes pointer from integer without
a cast
./generic/xotcl.c: In function ‘Xotcl_Init’:
./generic/xotcl.c:11310: warning: dereferencing type-punned pointer will break
strict-aliasing rules

[...]
./generic/xotclStubLib.c: In function ‘Xotcl_InitStubs’:
./generic/xotclStubLib.c:67: warning: dereferencing type-punned pointer will
break strict-aliasing rules
rm -f libxotclstub1.4.0.a
ar cr libxotclstub1.4.0.a xotclStubLib.o
ranlib libxotclstub1.4.0.a
couldn't load file "././libxotcl1.4.0.so": ././libxotcl1.4.0.so: undefined
symbol: TclIncrVar2
    while executing
"load ././libxotcl1.4.0.so XOTcl"
    ("package ifneeded XOTcl 1.4.0" script)
    invoked from within
"package require XOTcl"
    (file "./library/lib/makeDoc.xotcl" line 2)
make: *** [doc/langRef-xotcl.html] Fehler 1

I can't swear my build environment is sane as I did a lot of installs and
tests these days, but I'll try everything you tell me...

Thanks,
Bernd.

[Xotcl] XOTclIDE Version 0.42

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

From: Artur Trzewik <mail_at_xdobry.de>
Date: Sat, 12 Apr 2003 10:00:47 +0200

Hallo!

New release of XOTclIDE 0.42 is available on
http://www.xdobry.de/xotclIDE

Changes:
1) Converage Analysis Browser - The tool is based on method call tracker and
It can be useful to proof the coverage of unit test.
2) Global variables inspector - help to inspect global variables (also in
namespaces). Helpful to inspect pure-tcl applications
3) Wizard for importing tcl procs into XOTclIDE components from interpreter.
4) some small changes (bugs, inkonsequences)

By the way.
XOTclIDE will be presented on 4. European Tcl/Tk User Meeting (31.05.2003)
http://www.t-ide.com/tcl2003e.html

Artur Trzewik

XOTcl/NX mailing list by object move?

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

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Sun, 19 Mar 2006 14:32:31 +0200

On 19 Mar 2006, at 14:09, Scott Gargash wrote:

> xotcl-bounces_at_alice.wu-wien.ac.at wrote on 03/19/2006 04:08:40 AM:
>
> >
> > On 19 Mar 2006, at 00:12, Scott Gargash wrote:
> > >
> > > When would you need the namespace of the object?
> > I have only ever needed the namespace of an object which attaching
> > traces to variables (f.ex. with Tk), but for that it is,
> > unfortunately quite necessary.
>
> I haven't used it yet, but doesn't the "trace" method handle this?

No. Some tk widgets map their values to Tcl variables. Other similar
interfaces exist. It is handy to map them to an instance variable but
for that it is necessary to have the namespaced version available. Of
course you could always do it through globals, but that is just more
messy.
> But I want lambdas. :)

I think something similar was making its way into Tcl?
> > This is particularly problematic as Tcl still has quite a habit of
> > losing that original representation which naturally I hope will be
> > reduced in the future.
>
> Where do you see this happening? Do you mean losing the original
> representation via shimmering, or something else?
I've seen it happen with scripts given to [after]. I was actually
very surprised by this, but at some point I was witnessing those
scripts becoming strings and thus losing the original Tcl_Objs inside
them (the scripts were built as lists).

            / http://www.fishpool.com/~setok/

Re: [Xotcl] Interested in OO for tcl.

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: Mon, 04 Dec 2006 11:12:22 +0100

Dear German,
 
> Granted, I am not experienced in objects, although a couple of years
> ago I went back to a local community college for a nice Java course
> where I learned about OO and concepts like Inheritance and
> Encapsulation. So, needless to say, I was able to understand itcl
> right away and I am having the hardest time understanding xotcl.
> So, I gather that xotcl seems more versatil (and hence more
> powerfull?)...is [incr tcl] good enough?
> [incr tcl] seems easy (to me, with my Java knowledge) to grasp and
> program. How does xotcl compare?

itcl is more or less the a mapping of the basic concepts of C++ to
Tcl. If you are familiar with C++ and Java, there is not much new
to learn.

The basic object model of XOTcl is different. While the object model
of C++ is class based and says_ "look at the classes, and you know
exactly what your objects are", the basic object model of XOTcl is
instance based, and the relation between objects and classes (and
between classes) are relations in the sense of associations.

This basic concept has the following consequences in XOTcl:

  - all state is kept in objects (instance variables)

  - classes are objects (can contain variables), with two additional
properties
      * classes are manager objects controlling the life-cycle of
         their instances (allocate, init, destroy), classes know their
         instances and vice versa
      * classes provide methods (behavior) for their instances

  - the relation between an instance and its class is a relation that
     can be changed any time, objects can be re-classed (when an
     instance of a car crashes hard against a tree, its class and
     behavior changes)

  - The relation between classes can be changes as well
     (e.g. the superclass relation can be changed)

In XOTcl, everything can be changed dynamically, everything is defined
 incrementally, while in itcl, one needs a complete class
 definition/declaration. Look at the following example:

  Class create C
  C create c1

The first statement creates a class named C, the second statement
creates an instance of this class named c1.
 
Now, we define a specify a specific behavior for class C:

  C instproc foo {} {
    puts "hello world"
  }

This method can be used for instance c1:

  c1 foo

What have we done now? Firstly, we have created an object c1, and
later, we provided a method for its class C. Every XOTcl statement can
change the behavior of existing objects. This might sound scary for
someone seeking protection in OO. However, this flexibility is
essentially the same that Tcl provides.

----
Let us look at the classical Stack example, and see a few variants of
the theme.
Firstly we define a stack very similar style as an ensemble in Tcl 8.5
(a namespace, where the name of the namespace is a command).
We define an object s0, which is a namespace containing a few Tcl
procs (push, pop) and the Tcl variable things:
   Object create s0
   s0 set things ""
   s0 proc push {thing} {
     my instvar things
     set things [concat [list $thing] $things]
     return $thing
  }
 
  s0 proc pop {} {
    my instvar things
    set top [lindex $things 0]
    set things [lrange $things 1 end]
    return $top
  }
Now we can use the stack s0
  s0 push a
  s0 push b
  s0 push c
  puts "[s0 pop] [s0 pop] [s0 pop]"
The last statement prints "c b a". This example showed, how to define
object-specific behavior.
----
In many situations, we want to have many stacks, therefore we define a
class Stack generalizing from the basic behavior:
   Class create Stack
   Stack instproc init {} {
     my  set things ""
   }
   Stack instproc push {thing} {
     my instvar things
     set things [concat [list $thing] $things]
     return $thing
  }
 
  Stack instproc pop {} {
    my instvar things
    set top [lindex $things 0]
    set things [lrange $things 1 end]
    return $top
  }
This class Stack can be used as follows
  Stack create s1
  s1 push a
  s1 push b
  s1 push c
  puts "[s1 pop] [s1 pop] [s1 pop]"
So far, there is nothing special in this Stack
definition in XOTcl.
Now the Stack s1 is empty.
What happens, when we do one more pop?
  puts [s1 pop]
This statement returns an empty string. This means that the definition
is unsafe, since it can't distinguish between a pop of an previously
pushed empty element and a pop with the empty stack.
----
Let us define Safety by a separate class
  Class create Safety
  Safety instproc init {} {
    my set count 0
    next
  }
  Safety instproc push {thing} {
    my incr count
    next
  }
 
  Safety instproc pop {} {
    if {[my set count] == 0} then { error "stack empty!" }
    my incr count -1
    next
  }
The class Safety maintains a counter to keep track the number of
stacked elements (certainly, there are other ways to implement Safety
as well).
What's new is that we can mix in Safety into the Stack definition
  Stack s2 -mixin Safety
  s2 push a
  s2 push b
  s2 push c
  puts "[s2 pop] [s2 pop] [s2 pop]"
  puts [s2 pop]
If we run these statements, an error is generated.  What have we done?
We have now an unsafe stack s1 and a safe stack s2. The s2 has safety
mixed in.  Safety is a per-object mixin for object s2. The per-object
mixin shadows (overloads) the methods of the stack. Every method
in Safety has a "next" statement, that invokes the shadowed methods.
Certainly, it is possible to remove Safety dynamically (or after some
testing), or to provide other mixins for tracing, etc. Mixins are a
powerful means to compose behavior.
----
Well, this was only the first glimpse at XOTcl. XOTcl distinguished
between per-object mixins and per-class mixins, it provides filters to
catch arbitrary calls), all these relations can be altered on the
fly. Since most things can change at arbitrary times, XOTcl has some
self-awareness to figure out its current state and relations (through
introspection).
One can say for sure that XOTcl is more flexible and dynamic than
itcl.  Whether this flexibility is wanted or not, is a question that a
programmer has to decide. XOTcl is not a means to constrain a
programmer such he can do "only the right things" (no programming
language can avoid bad programs) but a means to empower a programmer
to do complex things quite easy.
>  
> I'm just having a hard time separating Objects and Classes, each with 
> its own definitions and methods, etc.  By the way, the soccer team 
> example did not include anything on Objects, everything was 
> Classes...so, I was up for a surprise when they started to talk about 
> Objects in the same way they did about Classes.  The following 
> statements hit the nail right on the head for me:
Does the text above help? Please let me know when you find sentences or 
concepts hard to understand and
not explained enough. Any suggestions are welcome.
-gustaf neumann

Re: [Xotcl] test driven development

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

From: Victor Mayevski <vitick_at_gmail.com>
Date: Wed, 18 May 2011 11:00:49 -0700

Thanks to everyone for your replies. They were very helpful.

Victor

On Tue, Apr 26, 2011 at 6:09 AM, Mark Strembeck <strembeck_at_acm.org> wrote:
> Hi Victor,
>
> in case you like to give it a try: version 0.5 of the basic STORM test
> environment (including a small example written by Stefan) can be
> downloaded from the following URL:
> http://wi.wu.ac.at/home/mark/STORM/storm-v.0.5.tar.gz
> or
> http://wi.wu.ac.at/home/mark/STORM/storm%2dv%2e0%2e5%2etar%2egz
>
> best regards,
>
> Mark
>
>
> On Tuesday 26 April 2011 12:40:14 Stefan Sobernig wrote:
>> Victor,
>>
>> > I am beginning to learn and use test driven development in my
>> > projects. I've noticed that NX does not use the standard "tcltest"
>> > package in Tcl but instead provides it's own "nx::test". Is there a
>> > specific reason for that?
>>
>> I can't give you the full story, only some observations of mine. To some
>> extent, nx::test and especially its predecessors (xotcl::test) are a legacy:
>>
>> OTcl had its own testing environment, not using or not building upon
>> tcltest, and so had XOTcl; see e.g.
>> http://otcl-tclcl.cvs.sourceforge.net/viewvc/otcl-tclcl/otcl/lib/test.tcl?view=markup
>>
>> test migration vs. test continuity so is the issue here. also: nx::test
>> & friends have always been used to test core functionality of the
>> language system, rather than application testing. for your XOTcl/nx
>> application, tcltest is certainly a viable option (coming with nice
>> helpers actually missing in nx::test). another answer along these lines
>> is probably that a home-brewed testing evironment is usually one of the
>> first prototype applications written by the language authors in their
>> language.
>>
>> as for application testing, however, an object-aware testing environment
>> comes handy; you can refine your test suites occasionally through
>> mixins; or nx::test traces object lifecycles during test execution to
>> maintain a prestine testing sandbox to avoid unwanted test interactions.
>> however, that does not mean that you could not realise all of this using
>> tcltest.
>>
>> some further pointers, especially when it comes to TDD (which is, by the
>> way, something different than merely writing and executing tests in the
>> sense of tcltest or nx::test):
>>
>> Two or three years ago, I had a look at a xUnit framework for XOTcl:
>> http://xotcllib.cvs.sourceforge.net/viewvc/xotcllib/xounit/
>>
>> While it gave me a xUnit environment, it found it incomplete and its
>> implementation rather clumsy (including its usage of Exception objects
>> ontop of Tcl's error control flow mechanism).
>>
>> More recently, Mark published on a scenario-driven approach and
>> prototype framework (STORM) which I successfully used in one or two dev
>> projects of mine. It comes with essentials concepts for applying a
>> test-first development approach:
>>
>> http://wi.wu-wien.ac.at/home/mark/publications/se2011-extended.pdf
>>
>> I don't know whether the prototype implementation (the XOTcl script) is
>> publicly available, but you could most certainly talk Mark into
>> providing it to you :)
>>
>> //stefan
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> >
>> > Thanks,
>> >
>> > Victor
>> > _______________________________________________
>> > Xotcl mailing list
>> > Xotcl_at_alice.wu-wien.ac.at
>> > http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>> >
>>
>>
>>
>

Next Page