MathGroup Archive 2010

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

Search the Archive

Re: Can This be Possible? A bug in Set (=) ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110857] Re: Can This be Possible? A bug in Set (=) ?
  • From: James Stein <mathgroup at stein.org>
  • Date: Thu, 8 Jul 2010 20:33:38 -0400 (EDT)

Dear David and John,

Thanks for your explanations.  I remember now what I was trying to do with
SelectionEvaluate. It was something like this (I simplify the situation):

Suppose 'g' is a deeply recursive function, defined something like this (to
make calculations faster by preventing re-valuation with identical
arguments,):


g [ n_Integer, a_List ] :== g [ n, a ] == Module [ (* =85 *) ] ;


I discovered that I often wanted to be able to clear currently retained
computed values of g, then compute another value of g, without having to
evaluate (click in) more than one cell.  Placing the evaluation of g in the
same cell where g was defined was a bad choice during debugging.


Looking for a solution, it appeared that 'EvaluateSelection' might work. In
retrospect, I could have simply changed the second g to an f:


g [ n_Integer, a_List ] :== f [ n, a ] == Module [ (* =85 *) ] ;


Then something like this, in a single cell, works:

Clear [ f ]

g [ 3, { 1, 2, 3 } ]

Clear [ f ]

g [ 4, { 5, 3, 12} ]



  • Prev by Date: Re: replacement x->y except in Exp[x]
  • Next by Date: Re: FindMinimum numerical constraint functions
  • Previous by thread: Re: Can This be Possible? A bug in Set (=) ?
  • Next by thread: replacement x->y except in Exp[x]