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

Weblog Page

Showing 941 - 950 of 1561 Postings (summary)

[Xotcl] Bug in xodoc

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, 20 Dec 2000 15:42:08 +0200 (EET)

It seems to ignore the last line of a file if that last line doesn't
end with a newline but with an EOF.

Probably easy to fix so I might do it myself (as I'm planning to look
through the source myself to add some bits).

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

[Xotcl] XOTcl behaviour

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

From: Murr, Florian <florian.murr_at_siemens.com>
Date: Mon, 18 Sep 2006 11:46:46 +0200

Dear XOTcl team,
 with XOTcl1.4.0 and XOTcl1.5.0 I encountered the following behaviour:


------------------------------------------------------------------------
Class X -parameter {
    {p {}}
}

    # works fine
    X create x1 -p {a b c}

    # blows up!!
    X create x2 -p {-name a -xyz b}

------------------------------------------------------------------------
--
IMHO there should be no dependency on the value of a parameter, whether
an Object is created or not.
In my programs I depend on being able to pass any value to the parameter
in question!
regards,
 - Florian

Re: [Xotcl] xotcl::nonposArgs

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

From: Stefan Sobernig <stefan.sobernig_at_wu.ac.at>
Date: Wed, 15 Jul 2015 13:58:16 +0200

Hi Michael!

>> What is the correct way to port this to XOTcl 2.0?

This is most likely not an authoritative answer, I don't have the time
right now to think this through properly. The following should get you
going for the time being:

if {[info command ::nx::methodParameterSlot] ne ""} {
     ::nx::methodParameterSlot object method type=sourced_guid {name
value args} {
        if {![::nsf::is object $value] || [xotcl::Object info instances
-closure $value] eq ""} {
            error "'$value' is not an XOTcl object"
        }
        if {![$value istype ::foo::bar::SourcedGuid]} {
            error "'$value' is not of type SourcedGuid but [$value info class]"
        }
     }
}

If you plan to co-maintain two code bases (one compatible with 1.6 and
the other for 2+), then you might want to consider factoring out the
value checker into a plain Tcl proc and forward/alias to this proc
conditionally from ::xotcl::nonposArgs and ::nx::methodParameterSlot,
respectively.

I leave this as an exercise to you ;)

Let me know whether the above works for you for the time being.

Cheers,
Stefan

P.S.: I suggest using "return -code error" in your value checker to skip
one level on the callstack trace reported to the developer, to hide the
details of the value checker in the reported trace.

[Xotcl] ::xotcl::object autoname crashes in Tcl 8.5

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

From: Mark Janssen <mpc.janssen_at_gmail.com>
Date: Mon, 18 Sep 2006 17:57:59 +0200

When using XOTcl 1.4 or 1.5 on Tcl 8.5 creating an instance with an autoname
crashes the Tcl process. On 8.4.13 it works:

XOTcl 1.4

> tclsh
% set tcl_patchLevel
8.4.13
% package require XOTcl
1.4.0
% ::xotcl::Object autoname a
a0
%

>tclsh
% package require XOTcl
1.4.0
% set tcl_patchLevel
8.5a5
% ::xotcl::Object autoname a
# crash with access violation

XOTcl 1.5


> tclsh
% package require XOTcl
1.5.0
% set tcl_patchLevel
8.4.13
% ::xotcl::Object autoname a
a1
%

> tclsh
% package require XOTcl
1.5.0
% set tcl_patchLevel
8.5a5
% ::xotcl::Object autoname a
# crashed with access violation

% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine) = intel
tcl_platform(os) = Windows NT
tcl_platform(osVersion) = 5.1
tcl_platform(platform) = windows
tcl_platform(threaded) = 1
tcl_platform(user) = mjanssen
tcl_platform(wordSize) = 4

Is this a known problem? I am able to work around it by only using new and
create.

Regards,
Mark

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 12:17:09 +0200

On 20 Mar 2006, at 12:10, Koen Danckaert wrote:

