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

Weblog Page

Showing 1431 - 1440 of 1561 Postings (summary)

Re: [Xotcl] XOTcl and Thread

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: Fri, 11 Feb 2011 17:43:39 +0100

Am 11.02.11 15:09, schrieb Krzysztof Frukacz:
> I'll be grateful for your suggestions how to do it in XOTcl.
The following snippet creates a modem thread and a gatherer thread,
where the "gatherer" sends from time to time a SMS. The snippet shows
some common idioms when working with Tcl-threads. For just solving the
task described in the previous mail, the script can be certainly
shortened...

gustaf neumann

=======================================================================
package require XOTcl
package require Thread 2.6
package require xotcl::serializer

tsv::set tid modem [thread::create {
   package require XOTcl; namespace import ::xotcl::*

   #
   # This is the modem implementation thread; we create here a modem
   # object that might connect to the real hardware and handles dialing
   # etc.
   #
   ::xotcl::Object create modem
   modem proc sendSMS {number text} {
     puts "MODEM dials $number RING RING"
     puts "MODEM sends text '$text'"
   }

   puts "MODEM waits"
   thread::wait
}]

#
# Create a sample gatherer thread
#
set g1 [thread::create {
   package require XOTcl; namespace import ::xotcl::*

   #
   # This is a thread that sends from time to time an SMS
   #
   ::xotcl::Object create ping
   ping set count 0
   ping proc tick {} {
     puts stderr "gatherer want to send SMS ..."
     modem sendSMS +49123456789 counter=[my incr count]
     after 3000 [list [self] tick]
   }
   puts "gatherer waits"
   thread::wait
}]


#
# Create a small forwarding stub for interfacing with some
# implementation via async messages.
#
Class create ForwardStub
ForwardStub instproc unknown {method args} {
   set name [namespace tail [self]]
   thread::send -async [tsv::get tid $name] [list $name $method {*}$args]
}

#
# Pass the definition of class 'ForwardStub' to the gatherer. The
# serialized definition Could be used in a similar way in the init-cmd
# of a thread.
#
thread::send $g1 [::ForwardStub serialize]

#
# Create a modem forwarder in the gatherer
#
thread::send $g1 [list ::ForwardStub create modem]

#
# start the work in the gatherer thread
#
thread::send -async $g1 [list ping tick]

vwait forever
=======================================================================

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

[Xotcl] why Attribute is not imported?

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

From: Mykhaylo Sorochan <msorc_at_bigmir.net>
Date: Sun, 1 Nov 2009 02:20:38 +0200

Hello,

Why in the following code launched from tclsh I get the error:
invalid command name "Attribute" during '::test1::Test slots'

######
package provide test1 0.1
package require XOTcl

namespace eval ::test1 {
    namespace import ::xotcl::*
    Class Test -slots {
        Attribute name
    }
    namespace export Test
}
namespace import ::test1::*
######

XOTcl 1.6.4, works ok from xotclsh and when 'namespace import ::xotcl::*'
comes right after 'package require XOTcl' and not within test1 namespace.

Thanks.

-- 
Regards,
Mykhaylo

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: Mon, 20 Mar 2006 21:29:57 +0200

On 20 Mar 2006, at 18:13, Koen Danckaert wrote:

>>>> I have added "::xotcl::mymethod" and "::xotcl::myvar" to my
>>>> development version. i guess, you would you prefer to have
>>>> these exported. Opinions?
>>>
>>> On giving it some thought I think I actually prefer the version
>>> that would be part of Object. After all, it is that object's
>>> variable that we want.
>
> Well, in any case we're not adding new functionality here, we're
> just adding convenience procedures to write callbacks in a more
> concise and readable way. I believe this is best achieved by having
> 2 short and concise keywords. In my code, "myproc foo" (vs "my
> foo") indicates clearly that I'm not actually calling foo, just
> referring to it. This distinction would be less clear with "my
> callback foo".

I still think the original proposal does not actually describe what
is going on. "My proc? What my proc? This is a proc, what's the
matter with it?". Besides, splitting the functionality into a method
means we can use it on other objects than our[selves].

This is more than just shorthand. It's also about hiding the details
of method and variable implementation. It just feels cleaner to get a
real variable reference through some procedural call, instead of
building it up yourself based on namespace assumptions.

> So indeed, if these keywords would be predefined in xotcl, I would
> prefer to have them exported, otherwise they'd not be short and
> concise either :-)

