MathGroup Archive 2006

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

Search the Archive

Re: Re: "Skip this Input cell" module?


One gotcha is that the front end treats expressions separated by
newlines as different calculations unless the expression is inside a
construct that isn't complete without the information from the next
line. If you wrap the contents of an entire cell with a call to a
function, then you will not see any intermediate results (except for
Print, Message, and Dialog output).

On 8/21/06, AES <siegman at stanford.edu> wrote:
> Suppose at the start of a notebook one defines two functions
>
>       doCell[expr_] = expr ;  skipCell[expr_] = Null ;
>
>       (or maybe   skipCell[expr_] = Print["Input skipped"] )
>
> that are intended to be wrapped around the full contents of certain
> Input cells in order to temporarily allow or suppress execution of those
> particular Input cells.
>
> Assuming the Input cells always contain a proper sequence of executable
> expressions, will these definitions have any hidden "gotchas"?
>
> Would they be better defined with = or := ?  (or as Modules?)
>
> Should the argument be [expr_]  or  [expr_Expression]?  (Is Expression a
> Head?  The Mathematica Book doesn't seem to be totally clear about this.)
>
> Any other hidden gotchas if one defines instead
>
>    doCell[test_, expr_] = If[test, expr, Print["input skipped"]];
>
> Thanks for advice and counsel.
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: programming books / tutorials
  • Next by Date: Re: Re: "Skip this Input cell" module?
  • Previous by thread: Re: "Skip this Input cell" module?
  • Next by thread: Re: Re: "Skip this Input cell" module?