Re: Call by Reference
- From: "tom.rmadilo" <tom.rmadilo@xxxxxxxxx>
- Date: Mon, 22 Oct 2007 16:48:50 -0000
On Oct 21, 1:06 am, Andreas Leitgeb <a...@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
tom.rmadilo <tom.rmad...@xxxxxxxxx> wrote:
This point may sound esoteric, but the underlying principle should be
familiar. Which is better: a hand-operated drill, an electric drill,
or a drill press?
My suggestion is about creasing the handoperated drill that we have
for easier drive.
So the idea didn't sink in? We already have exactly what you want in
Tcl. You are confusing Tcl with other languages, and you are focusing
on something you see as a problem without understanding how Tcl has
solved this issue. Worse is it that your solution completely changes
the clean syntax. Whenever you start referencing how other languages
do xyz, just remember: Tcl isn't those other languages, thank goodness
for that.
Here is the basic concept: don't encode information into variable
names or any names in Tcl. Don't encode type information, don't encode
things that you think exist in Tcl (which don't). Strings don't become
variable names until they are used as variable names
You may think this is off base, but consider several commands: lappend
and linsert. Lappend take the name of a list, but linsert takes the
actual list. Your suggestion would be that lappend would change so
that you would do [lappend &mylist a b c]. Otherwise you have a major
distinction between pass by ref and by name. Then we could move on to
the array functions [array get &myarray]. Wow, that looks so cool. If
you don't require this, then you have two different ways of writing
commands. Or maybe you think there should be a difference between
procs (defined by proc) and commands? I don't.
You might try looking at namespaces if you don't like upvar. It is
just like a named stack/level. And it maintains state for you.
Also, there are no *small* syntax changes. You are doubling the number
of ways to pass information.
.
- Follow-Ups:
- Re: Call by Reference
- From: Andreas Leitgeb
- Re: Call by Reference
- References:
- Call by Reference
- From: Andreas Leitgeb
- Re: Call by Reference
- From: tom.rmadilo
- Re: Call by Reference
- From: Andreas Leitgeb
- Call by Reference
- Prev by Date: Re: Impersonation on Windows on a per-interpreter basis
- Next by Date: Re: Call by Reference
- Previous by thread: Re: Call by Reference
- Next by thread: Re: Call by Reference
- Index(es):
Relevant Pages
|