[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Why bind variables ?
Seems to me bound variables are a conceptually beautiful way to manipulate
variables in the way that the language intends. Bullet (2) saves you extra
memory that is used for the bound variables (since you need to instantiate
it as a tcl variable), but in otcl space you can only manipulate a
_copy_ of the variable (i.e., its value) but not the shadow of the c++
variable itself. One example might be using upvar.
However, I don't remember seeing any such examples in the ns tcl code, and
I like to use (2) a lot because of the memory overhead of (1).
- Haobo
> 1) in what cases should i define the same variable in
> OTCl and C++ and use the "bind" function ?
>
> 2) in what other cases it's better to pass that
> parameter from OTCl to C++ (and viceversa) putting it
> as a function parameter ?
>
> Thanks a lot,
> Andrea.
>
>
> ______________________________________________________________________
> Do You Yahoo!?
> Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it
>
>