Lorenz Minder on Thu, 01 Oct 2009 12:41:55 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: experimental patch for iferr


> On Thu, Oct 01, 2009 at 07:55:42AM +0200, Lorenz Minder wrote:
> > Hi,
> > 
> > 2) I'd prefer if the second argument was a reference, i.e., one would
> write
> > 
> >    iferr(whatever, &E, seq1, seq2)
> > 
> > Right now it seems that this is the only function in GP that
> > modifies an argument that was (syntactically) passed by value.  I have
> > no idea if this is difficult to do.  (I've no time for studying
> > source code ATM, unfortunately.)
> This is a misunderstanding: E is not modified! E is actually a local
> parameter
> that only exist in the 'err' branch, as in the following expressions:

Yes, right. I only realized this after experimenting a bit more with it.
So it's fine as is, of course.

On an unrelated note, I found another failing instance, possibly the
same bug as before.

? iferr(1/0, E, ["fail", E], "ok")
  ***   at top-level: iferr(1/0,E,["fail",E],"ok")
  ***                             ^----------------
  ***   the PARI stack overflows !

GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01