MathGroup Archive 1995

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

Search the Archive

Re: Programming


In article <4b8583$app at dragonfly.wri.com>,
Jack Goldberg  <jackgold at umich.edu> wrote:
>Hi Group;
>
>	Here is my problem:  Suppose  BuiltIn[expr_]  is an 
>operation either native to Mma or an operation appearing in 
>some complicated, lengthly package.  Suppose that  BuiltIn 
>does not always work.  (An example might be Integrate which 
>fails to find the anti-derivative  Integrate[1/(1+Log[x]),x].)
>When BuiltIn fails I want to try  MyOperation[expr_], but ONLY 
>if BuiltIn fails!  Interactively, this is trivial.  Whenever 
>BuiltIn fails, I recognize the failure because Mma echos the 
>Input in the Output.  (The output of Integrate[1/(1+Log[x]),x] 
>is itself.) 

Jack,

  I have seen the following trick used in various packages:

	foo = BuiltIn[expr];
	If[Head[foo] =!= BuiltIn, foo, MyOperation[expr]]
    


		Dave Wagner
		Principia Consulting
		(303) 786-8371
		dbwagner at princon.com
		http://www.princon.com/princon


  • Prev by Date: Re: Programming
  • Next by Date: OLE in Mma 3.2.3 Windows --- any ideas?
  • Previous by thread: Re: Programming
  • Next by thread: Re: Programming