Yes, if the solution ends up being based on top-level commands, then
exporting them sounds reasonable.

>>> I don't use it that frequently so I don't mind writing a bit
>>> extra, for clarity's sake.
>
> I use it quite often. It's a very common construct in Tk and event-
> based scripts, I think. I've even customized my editor to highlight
> "myproc" and "myvar", such that they spring out immediately.

It's only really necessary for variables which are linked to other
systems as for callbacks you can generally do f.ex.:

after 100 [list [self] doStuff]

which is what I actually do. I mean, presumably the problem with
using a method by its direct namespace is also that filters get
avoided, or? (at least I think it was that way at some point in
XOTcl's history). That, to me, would mean it's not a good method
except for very specific cases.

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

Re: [Xotcl] info subclass

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, 25 Apr 2010 10:15:50 +0200

Dear Kristorffer
Am 24.04.10 17:42, schrieb Kristoffer Lawson:
> In my 1.2 version of XOTcl (OSX) [info subclass] works in the
> following way:
>
> Class Foo
>
> Class Bar -superclass Foo
>
> Foo info class Bar
> => 1
>
[Foo info class] returns "::xotcl::Class", your probably meant "... info
subclass ...."
> However the current documentation says the parameter given is a
> pattern and the fully qualified name is returned, or empty if no match
> was found. Has this changed at some point? This would be quite an
> incompatible change.
>
This was changed more than 2 years ago (see changelog). The main reason is
consistency (with Tcl and other XOTcl info commands).

XOTcl has many introspection commands returning potentially a set,
similar to e.g. "info vars" in tcl:

     cls|Object info SUBCMD ?options? ?pattern? => answer-set

If the answer-set is non-empty, "pattern" (a glob style pattern) can
be used to restrict the answer-set, e.g. [info vars *o*]

For the definitions

    Class Foo
    Class Bar -superclass Foo
    Class Baz -superclass Foo

the command [Foo info subclass] returns "::Baz ::Bar", therefore
the pattern acts here as well as for other Tcl commands and for
the other 20 info options of XOTcl which accept the optional
pattern argument, such as

    children classchildren commands forward heritage
    instances instcommands instforward instmixin
    instmixinof instparametercmd instprocs mixin
    mixinof parametercmd procs precedence
    subclass superclass vars

The change was made in connection with the transitive
option "-closure", such one can use as well e.g.

    Object info subclass -closure

to obtain subclasses and their subclasses. The change
is documented in the Changelog.
> I actually prefer how it works on my installation. I want to
> explicitly check if one class is a subclass of another, as objects,
> not as patterns (patterns can be risky). And it's not actually clear
> what is meant by 'pattern'.
It is not "risky" as long "pattern" does not contain glob characters
(same as in Tcl).
> Foo is a class, Bar is a class, but Foo's
> actual fully qualified name is ::Foo, so if I wanted an exact search
> it should be against ::Foo, but will it also match 'Foo' (as desired)?
>
>
yes. both commands

      Foo info subclass Bar
      Foo info subclass ::Bar

return "::Bar"

Best regards

-gustaf neumann

[Xotcl] Re: [Xotcl] Garbage Collector in Xotcl

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, 21 May 2001 16:25:55 +0300 (EEST)

On Sun, 20 May 2001, Artur Trzewik wrote:

>
> The main thing is to tread Xotcl objects in the same way
> as other tcl objects (Stings, Interger, Array) and use tcl garbage collector
> I thing there should be a wrapper Tcl_Obj (new Type)

You may want to read Paul Duffin's (IIRC) whitepaper on the proposed
Feather system. There are a few problems to using an OO system with that
kind of reference -based system. This is AFAIK mainly related to various
callback scripts where an actual reference to the original object
is not being stored but rather just the string. This happens at least with
commands like "after". It's not an impossible situation, but is something
to keep in mind.

I'm not quite sure where to find the paper, but I believe USENIX's website
might be a good bet.

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

RE: [Xotcl] build problem on solaris

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

From: Schofield, Bryan \(GE Transportation\) <"Schofield,>
Date: Tue, 27 Jul 2004 13:18:23 -0400

I had that problem at as well. I didn't care to make xowish or xotclsh, I ended up commenting portions of the make file out to get it to work. Specifically, I commented out "binaries", "install", and part of "libraries" target.

I don't mean to speak for Gustaf, but maybe give this version a try:
  http://media.wu-wien.ac.at/download/xotcl-1.2.1.tar.gz

I don't think it's quite ready for primetime, since Gustaf & Co. are adding a few enhancements. But I think all that remains is documentation. I've been using it & testing out the new features for a about 2 months and consider it stable. That version also has a better build & configuration system and compiles with out complaint fine for me (which is the only reason I'm mentioning it, it was a painful to get the last publicly released version to compile on Solaris). I'm sure the XOTcl guys will correct me if I'm wrong.

