Whitespace weirdness.
- To: mathgroup at smc.vnet.net
- Subject: [mg74340] Whitespace weirdness.
- From: "wooks" <wookiz at hotmail.com>
- Date: Mon, 19 Mar 2007 02:02:41 -0500 (EST)
Clear[Eternity,x]; Eternity[x_]:=Eternity[x]; Clear[EmptyQ]; EmptyQ[{}] := True; EmptyQ[x_List] := False; EmptyQ[x_] := Print["Argument to EmptyQ must be a list."]; Clear[length,list,f,g] Function[f, Function[list,If[EmptyQ[list],0, 1+f[Rest[list]]]]] [Function[g, Function[list,If[EmptyQ[list], 0, 1 + g[Rest[list]]]]][Eternity]] Clear[length,list,f,g] Function[f, Function[list,If[EmptyQ[list],0, 1+f[Rest[list]]]]] [Function[g,Function[list,If[EmptyQ[list], 0, 1 + g[Rest[list]]]]][Eternity]] Here are 2 versions of the same anonymous function. The only difference between them is that in the second version Function[g.... starts on a new line. One of them works. The other generates a syntax error.
- Follow-Ups:
- Re: Whitespace weirdness.
- From: "Chris Chiasson" <chris@chiasson.name>
- Re: Whitespace weirdness.