>> Snit has a "myvar" method that returns the fully qualified name of
>> a snit member variable. Perhaps something similiar (a method that
>> returned a "reference" to an instance variable) would be useful in
>> XOTcl?
>
> I use the following two global procs for that:
>
> proc myproc {args} {linsert $args 0 [uplevel 1 self]}
> proc myvar {var} {return [uplevel 1 self]::$var}
>
> The procs are global (not instprocs on "Object") because otherwise
> I would have to write "my myvar" or "my myproc". Now I can simply
> use them in the following way inside xotcl (inst)procs:

Aren't you forgetting the [requireNamespace] from the above code?

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

Re: [Xotcl] seachDefaults?

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, 11 Aug 2010 11:30:05 +0200

  On 10.08.10 00:38, Kristoffer Lawson wrote:
> Gustaf (or others working on the core), you didn't say if this was an oversight of the current XOTcl documentation, or if somethins is missing on the [searchDefaults] stuff.

Dear Kristoffer,

I was never happy with the way how searchDefault works in
xotcl 0.* and xotcl 1.*,
so the missing detailed documentation discourages people to
depend on it.
The method "searchDefaults" is not defined on
::xotcl::Object but on the
parameter class. This will change in the near future,
parameter classes
in general will disappear.

The object parametrization (the classical "parameters" of
XOTcl) will be completely
different in XOTcl 2.0, highly orthogonal with method
parameterization (defining
positional/non-positional, optional/required valuechecked,
... arguments for
methods implemented in C or scripted). So, be warned that
things will
change in this area.

However, providing an answer to your question:
Experienced xotcl users use a filter to figure out the details:
===============================================
  Object instproc traceFilter args {
     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 }
     }
     puts "CALL $context> [self]->$method $dargs"
     set result [next]
     puts "EXIT $context> [self]->$method ($result)"
     return $result
   }

Class create Car -parameter {{wheels 4} {color white}}
Class create Ford -superclass Car -parameter {{color black}}

Object instfilter traceFilter
Ford create t-model
Object instfilter ""
===============================================

If you want, you can define an object-specific method such
you do not have to mess much with the parameter classes:

===============================================
   ::xotcl::Object instproc set_instance_vars_defaults {} {
       set pcl [[my info class] info parameterclass]
       $pcl searchDefaults [self]
   }
===============================================

Best regards
-gustaf neumann

XOTcl/NX mailing list by object move?

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 Mar 2006 15:13:03 +0100

Scott Gargash schrieb:
>
> xotcl-bounces_at_alice.wu-wien.ac.at wrote on 03/19/2006 05:32:31 AM:
>
> >
> > 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.
>
> Snit has a "myvar" method that returns the fully qualified name of a
> snit member variable. Perhaps something similiar (a method that
> returned a "reference" to an instance variable) would be useful in
> XOTcl?
>
well, without trying it out. variable_reference could look like:

Object instproc variable_reference name {
   my requireNamespace
   return [self]::$name
}

in many situations, these fully qualified variable references are not
needed,
since e.g. the forwarder allows variable names to be used in scope of an
object, such that e.g.

  obj set x 100
  obj lappend y 1 2 3

does the right thing (interpret variable references x and y in the obj
scope),
no matter whether obj has a object-specific namespace or not. It would
be rather painful to write

   obj lappend [obj variable_reference y] 1 2 3

These forwarders are registered during startup via:

foreach cmd {array append lappend trace eval unset} {
  ::xotcl::Object instforward $cmd -objscope
}

-gustaf neumann

[Xotcl] XOTcl 1.6.0 for Windows and FreeBSD users

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

From: Martin Matuska <martin.matuska_at_wu-wien.ac.at>
Date: Mon, 25 Feb 2008 14:49:26 +0100

*XOTcl ver. 1.6.0 is now available for Windows and FreeBSD users*

------------------------------------------------------------------------
For users of Microsoft Windows:

WinTclTk distribution for Microsoft Windows, versions 8.5.1 and 8.4.18
URL: http://wintcltk.sourceforge.net