I noticed you posted a question on the IncrTcl mailing list earlier today about "unknown" handlers. I think you'll find that XOTcl's unknown handler is fantastic. I've used IncrTcl extensively, but over the last 6 months or so I've began using XOTcl instead. I now prefer XOTcl greatly to IncrTcl. After using it, I feel so constrained with IncrTcl by having to fully define my classes, and thus my object behavior, a head of time. The flexibility of XOTcl is phenomenal.

-- bryan


> -----Original Message-----
> From: xotcl-admin_at_alice.wu-wien.ac.at
> [mailto:xotcl-admin_at_alice.wu-wien.ac.at]On Behalf Of Aamer Akhter
> Sent: Tuesday, July 27, 2004 12:42 PM
> To: xotcl_at_alice.wu-wien.ac.at
> Subject: [Xotcl] build problem on solaris
>
>
> Folks,
>
> I'm having a a makefile problem on solaris (the linux build went fine)
>
> gcc -pipe -shared -o libxotcl1.2.so so/xotcl.o so/xotclError.o
> so/xotclMetaData.o so/xotclObjectData.o so/xotclProfile.o
> so/xotclTrace.o so/xotclUtil.o so/xotclShadow.o so/xotclCompile.o
> so/aolstub.o so/xotclStubInit.o
> -L/auto/nsite-mmpls/users/aakhter/ats4.0/lib -ltclstub8.4
> : libxotcl1.2.so
> /bin/bash: -c: line 1: syntax error near unexpected token `;'
> /bin/bash: -c: line 1: `if test ! "x" = "x" ; then for dir in ; do
> if (cd $dir; make binaries) ; then true ; else exit 1 ; fi ; done;
> fi;'
>
> which is (with make -d):
>
> Finished prerequisites of target file `binaries'.
> Must remake target `binaries'.
> Putting child 0x00068080 (binaries) PID 17840 on the chain.
> Live child 0x00068080 (binaries) PID 17840
> /bin/bash: -c: line 1: syntax error near unexpected token `;'
> /bin/bash: -c: line 1: `if test ! "x" = "x" ; then for dir in ; do
> if (cd $dir; make binaries) ; then true ; else exit 1 ; fi ; done;
> fi;'
>
> makefile:
>
> binaries: $(BINARIES) $(XOTCLSH) $(XOWISH) pkgIndex.tcl
> _at_if test ! "x$(subdirs)" = "x" ; then \
> for dir in $(subdirs) ; do \
> if (cd $$dir; $(MAKE) $_at_) ; then true ; else exit 1 ; fi ; \
> done; fi;
>
>
> has anybody run into this problem already?
>
> --
> Aamer Akhter / aakhter_at_gmail.com
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>

