Version 2 of An implicit {*}$ prefix

Updated 2007-09-18 00:19:26 by MJ

Given Tcl 8.5's {*} expand feature, and an earlier thought experiment about adding a leading "$" to every command (can't recall what wiki page this was) ...

What would a system be like if it worked as follows - this notation:

    set obj {...}
    set result [obj arg1 arg2 arg3]

... would behave as if it had been written as follows in Tcl 8.5:

    set obj {...}
    set result [{*}$obj arg1 arg2 arg3]

It obviously wouldn't be Tcl, since the variable and command namespace get mixed up when you start doing this.

But suppose you didn't care (Tcl 3000!) - would it be useful? convenient? worth looking into?

MJ - I am not seeing the use for the implicit $, is it so much trouble to write [$obj arg1 arg2 arg3]? Autoexpansion of the leading word would be very useful however (especially in OO type constructs and functional programming).

It seems you are suggesting unification of variables and procs, which sounds a lot like the concept of slots in Self, in that case $ will become unecessay. Getting the value of a var is simply var.