Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Functions, Part 1

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg564] Functions, Part 1
  • From: Jack Goldberg <Jack.Goldberg at math.lsa.umich.edu>
  • Date: Fri, 17 Mar 1995 10:04:44 -0500 (EST)

Hi mathgroup:
	In trying to understand all the differences between
f[]  and  Function[]  I ran across something which puzzles me.
Consider the following:

(1)	f[x_] := x + 1

(2) 	g = Function[x,f[x]]

(3)	h = Function[x,Function[y,y+1]]

Now  g[2]  and  f[2]  output  3  as expected.  But 
h[2] (indeed, h[garbage]) outputs  Function[y,y+1].  What`s going on?
	Clearly, I do not understand exactly what happens when one 
uses the notation  Function[x,body][2]  since what I thought happens  
was this:  Every appearance of  x  in the expression "body"  is 
replaced by 2 and then body is evaluated.  In view of (3) this 
surely is not what happens.  Or am I way off base?
Jack


  • Prev by Date: Re: suggestions?
  • Next by Date: Re: auto notebook running
  • Previous by thread: Re: (-1)^(3/4) -> (-1+I)/Sqrt[2]
  • Next by thread: Re: Functions, Part 1