Re: $valPHPPath already declared error when I use this block



comp.lang.tcl wrote:
Again, I can't fathom this. Why do I not have to declare global a
second time; it doesn't exist obviously within the scope of the proc
since [info exists valPHPPath] is false. I am way confused now.

Because whether a variable is global is independent of whether the variable exists. "Exists" means you have assigned a value.

--
Darren New / San Diego, CA, USA (PST)
Scruffitarianism - Where T-shirt, jeans,
and a three-day beard are "Sunday Best."
.



Relevant Pages

  • Re: $valPHPPath already declared error when I use this block
    ... if {![info exists valPHPPath]} { ... You declare the variable named "valPHPPath" to be a global. ... a proc) though. ... second time; it doesn't exist obviously within the scope of the proc ...
    (comp.lang.tcl)
  • Re: I thought this was the one that worked?
    ... I guess you could debate whether that block is a closure, ... you've turned it into a Proc, so technically the Proc, rather than the ... not calling a Proc object derived from the ... _not_ the same scope as the scope where the block was created. ...
    (comp.lang.ruby)
  • Re: Delphi marketing manager..
    ... it's counterproductive with the target folks. ... The Monitor Delphi time), but as a part of my "where to go" research I've ... A whitepaper on variable scope and lifetime would be very useful. ... in procs, the scope is the proc and the lifetime is "life of the app". ...
    (borland.public.delphi.non-technical)
  • Re: upwar and multi-dimension array
    ... proc print_out { ... upvar $name array1 ... I tried to search "scope in Tcl" and find the answer but fail, ... so an upvar in the print_out procedure by is trying to ...
    (comp.lang.tcl)
  • Re: Deferring proc bindings
    ... it's taken from the scope where the lambda is created. ... The reason is that the binding the proc uses ... defined inside the method body. ... If the binding needs to be flexible then it really ...
    (comp.lang.ruby)