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

Weblog Page

Showing 281 - 290 of 1561 Postings (summary)

Re: [Xotcl] assign proc - how to execute assign from superclass?

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: Wed, 05 Jan 2011 23:08:25 +0100

Dear Krzysztof,

Good example, no easy answer!
When you create an object b1

     B create b1 -foo 10

your goal is most probably to chain the assign methods of
the slots foo of the classes A and B along the precedence
path of the object b1.

The simple but unsatisfying approach is to call the "right"
assign method manually:

===========================================
Class create B -superclass A -slots {
   Attribute create foo -proc assign {domain var value} {
       if {$value < 0} {
           error "Value cannot be less than 0"
       }
       ::A::slot::foo assign $domain $var $value
   }
}
===========================================

This crude approach will work, but is unsatisfying, since
the "assign" method of class B has to know that the
superclass of B is A and it has to know, that
the same-named slot of class A exists and has
as well an assign method.

In the approach below this information is obtained
via introspection by a method named "continue",
which is supposed to be quite generic.

===========================================
Class create B -superclass A -slots {
   Attribute create foo -proc assign {domain var value} {
       if {$value < 0} {
           error "Value cannot be less than 0"
       }
       my continue $domain $var $value
   }
}
===========================================

Below you will find the implementation of method
"continue". Note that there will be some changes in
this are in XOTcl 2 and NX.

hope this helps
-gustaf neumann


===========================================
::xotcl::Attribute instproc continue {domain var value} {
   set order [$domain info precedence]
   set current [[my info parent] info parent]
   #
   # find the next class from the precedence order
   #
   for {set order [lassign $order c]} \
       {$c ne $current && $c ne ""} \
       {set order [lassign $order c]} {continue}
   #
   # iterate on the remaining order until we find next
   # assign method
   foreach c $order {
     set slot ${c}::slot::$var
     if {[info command $slot] eq ""} continue
     if {[$slot info methods assign] ne ""} {
       #
       # invoke it
       #
       return [$slot assign $domain $var $value]
     }
   }
}
===========================================


On 05.01.11 15:50, Krzysztof Frukacz wrote:
> Hello,
>
> I have a question for which I haven't been able to find
> the answer.
> I have two classes:
>
> Class create A -slots {
> Attribute foo -proc assign {domain var value} {
> if {$var > 5} {
> error "Value cannot be bigger than 5"
> }
> $domain set $var $value
> }
> }
>
> Class create B -superclass A -slots {
> Attribute foo -proc assign {domain var value} {
> if {$var < 0} {
> error "Value cannot be less than 0"
> }
> #I don't know how to call assign for foo in class
> A here
> }
> }
>
> What I want to to is for assign proc from B to call assign
> proc from A too check both conditions.
> Thank you for your help.
>

[Xotcl] XOTcl 0.85.3

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 00:50:47 +0200

Dear XOTcl comminity,

here comes the annoucement of patchlevel 3 for XOTcl.
best regards

-gustaf

PS: Some other good news: ActiveState is planning to include XOTcl in the
next ActiveTcl release....
========================================================================================

XOTcl 0.85.3
************

RECENT CHANGES relative to 0.85p2 are:

  - Speedup for parameter methods:

    Methods for accessing parameters are now 4 to 5 times faster.
    In the following example, "name" and "age" are parameters:
        Class Person -parameter {{age 0} name}
        Person p1 -age 99 -name -gustaf
        puts [p1 age]
    setting and retrieving of parameters has now roughly the same
    speed as the set methods (about 20% faster than instvars)


  - Reduced memory consumption for objects and classes:

    The size of XOTclObject structure went from 172 bytes
    to 68 bytes by

      * allocating assertion structures on demand, and
      * by and by omitting in the default setup metadata

    10 thousand XOTcl objects consume now about 7 MB of memory.
    There is still little potential for savings in the
    C-structure (by using bitmasks), but most of the memory
    consumed by XOTcl objects are in the tcl-memory structures for
    namespaces etc.


  - Support for AOLserver:
 
    XOTcl is now prepared for use in the AOL-server. The stubs for
    AOL-server are integrated in XOTcl (many thanks to
    Zoran Vasiljevic). The required patch for the AOL-Server
    is available from http://media.wu-wien.ac.at/download.html#aol


  - Stub-library support:

    XOTcl supports now the stub library. This means that
    it is less dependent on particular Tcl implementations.
    The support was quite tricky since some commands used by XOTcl
    (like Tcl_IncrObjCmd, Tcl_UpvarObjCmd, ...) are
    not exported by the stub library, and the solution
    has to work in the multithreaded AOL-server environment)


  - various small optimizations and code cleanups

  - some actiweb fixes (agent migration was broken)

