Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: Memory leak...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 13 Topic 2195 of 2317
Post > Topic >>

Re: Memory leak of iterations in large hash.

by iaminsik <iaminsik@[EMAIL PROTECTED] > Mar 24, 2008 at 09:02 PM

On 3=EC=9B=9419=EC=9D=BC, =EC=98=A4=ED=9B=8411=EC=8B=9C31=EB=B6=84,
gaze...@[EMAIL PROTECTED]
 (Kenny McCormack)
wrote:
> In article
<5de8b96e-75af-4e74-9c9f-46d9c5dc6...@[EMAIL PROTECTED]
>,iaminsik =C2=A0<iamin...@[EMAIL PROTECTED]
> wrote:
>
> ...
>
> >I've never heard of declare variables as 'local' in awk.
>
> TAWK has true local variables, which is very nice, but in "standard"
> AWK it is done via a (widely accepted and practiced) kludge. =C2=A0See
bel=
ow.
>
>
>
> >> I would declare then (in the "function" statement) so there would be,
> >> for example, no chance of "i" in one routine conflicting with "i" in
> >> another.- =C2=B5=C3=BB=C2=BF=C3=82
=C3=85=C3=98=C2=BD=C2=BA=C3=86=C2=AE=
 =C2=BC=C3=BB=C2=B1=C3=A2=C2=B1=C3=A2 -
>
> >Can you show an example?
>
> The idea is that you declare your funciton like this:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 function foo(arg1,arg2, =C2=A0 =C2=A0 =C2=A0
=
=C2=A0 tmp1,tmp2,tmp3) {}
>
> And then call it with only 2 args. =C2=A0The additional args get
initalize=
d
> to "" (as if they had been passed by the caller as ""), and act like
> local variables in the function.
>
> It is also conventional to separate the "real" args from the fake args,
> with whitespace, as I have done above.

Sorry for this late reply. :)
It's a nice trick.
I'll try!

Best Regards.
Remi.
 




 13 Posts in Topic:
Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-17 20:29:41 
Re: Memory leak of iterations in large hash.
Joel Reicher <joel@[EM  2008-03-18 03:41:41 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-17 21:30:04 
Re: Memory leak of iterations in large hash.
Ed Morton <morton@[EMA  2008-03-18 06:43:13 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-18 05:53:41 
Re: Memory leak of iterations in large hash.
Ed Morton <morton@[EMA  2008-03-18 08:11:13 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-18 07:12:18 
Re: Memory leak of iterations in large hash.
Ed Morton <morton@[EMA  2008-03-18 09:37:42 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-18 07:57:27 
Re: Memory leak of iterations in large hash.
mjc <mjcohen@[EMAIL PR  2008-03-18 12:56:51 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-19 07:13:28 
Re: Memory leak of iterations in large hash.
gazelle@[EMAIL PROTECTED]  2008-03-19 14:31:33 
Re: Memory leak of iterations in large hash.
iaminsik <iaminsik@[EM  2008-03-24 21:02:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 20:16:11 CDT 2008.