Is there something similar to C’s static keyword?
I want a single function, which has to access and modify a permanent
variable. Any solution without bundling the function to a class?
Is there something similar to C's static keyword?
I want a single function, which has to access and modify a permanent
variable. Any solution without bundling the function to a class?
Could you be more verbose? Eg. how to print out how many times a
function was called.
Gergo
···
On 0807, ts wrote:
Is there something similar to C’s static keyword?
I want a single function, which has to access and modify a permanent
variable. Any solution without bundling the function to a class?
Use a closure
–
±[ Kontra, Gergelykgergely@mcl.hu PhD student Room IB113 ]---------+ http://www.mcl.hu/~kgergely “Olyan langesz vagyok, hogy |
Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom” |
±- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+
Woof. Thx. It works, but it’s a bit too obscure hacking for a damned
easy counter, isn’t it?
···
On 0807, ts wrote:
Use a closure
Could you be more verbose? Eg. how to print out how many times a
in ruby, yes. in english, no
function was called.
svg% cat b.rb
#!/usr/bin/ruby
def test1
a = 10
proc { a += 1; puts a }
end