For more details, please check the ChangeLog file.

Best regards,

Gustaf Neumann

[Xotcl] Changing a parameter's -setter function

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

From: Scott Gargash <scottg_at_atc.creative.com>
Date: Tue, 14 Mar 2006 16:07:29 -0700

Hello,

Is it possible to change the -setter command associated with a parameter at some point other than
class definition? I want to trigger some side effects from a parameter set operation, but I can't
trigger the side effects until after other things have been initialized, so I want to use the
default setter method until the end of init, and then replace the setter method (but not the getter
method).

I can override create a parameter-named method at init time, but that overrides the getter along
with the setter. I'd rather not have to handle the -getter from my proc (the default -getter is fine
and 2.5x faster). I've looked through the docs and the tutorial and I can get tantalizingly close
(parametercmd), but is there an easy way from within a proc to change the -setter properties of a
parameter?

Something like this:

Class create a -parameter {{foo 1}}
a instproc foosetter {var val} {
  # Do something with [self] that isn't valid pre-init
}
a instproc init {} {
  #override foo's -setter parameter cmd
  my parametercmd foo -setter foosetter
}

a create b -foo 234 ;# calls default foo setter
b foo ;# calls default foo getter
b foo 123 ;# calls overridden foosetter

Thanks for your help. XOTcl is a great. It should be adopted as Tcl's standard OO package.

      Scott

Notice
The information in this message is confidential and may be legally privileged. It is intended
solely for the addressee. Access to this message by anyone else is unauthorized. If you are not
the intended recipient, any disclosure, copying or distribution of the message, or any action
taken by you in reliance on it, is prohibited and may be unlawful. If you have received this
message in error, please delete it and contact the sender immediately. Thank you.

Re: [Xotcl] xotcl-1.5.2-win32-tcl8.4.13.zip

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: Fri, 13 Oct 2006 11:19:41 +0200

Should be fixed now. please refetch.
-gustaf neumann

Murr, Florian schrieb:
> Dear XOTcl developers, I can't find
> installWin.tcl
> or
> libxotcl1.5.dll
> in this distribution anymore.
>
> Am I looking in the right place?
>
> regards,
> - Florian
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>

Re: [Xotcl] Mixins in XOTcl

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

From: Michael Schlenker <schlenk_at_uni-oldenburg.de>
Date: Wed, 19 May 2004 22:05:21 +0200

Neil Madden wrote:

>
> On 19 May 2004, at 17:07, Michael Schlenker wrote:
>
>> Kristoffer Lawson wrote:
>>
>>> On Wed, 19 May 2004, Michael Schlenker wrote:
>>>
>>>> Its similar in tcl, where you have [info commands] and not a magic
>>>> $commands variable as you might have in other languages.
>>>>
>>>> Using traces it should be possible to provide such an interface if
>>>> anyone really wants it.
>>>
>>>
>>> So what is so problematic about just getting a list, manipulating it
>>> and
>>> then setting it back? Seems like a lot of copied effort for what is
>>> basically just list manipulation.
>>>
>> Yep. I refer to Adam and Neil who both wanted to have mutable objects
>> instead of accessor functions.
>> Its the usual problem with mutable list objects and the tradional
>> value based list operations in Tcl.
>
> Woah there! I said nothing about mutable objects/values.

You talked about adding instance variables which are mutable objects by
definition, while Adam talked about mutable objects directly.

> Mutable variables are all that is needed, and they exist already (in
> fact, you have to go an extra step to get immutable variables).

Of course, mutability is what variables are all about... ;-)

> The idea is to reuse things like [lappend], [linsert], [lreplace] etc,
> without creating lots of [mixin_append], [mixin_replace] etc etc.
> That's the duplication of effort.

You can reuse them, correct me if I'm wrong:

set mixins [$obj info mixins]
# use standard list operations as you like
set mixins [linsert $mixins 0 $newMixin]
lappend mixins $anotherMixin
$obj mixin $mixins

Where is the huge benefit of a magic instance variable containing the
list of mixins? I just don't see the benefit, but i see that you would
add a magic variable name to objects where none existed before.

Either the interface gets cluttered with commands (prepend append
llength whatever) or the existing commands are reused which leads to
slightly longer code but smaller interfaces.

Michael

[Xotcl] XOTcl future

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

From: Kristoffer Lawson <setok_at_fishpool.com>
Date: Wed, 26 Sep 2001 18:19:30 +0300 (EEST)

On Wed, 26 Sep 2001, Uwe Zdun wrote:

