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

Weblog Page

Filtered by date 2017-01-02, 341 - 350 of 1541 Postings (all, summary)

[Xotcl] Re: [Xotcl] problem: filter disappears if instproc redefined

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

From: Uwe Zdun <uzdun_at_k2.informatik.uni-essen.de>
Date: Thu, 28 Dec 2000 15:27:00 +0100 (CET)

Hi,

On Tue, 26 Dec 2000 seva_at_design.kiev.ua wrote:
>
> I split my application in several source files. Each of files
> implements one of fsm's or helper functions, and when I need to change logic
> of work, i simply source all files.
>
> There are several problems with this:
> 1) when I execute command Class Some, previous instance of this
> class deleted, and all objects move to ::Object class.

this behavior is intended: from a "programming language point of view" you
can not predict whether a destroyed class is going to be redefined or not.
There could be another class with the same name, but with different
semantics.

In cases like your application, that require a class redefinition, there
are several ways to tell the language to behave like this:

- you can use the filter, as you have done to overload create.
- you can use a subclass or a mixin to change create bahavior
- or you use introspection to find out which instances are currently
  there and re-class these instances after sourcing to the new classes
  (same-named) classes

Probably a combination would work here, like a instmixin on object that
checks whether a class-to-be-created exists. If yes all instances are
stored in a variable. After create, the instances are re-classed back
to the old class.

Or you build an instmixin tht simply does not execute the "create" on
certain existing classes?

It depends on your application case which solution is the best here ...

> This problem I solve by using filter for create command on ::Object (idea
> stolen from recoverypoint class :)) ). But with that second problem
> arrives:
> 2) when some instproc used as a filter, and redefined, it's filter become
> inactive. (so first problem arrives again, when I source recover.tcl which
> has recoverfilter definition)
> after setting filter again, all works as expected
>

for the same reason as we have to re-class exisiting instances, we have to
set the filters to an empty list, when the method is redefined (the same
is done for mixins, when the class is redefined). E.g., we can
not say that in any case with "Object instproc filter" the same method is
defined. But again you can easily change this behavior for certain cases
with a filter or instmixin or a subclass of Object, by redefining "mixin",
"instmixin", "filter", etc. so that they check whether a certain filter,
mixin, or instmixin is still there. A filter on Object is probably not the
best solution here, because it performs the check on every call in the
system. This is a heavy performance overhead. Presumably a mixin solution
is more well-suited, because it only checks for certain methods and can be
used object-specifically.

In your example code a "mixin" on "Class", that just checks the
Class->create method could be sufficient.

Hope this helps,

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

Re: [Xotcl] new methods, request for comment

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: Sun, 19 Apr 2015 23:25:35 +0200

Am 19.04.15 um 22:21 schrieb Victor Mayevski:
> Recently I encountered a need for two methods in my code:
>
> "info siblings"
> "info root" -- similar to "info parent" but travels down the object
> tree to find the first object or root (of a tree OR a branch).
>
> I realize that it is very trivial to script them in myself but I am
> dealing with thousands (if not millions in the future) of objects and
> would like to squeeze as much performance from the code as possible.
> Hence, I propose to add those methods in C code (to NSF), provided
> that coding them in C will indeed speed things up. Also, having those
> methods seems to be natural, just like having "info parent" or "info
> children".

is this, what you have in mind?
The questionable parts are the ones, where namespaces are used, which do
not correspond
to objects. i would not expect huge differences in performance when
coding this in C.

================================================
package req nx::test

nx::Object public method "info root" {} {
     set parent [:info parent]
     if {![nsf::is object $parent]} {
        return [self]
     }
     return [$parent info root]
}

nx::Object public method "info siblings" {} {
     set parent [:info parent]
     set self [self]
     set siblings {}
     foreach c [info commands ${parent}::*] {
         if {[nsf::is object $c] && $c ne $self} {
            lappend siblings $c
        }
     }
     return $siblings
}

#
# Some test cases
#
namespace eval ::test {
     nx::Object create o
     nx::Object create o::p
     nx::Object create o::p::q
     nx::Object create o::i
     nx::Object create o::j
     nx::Object create o2
     nx::Object create o3

     ? {o info root} ::test::o
     ? {o::p::q info root} ::test::o

     ? {lsort [o info siblings]} {::test::o2 ::test::o3}
     ? {lsort [o::p info siblings]} {::test::o::i ::test::o::j}
}
================================================

> Another proposal, (tongue-in-cheek, since it probably benefits only my
> code), is to add a timestamp (microseconds) to every object upon
> creation. I have a need to list the object (thousands, if not
> millions) in the order of creation. Again, it is trivial to script it
> in, but performance is an issue.
By adding time stamps to the code, the size of every object will
increase, which we really want to avoid.

How about the following approach. this is like an implementation of
"new" which
uses the creation time as object name. To avoid confusions with digit
overflows,
one needs in the general case a custom sort function, or a "format" for the
name generation, but that should be pretty straight-forward.