Re: [Xotcl] broken web links, Tcl stubs

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, 8 Jul 2001 17:02:26 +0200

On Saturday 07 July 2001 17:08, BRIAN THEADO wrote:
> Hello,
>
> The links to the XOTcl mailing list and mailing list archive seem to be
> broken on the page http://media.wu-wien.ac.at/doc/index.html. They seem I
> found the link on the main XOTcl page to be O.K.

dear brian, thank you for reporting this; the page is automatically
generated, the script contained still the old link. it is fixed now.

> Also, I was wondering what the chances are that XOTcl be linked against the
> Tcl stubs library instead of directly against the Tcl library. This gives
> the freedom of using the same build of the extension with multiple versions
> of the TCL interpreter. This would be especially nice for the windows
> distribution. I don't have a build environment set up in Windows and the
> dll distributed on the XOTcl web page requires exactly Tcl 8.3 and doesn't
> work for me with 8.4.

this is a very reasonable suggestion. in general, using the stub library
should be no problem. the only difficulties i see is
for older tcl-version not supporting the stub library. therefore
the configure file has to me made more clever.... we will try to use the
sub libray for the next release.

best regards
-gustaf
>
> Thanks,
> Brian Theado
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.amexmail.com/?A=1
> _______________________________________________
> Xotcl mailing list - Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl

[Xotcl] Debian packages of xotcl 0.83

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

From: Teemu Hukkanen <tjhukkan_at_fishpool.fi>
Date: 05 Jan 2001 23:08:43 +0200

I've made debian packages of xotcl 0.83 available under the following
apt sources.list lines:

deb http://bugger.fishpool.fi/debian tcl /
deb-src http://bugger.fishpool.fi/debian tcl /

Known issues include:
- Lack of manpages for the binaries
- Tclexpat. There is a separate package of tclexpat in debian. Does
  xotcl need another copy?
- Gdbm modules. Gdbm 1.8 is not packaged in debian, 1.7 is, but xotcl
  uses gdbm 1.8 specific things

Of these, the first one is important, the other two are not.
When I get a manpage and some successful test reports, I'll upload them
to debian proper.

[Xotcl] error message lost when calling method during object creation

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

From: Koen Danckaert <koen_at_retarget.com>
Date: Wed, 21 Mar 2007 12:15:17 +0100

Hi,

It seems that error messages generated during object creation get lost sometimes. An example (using XOTcl 1.5.3 and tcl8.4.12):

Define a class and a method foo with a typo in it:

% Class C
::C
% C instproc foo {} {puds foo}

When foo is called on an existing object, we get the right error message:
% C c
::c
% c foo
invalid command name "puds"

However when foo is called during object creation, the error message is lost:
% C d -foo
 during '::d foo'
% set errorInfo
 during '::d foo'
    ::d ::xotcl::Object->configure
    ::C ::xotcl::Class->create
    ::C ::xotcl::Class->unknown
    invoked from within
"C d -foo"


Regards,
Koen

Re: [Xotcl] Missing Linux Binaries

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, 20 Sep 2004 22:13:55 +0200

On Monday 20 September 2004 17:33, MichaelL_at_frogware.com wrote:
> The XOTcl 1.3.1 Linux binary distribution file
> (xotcl-1.3.1-bin-linux-i686-glibc.tar.gz) is missing

Hi Michael,

i have updated te 1.3.1 binary on www.xotcl.org to include
the binaries of these libraries. due to the tea-3 change they
are installed under $(prefix)/lib/ in their own directories with
their own versions numbers, which are not necessarily
the same as the xotcl package...

best regards
-gustaf

>
> libxotclexpat1.3.so
> libxotclgdbm1.3.so
> libxotclsdbm1.3.so
>
> all of which were present in (at least) the 1.2 and 1.1.1 files (in the
> appropriate version, of course).
> _______________________________________________
> 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 und Neue Medien
Wirtschaftsuniversität Wien, Augasse 2-6, 1090 Wien

Next Page