Single-file Tkcon executable (no need to install anything, just run & try)
based on Tcl/Tk 8.5.1 or 8.4.18 including XOTcl 1.6.0 can be downloaded
from:
URL: http://wintcltk.sourceforge.net/tkwrap.html

------------------------------------------------------------------------
For users of FreeBSD:

FreeBSD ports tree (packages will be built in the next days)
URL: http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/xotcl/

[Xotcl] XOTcl, threading and AOLserver ?

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

From: Gustaf Neumann <Gustaf.Neumann_at_wu-wien.ac.at>
Date: Thu, 16 Nov 2000 19:31:09 +0100 (CET)

>>>>> "Zoran" == Zoran Vasiljevic <zoran_at_munich.com> writes:
Zoran> Hi !
Zoran> First of all, I'm very excited about XOTcl ! I think
Zoran> you did an excellent job.
Zoran> ...
Zoran> Question 2: <read on>
Zoran> Having nice introspection capabilities built into the
Zoran> XOTcl, I wonder if one can write a Tcl script which
Zoran> runs against the initialized interpreter and builds up
Zoran> a script needed to re-construct all classes and/or object
Zoran> which it finds there (in the interpreter)?

Zoran> Why should one need this ?

Zoran> Well, the AOLserver webserver which we use is a little bit
Zoran> special. It sources initialization files in startup thread/interp
Zoran> and then runs a series of scripts to get the interpreter
Zoran> blue-print. This blue-print (in form of Tcl-code) is then
Zoran> ran against each newly created interpreter. This is to
Zoran> simplify and speed-up of new interpreter(s) initialization.
Zoran> In order to use XOTcl in AOLserver, one should be able to
Zoran> produce such a script programatically.
Zoran> For plain Tcl code, this is no big deal. I think XOTcl would
Zoran> not pose any problem, but nevertheless, it's better to ask.

Zoran> Any comments ?

Hi Zoran,

there are no such problems, it is indeed quite easy to reproduce
a script from Objects and classes. Here is a simple script for
object serialization that you might use as an starting point. Class
serialization works very similar...

best regards
-gustaf

===========================================================================
Object instproc serialize {} {
  ::set o [self]
  if {![Object isobject $o]} { error "$o is not an object" }
  ::append cmd [list [$o info class] $o] \n
  foreach i [$o info procs] {
    ::append cmd [list $o proc $i [$o info args $i] [$o info body $i]] \n
  }
  foreach v [$o info vars] {
    if {[string match __* $v]} continue ;# internal variables
    if {[$o array exists $v]} {
      ::append cmd [list $o array set $v [$o array get $v]] \n
    } else {
      ::append cmd [list $o set $v [$o set $v]] \n
    }
  }
  ::append cmd [list $o mixin [$o info mixin]] \n
  foreach child [[self] info children] {
    ::append cmd [$child serialize] \n
  }
  return $cmd
}


Object o1
o1 set var1 100
o1 set var2 "hi there"
o1 set price(potato) 10
o1 set price(tomato) 20
o1 proc test {a b} {
  puts "a=$a, b=$b"
}
Object o1::x
o1::x set y 100

puts --------------------
puts [o1 serialize]
puts --------------------
===========================================================================

[Xotcl] XOTclIDE Version 0.50

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

From: Artur Trzewik <mail_at_xdobry.de>
Date: Mon, 1 Sep 2003 21:00:30 +0200

Hi!

New Version of XOTclIDE 0.50 is released.
http://www.xdobry.de/xotclIDE

There are new overworked documentation (also in PDF)
"XOTclIDE User Guide" with new tutorials.

changes:
- undo for editor (only for Tcl8.4)
- spinbox windows in "Component Browser"
- big fixes in code importer (procedures defined in namespace eval can be
imported)
- changes for better saving and loading components from file system
- another small changes see CHANGES file

Artur Trzewik

<<Havu multa ĝojon de ĝi>>

Next Page