Re: Call by Reference



tom.rmadilo <tom.rmadilo@xxxxxxxxx> wrote:
Any useful body of code would therefor trend to remove your partial
solution to a more general solution so that code appears consistent.
I don't understand this.

Simply looking at one or two procs as an example is totally pointless.
I disagree to this.

Consistency is much more important than shortcut code. This is the
disease of languages like C, where you can skip certain syntax
requirements under certain conditions. It helps nobody in the long
run.
I quite strongly disagree to this. I think not always having to
write "unsigned" or "signed" for an int, and leaving out redundant
noise was, what made C an interesting language as opposed to
pascal, where you had to always do something with returned values,
and had to type long "begin end" instead of short "{}"

That said, one shouldn't of course overdo it, like the perl guys did.

I'm not targetting to make tcl a second C, but some of the non-obvious
magic-spells for common tasks are on my "Things I'd like to change in
Tcl"-list.

eval with [list]-protecting the non-expansive parts was #1 one on that
list. Thank $deity for {*}-syntax to get rid of *these* usages of eval.

Getting rid of those "upvar"s that are used for call-by-reference/name
of course has much smaller priority (even in my mind) than eval had.

The basic problem here is that us programmers have a tendency to think
that because something is easy for us, it will be easy for a computer
program. For whatever reason, it is much easier for humans to adapt
than programs.
This is not true for redundant repeating of words, as happens with
upvar and the variable names. This is one weak point for humans, who
have a tendency of adding non-deterministic typo-noise into repetitions.

Eventually everything has to be explained to
this poor ignorant chunk of code.
That step is called "implementation" :-)

.



Relevant Pages


Loading