* Useful rc idiom
@ 1992-02-26 19:47 Tom Culliton x2278
0 siblings, 0 replies; only message in thread
From: Tom Culliton x2278 @ 1992-02-26 19:47 UTC (permalink / raw)
To: rc
Please excuse me if I'm being redundant, I don't remember where I first
saw this or discovered it, but it seems like something that should
written in large letters. When writing functions in rc a useful idiom
for local variables (what C calls auto) is something like this...
fn func_name { xyz=() abc=$1 here=`{pwd} {
# Body of the the function which can be called recursively with each
# level getting it's own copy of the variables files, dirs and here.
# The arguments of course are still in $1 $2 ....
}}
This rc stuff sure is nice, isn't it. ;-)
Tom
BTW - if you don't do this and reuse variables inside a recursive
function it can be very hard to track down whats going on. ;-)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1992-02-27 1:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-02-26 19:47 Useful rc idiom Tom Culliton x2278
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).