#
# Keep order of creation
#
nx::Class create C

for {set i 0} {$i < 100} {incr i} {
     C create [clock clicks -microseconds]
}
puts [lsort [C info instances]]


If you use huge trees, i am not sure that using nested tcl namespaces is
memory-wise the best approach - but i do not know the requirements
of your application, and the structure (width, depth, size) of the
object trees.

Maybe it is better to use ordered composites to avoid high number of
namespaces
and huge object names like e.g.:

https://next-scripting.org/xowiki/file/docs/nx/examples/container.html?html-content=1
http://openacs.org/api-doc/procs-file-view?path=packages%2fxotcl-core%2ftcl%2f20-Ordered-Composite-procs.tcl&version_id=4193140&source_p=1

nx/xotcl objects require much less memory when these are namespace-less
(contain no children or per-object methods).

All the best
-g

Re: [Xotcl] replacing libtcl

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, 11 Aug 2010 12:11:45 -0700

On 11/08/2010 10:51 AM, Kevin Van Workum wrote:
> I have an application (TORQUE resource manager) which provides a TCL
> interface to its C library and provides the ability to program its behaviour
> using TCL. Basically it has a C program (pbs_sched) which calls
> Tcl_CreateInterp() and other Tcl library calls, and then runs a TCL script
> which I can write to control its behaviour.
>
> I would like to include XOTcl functionality to my control script, but
> naively using "package require XOTcl" doesn't seem to work. I get "TCL error
> _at_ line 3: can't find package XOTcl". Which I guess indicates you can't do
> that from a standard TCL script.
>
> So, is there a simple way to drop the XOTcl interpretor in place of the
> normal Tcl interpretor? Or just to add XOTcl functionality?

It sounds like you are trying to use libtcl.so (or equivalient) in your
setup. It is possible to make use of extensions if you initialize
everything correctly. It is also possible to build special-purpose DLLs
that can actually include other extensions added, called stardlls. See
http://wiki.tcl.tk/15969 for more. This enhanced setup provides a lot
of flexibility for embedders.

Jeff

[Xotcl] Getting Name of Mixin Class

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

From: Sheik Yussuff <sheik_at_carib-link.net>
Date: Tue, 4 Sep 2001 18:50:07 -0300

Consider the following scenario:

A, B and C are classes.

A has instproc m defined.

B is a sub-class of A.

C c
c mixin B

Question: How in instproc m can I get the name
of the mixin class, that is, B?

Any help will be appreciated.

Regards,
sheik.

Re: [Xotcl] RE: Snit TIP

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, 24 Apr 2004 13:58:06 +0200

On Friday 23 April 2004 04:47, Marc Spitzer wrote:
> On Thu, 22 Apr 2004 17:29:52 -0700
>
> Jeff Hobbs <jeffh_at_ActiveState.com> wrote:
> > However, a true core OO should be done in C. xotcl is that
> > already. Sure, you can code parts of snit in C - but xotcl
> > is already there *and tested*. It has active developers and
> > interested users. It's even gone so far as to have an alpha
> > "itcl compatability" mode that actually faster than the C
> > coded itcl!
>
> I seem to remember an alpha snit compatibility also.

 Since XOTcl has a range of message interceptors,
 there are - of course - multiple possible implementations.
 
 The probably most simple one for the core delegation
 functionality is on the wicky

    http://mini.net/tcl/11033

 -gustaf
>
> marc
>
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl

-- 
Univ.Prof. Dr.Gustaf Neumann
Abteilung für Wirtschaftsinformatik
WU-Wien, Augasse 2-6, 1090 Wien

[Xotcl] Extending nonposArgs in XOTcl

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

From: Shawn Jury <shawn.jury_at_gmail.com>
Date: Mon, 24 Oct 2005 19:54:40 -0400

Hello,
  I am trying to extend nonposArgs to include more checks and I am having a
hard time. I have gotten basic checks working, but I am not able to get some
of the more complicated checks working.
  The tutorial shows that the syntax for extending nonposArgs is:
  *someobject|someclass* *proc|instproc* methodName {?optional arguments?
argName args} {
...
}
 I have not been able to get the ?optional arguments? to work.
 Example:
 I am trying to get some checks done that will check for specific values of
the Arg. I would like to be able to pass those values into the check.
 xotcl::nonposArgs proc RANGE {allowedRange argName args} {
.....code to verify the range
}
 The syntax to use this would be similar to:
 Class Foo
Foo instproc setMtu {{-mtu:RANGE 54-65535 "1500"}} {} {
....
}
 This is similar to what Giovannni Cristelli asked in the post titled XOTcl
extending nonPosArgs class from November 2004.
 Is there any way to do this currently? I am trying to replace a bloated
package that is currently being used which has many of these checks
available. I have tried many combinations of syntax to get this to work and
have not been able to figure it out.
 Thanks,
 Shawn

[Xotcl] ** Outdoor Wireless Router **

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

