Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] persistent_save function being used in stable spells?

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Paul <dufflebunk AT dufflebunk.homeip.net>
  • To: sm-discuss <sm-discuss AT lists.ibiblio.org>
  • Subject: Re: [SM-Discuss] persistent_save function being used in stable spells?
  • Date: Sun, 18 Apr 2004 11:23:20 -0400

We could make an invisiblize function...
function invisiblize() {
local RET=$?
local func=$1
shift
$func "$@"
return $RET
}
which can wrap around any function. That's not a very nice thing though.
I believe that there's something wrong if we need to make nasty hacks
like that.


On Sun, 2004-04-18 at 04:37, Vladimír Marek wrote:
> > Hmm, also I had meant to point out that one of the reasons why sorcery is
> > not detecting failures is due to structures like this:
> > if [ -x BUILD ] ; then
> > persistant_load
> > . BUILD
> > persistant_save
> > else
> > default_build
> > fi &&
>
> I can see another danger there, in the
>
> persistant_load
> . BUILD
> persistant_save
>
> itself. If the BUILD fails, persistant_save is going to carry out the
> return also. There are two solutions I can see:
>
> a)
> persistant_load
> . BUILD && persistant_save
>
> b)
> persistant_save will maintain return value from last function:
> function persistant_save () {
> local RET=$?
>
> ....
>
> return $RET
> }
>
> Both solutions will work. But maybe a) is better, since if the spell
> failed, then no values should be saved ?
>
> I will add b) anyway, since that does not stop us from implementing a).
> What do you think ?
>
> --
> Neuron
> _______________________________________________
> SM-Discuss mailing list
> SM-Discuss AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-discuss
--
De mortuis nihil nisi bonum.

Attachment: signature.asc
Description: This is a digitally signed message part




Archive powered by MHonArc 2.6.24.

Top of Page