MathGroup Archive 1995

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

Search the Archive

Confused about contexts ...

  • To: mathgroup at
  • Subject: [mg523] Confused about contexts ...
  • From: Paul E Howland <PEHOWLAND at>
  • Date: Wed, 8 Mar 1995 15:40:34 +0200 (IST)

Dear Mathgroup,

I think I'm getting my contexts in a muddle.  Can you help me with the
following please?

Consider the following simple package:

	test::usage = "Test function"
		test[a_] := Module[{}, z=Sin[x];Function[x,z]]

I'm trying to code a function "test" that returns a function as its argument.
Thus, _what_I'd_like_to_happen_ is this:

	In[1] := 
	In[2] := 
		f = test[a]
	Out[2] :=
	In[3] := 
	Out[3] := 

However, what actually happens is this:

	In[1] := 
	In[2] := 
		f = test[a]
	Out[2] :=
		Function[Example`Private`x, Example`Private`z]
	In[3] := 
	Out[3] :=
Of course, in reality my function is much more complicated than Sin[x], 
and has to be calculated by the function "test".  "test" takes in data 
(represented by the variable "a" in the example above) in order to try to
calculate this function.

What am I doing wrong?

Many thanks,

Paul E Howland                         

Long Range Ground Radar Systems Section               tel. +44 (0)1684 895767
CSS2 Division, Room BY209                             fax. +44 (0)1684 896315
Defence Research Agency                           email: PEHOWLAND at DRA.HMG.GB 
Malvern, Worcs, WR14 3PS, UK.                      

  • Prev by Date: How to identify equations
  • Next by Date: Vote NO!!!!!!!!!
  • Previous by thread: How to identify equations
  • Next by thread: Re: Confused about contexts ...