From: Wireless Team <mailinglist_at_wirelessteam.net>
Date: Thu, 27 Jun 2002 02:23:04 +0300
Wireless Team: Outdoor Wireless Equipment
 
     
     

    The Outdoor Wireless Router is a flexible network solution designed to provide a new high-speed alternative for delivering broadband connections. The Wireless Router helps to bypass telecommunications charges for expensive local loops and costly equipment usually needed to establish a T1 (1.5 Mbps) or faster connections. The Wireless Router helps you take advantage of the rapidly changing Internet, and to enhance your company's productivity at a very reasonable price.

    The Outdoor Wireless Router is totally adapted for outdoor mounting and the base system includes integrated antenna. It is equipped with power injector as well. Thus prevents you from having problems with power supplies at open areas and gives you the possibility to have the device at a distance of 100-140 m from your switch or hub.

    With a full 100mW of transmit power and the best receive sensitivity in the industry it has the longest range and best reliability available for wireless clients. Advanced signal processing helps manage the multi-path propagation often found in office environments. Intelligent filtering addresses ambient noise and interference that can decrease network performance. Building upon Cisco leadership in wireless LAN (WLAN) performance, it provides the greatest throughput available so users can enjoy virtually the same connectivity they gain from wired connections. Based on direct sequence spread spectrum (DSSS) technology and operating in the 2.4-GHz band, the device complies with the IEEE 802.11b standard-ensuring interoperability with all other compliant WLAN products.

     
      
    This mailing is done only to people who have requested info from one of our sites, or downloaded our Software. If you have recieved this email in error and you wish to be removed from future mailings, please reply with the subject "Remove" and our software will automatically block you from their future mailings.

     

    [Xotcl] administrative note

    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, 16 Feb 2005 14:03:02 +0100

    Dear XOTcl community,

    yesterday, at least some of you (for some strange reason not me) have
    received a spam mail
    via the xotcl mailing list. Due to a mail of Peter.Beckers i became
    aware of this, and found
    out that the spammer was actually subscribed on the mailing list. I have
    unsubcribed the user.....

    Sorry for the inconveniance
    -gustaf neumann

    PS: I wonder when spammer will start to harvest adresses from mailing lists
    and forge the send addresses accordingly....

    Re: [Xotcl] XOTclLib

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

    From: Kristoffer Lawson <setok_at_fishpool.com>
    Date: Fri, 21 Jul 2006 20:41:45 +0300

    On 21 Jul 2006, at 20:35, Ben Thomasson wrote:

    > Thanks! I'll test it other browsers next time. So http://
    > xotclllib.sourceforge.net should work in IE and Firefox now.

    Tested with Safari:

    An error has been encountered in accessing this page.

    1. Server: xotclllib.sourceforge.net
    2. URL path: /
    3. Error notes: File does not exist: /home/groups/x/xo/xotclllib/htdocs/
    4. Error type: 404
    5. Request method: GET
    6. Request query string:
    7. Time: 2006-07-21 10:41:12 PDT (1153503672)

    Reporting this problem: The problem you have encountered is with a
    project web site hosted by SourceForge.net. This issue should be
    reported to the SourceForge.net-hosted project (not to SourceForge.net).

    If this is a severe or recurring/persistent problem, please do one of
    the following, and provide the error text (numbered 1 through 7, above):

    Contact the project via their designated support resources.
    Contact the project administrators of this project via email (see the
    upper right-hand corner of the Project Summary page for their
    usernames) at user-name_at_users.sourceforge.net
    If you are a member of the project that maintains this web content,
    please refer to the Site Documentation regarding the project web
    service for further assistance.


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

    Re: [Xotcl] info method behaviour

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

    From: Kristoffer Lawson <setok_at_fishpool.com>
    Date: Mon, 13 Aug 2001 19:15:36 +0300 (EEST)

    On Mon, 13 Aug 2001, Gustaf Neumann wrote:

    > sure. the point is, that we need both: an explicit interface for getting
    > the details right and for distinguising as far as neccessary, and
    > a high level interface, that hides part of this details for a user who does
    > not care about these. for the latter case, an "info procs" or
    > "info instprocs" is not the right way, since the names are not necessarily
    > disjunct. a new thing called "info methods" that returns a list of
    > method-objects (see last mail) could help here returning all the callable
    > methods (which are procs, instprocs, mixins, filters).
    >
    > what is it, that would fit your needs best? what are you doing exactly?

    Well for me even more important are the "info args" and "info body" parts.
    As mentioned, I'm doing some meta-programming at the moment. I have a
    method which generates more methods based on a template method (an
    example of this can be found
    at: http://mini.net/cgi-bin/wikit/401.html). Right now
    the method-generators assumes that the template is inherited from a class
    (so checks "args" and "body" from there), but really it should not care
    whether a method is inherited or not. It should just be given the name of
    the method, and it can ask the information regardless of inheritance.

    I'm not quite sure what the best way to do this would be, while still
    keeping the old logic. Maybe something like your "method" proposal, or
    alternatively an extra option to the current "info body" etc. commands.

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

    Next Page