> - list of all procs defined for an object (procs + all instprocs up the
> heritage order)
> - list of all mixins (mixins+instmixins) for an obj
> - list of all filters (filters+instfilters) for an obj
>
> Perhaps return certain infos conditionally as ligthweight objects ...
>
> Were/are there any other suggestions?

A hugely important feature I would like to see in the near future,
and one I've asked about before, is for a good C&C++ interface. I know
this is not an easy issue to deal with, but for some things it would
actually be quite vital. For me, the normal application development model
would be to built everything in Tcl/XOTcl first, and then to begin
converting critical parts to C if better performance is required.

So what I would need is a semi-standard documented mechanism for
adding procs and instprocs to objects from C (and, possibly later, C++)
so that the C implementations can rely on the same information about
object context and next-chaining as the XOTcl code itself. To take this
even further, I may want to implement complete objects in C.

I've given this some amount of thought, but I don't have any really
worthwhile suggestions to give as to how best to do this. I just think
that now, with 1.0 coming out, is a good time to really put some thought
into this. Another reason is that while the language develops I'm sure it
will be more and more difficult to specify a complete library for
this. With a simple core a library can be built and the extended as new
aspects arise that use the same core.

Does this make sense at all?

         - ---------- = = ---------//--+
         | / Kristoffer Lawson | www.fishpool.fi|.com
         +-> | setok_at_fishpool.com | - - --+------
             |-- Fishpool Creations Ltd - / |
             +-------- = - - - = --------- /~setok/

Re: [Xotcl] TIP #257 & XOTcl as an OO framework

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

From: Zoran Vasiljevic <zv_at_archiware.com>
Date: Thu, 5 Oct 2006 16:25:25 +0200

On 05.10.2006, at 15:29, Kristoffer Lawson wrote:

>
> In any case, if your proposal gains some support, as it probably
> will, TIP it :-)

Gustaf,

TIP it NOW! Don't wait for proposal to gain support
as this will be too late. Just cut/paste what you
already have in the TIP generator.

Zoran

[Xotcl] XOTcl 1.5.5 available

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, 18 Sep 2007 21:32:55 +0200

Dear XOTcl Community,

XOTcl 1.5.5 is available. The main change is to achieve binary
compatibility
between Tcl 8.5 and XOTcl compiled with Tcl 8.4. This is essential achieved
through a small emulation layer based on C-structures that will be available
in Tcl 8.5.

best regards
-gustaf neumann

Announcing XOTcl 1.5.5
*************************

We are pleased to announce the availability of XOTcl 1.5.5.

Major changes relative to 1.5.4 are:

    * Improved binary compatibility:

      It is now possible to load XOTcl compiled for Tcl 8.4
      into a tclsh8.5 (again, substantial change).

      One can now test now 4 versions:
      a) a native version for Tcl 8.4 (without compatibility layer)
      b) a native version for Tcl 8.5
      c) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.4
      d) a version compiled for Tcl 8.4 with compatibility layer in tclsh8.5

      Tests showed that the overhead is for the compatibility
      layer is between 1.1% and 2.3%, the difference between
      tcl8.5 and tcl8.4 is much larger.

      The forward compatibility behavior behavior can be turned off by setting
      FORWARD_COMPATIBLE to 0 during compilation (xotcl.h) to get
      a small performance improvement.


 For more details about the changes, please consult the ChangeLog and
 documentation.

MORE INFO
  General and more detailed information about XOTcl and its components
  can be found at http://www.xotcl.org

Re: [Xotcl] nx: make failing on strnstr()

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: Sat, 11 Dec 2010 12:00:02 +0100

Am 11.12.10 09:43, schrieb Gustaf Neumann:
> will do so, either a configure test or a complete replacement....
changed in the git repository -gustaf

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

Re: [Xotcl] OSX + XOTcl + ActiveTcl

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: Wed, 27 Sep 2006 08:48:59 +0200

Jeff Hobbs schrieb:
>> Is there anything special about that combination that I need
>> to know before compiling XOTcl on OSX?
>>
>
> xotcl may need private headers, I can't recall. Otherwise, no, it is
> TEA-based and should just work.
>
yes, the compilation of xotcl needs the private headers of tcl, and yes,
it works out of the box (i am doing most of the development on Mac OS X).

I am not sure, whether ActiveTcl contains the private headers of Tcl
(tclInt.h); in the worst case you have to get the matching tcl source and
use --with-tcl during compilation (which might be a good idea anyhow,
to avoid confusions with the precompiled tcl/xotcl from the max os x
developer toolkit).

-gustaf neumann

Next Page