Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] latest sorcery hangs on queue

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: "Eric Sandall" <eric AT sandall.us>
  • To: <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] latest sorcery hangs on queue
  • Date: Tue, 3 Dec 2002 08:48:13 -0800 (PST)

Sergey A Lipnevich said:
> Eric, why are you putting everything in braces ${blah} anyway :-)?

Well, it's not really necessary and it bloats (a little) the grimoire, but
I am mostly doing it so that when new SMGL users are looking through the
code base, they see that parameters are done this way, and so we won't
have problems with weird variables. It's mostly to "teach" the new users
(well, the ones who go through the grimoire for examples, anyways ;)) a
"proper" way to code, getting them in a "good" habit.

Example:

VERSION=$SPELL_$VERSION_stable

This would cause problems, unless the braces are used to explicitly define
the variable name (I know you know this, this is for those who're reading
whom do not :)). So, now the user would be asking why their spell isn't
working, unless they had learned to do it with the braces, then it would
look like this:

VERSION=${SPELL}_${VERSION}_stable

Which would then assign the correct version information to VERSION.

So, that is the long reason on why I try to use the braces. :)

-One of Four
a.k.a. sandalle

--
PGP Key 0x5C8D199A5A317214
http://search.keyserver.net:11371/pks/lookup?op=get&search=0x5A317214

Eric Sandall | Source Mage GNU/Linux Developer
eric AT sandall.us | http://www.sourcemage.org
http://www.sandall.us/~sandalle | SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org #196285 | http://www.shock.wsu.edu/






Archive powered by MHonArc 2.6.24.

Top of Page