For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2005 > Advice on writing package for waveform extraction needed.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Advice on writing package for waveform extraction needed.
Svenn Are Bjerkem

2005-10-20, 7:57 am

Hi,

I am thinking of writing a package to extract simulation data from a
result database and I am currently in the phase of understanding how to
to it.

I have looked at some of the packages that are available through tcllib.
most of these use the scheme:

::package::command -opion arg -option2 arg2

if there is a need for a token of some type
::package::init token
::package::command $token

some use the scheme

set thing [::command::init -option arg]

and then do

$thing command1
$thing command2 -option arg

What are the important things that I have to identify in order to be
able to deside which of these two schemes to use for my implementation?

I found some examples on how to write packages on the wiki, but no real
rationale _why_ writing packages this or that way.

Comments and/or links welcome.
--
Svenn
Kaitzschu

2005-10-20, 7:00 pm

I think it is a matter of taste. Those using
set token [::package::init -option arg]
::package::command $token -option arg
favor "classic" way of doing things. If it is worth anything for you, this
is what I'd use. On the other hand, I'm no authority :) Those using
set thing [::package::init -option arg]
$thing command -option arg
favor more "modern" object oriented programming. This is pretty much the
same (on implementation side) as the first one, but it looks neater, needs
wrapper commands (created on the fly, mostly) and has the noble ability to
give $thing a name that has nothing to do with what it really is. Gosh, I
just love objects with creative names.

It is truly up to you how to continue from here, code is what matters,
rest is just pleasing the users :)

--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done
Svenn Are Bjerkem

2005-10-21, 3:58 am

In article <Pine.LNX.4.64.0510201737310.8541@lastu36.oulu.fi>,
kaitzschu@kaitzschu.cjb.net.nospam.plz.invalid says...
> It is truly up to you how to continue from here, code is what matters,
> rest is just pleasing the users :)


Thanks for your comment. I will introspect myself to find my personal
tcl coding taste and then look at some more code.

--
Svenn
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com