MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NestWhile

  • To: mathgroup at
  • Subject: [mg23103] Re: [mg23039] NestWhile
  • From: Daniel Reeves <dreeves at>
  • Date: Wed, 19 Apr 2000 02:30:39 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

> So negate the NestWhile condition for SameTest, but when FixedPoint then
> stops it has run one step too far, so get one back in ListFixedPoint. I
> have not the time now, but you may continue that reasoning for building
> up the full interface.

just use #2 in the SameTest:

nestWhile[f_, expr_, test_] := 
  FixedPoint[f, expr, SameTest -> (!test[#2]&)]

that works like the builtin NestWhile, for the 3-arg case.

--    --    --    --    --    --    --    --    --    --    --    -- 
Daniel Reeves     

This .signature is to recommend a quite cool thing called PayPal:
Not to mention we each get $5 if you sign up!  Really.

  • Prev by Date: Q: how to rank a list of elements?
  • Next by Date: Re: Needs[] and <<
  • Previous by thread: Re: NestWhile
  • Next by thread: Re:NestWhile