On 2003.01.17, Peter M. Jansson <[EMAIL PROTECTED]> wrote:
> [...] I've done it by using an array with specially-crafted indices,
> and using wrapper functions so I can do things like "set orders
> [customers orders $customer_id]" and get a list of order IDs. [...]
Sounds like you've got object-oriented envy. I wonder if getting [incr
Tcl] working under AOLserver is where you want to go ...
> Recently, I've gotten to do some work in WebObjects, [...]
Yes, you've definitely got OO envy. EOF/EOModeler is neat, isn't it?
> I think the 8.4 list implementation is a step in the right direction;
> I don't know if it's really what I'm looking for, but I think it will
> be cleaner (and probably faster, given the implementation differences
> between arrays and lists) than the array implementation I've done.
If you want to make Tcl pretend like it has OO constructs, without using
something like [incr Tcl], you can cheat:
proc new {class} {
set classProc $class.$n
incr n
eval "proc $classProc {args} {
switch -- $args {
methodname {
# code method is supposed perform
}
}
}"
return $classProc
}
set foo [new Foo]
$foo methodname
You'll obviously want to explore namespaces and "member variables" be
namespace variables, etc.
But, again, I don't know if this is really solving your problem, but it
satisfies the OO envy.
-- Dossy
--
Dossy Shiobara mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
"He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)