MathGroup Archive 2007

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

Search the Archive

Re: Whitespace weirdness.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74370] Re: [mg74340] Whitespace weirdness.
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Mon, 19 Mar 2007 21:53:05 -0500 (EST)
  • References: <200703190702.CAA24457@smc.vnet.net>

neither of them work on my box

On 3/19/07, wooks <wookiz at hotmail.com> wrote:
> 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.
>
>
>


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


  • Prev by Date: Re: Slots & Ampersands
  • Next by Date: Re: About TableForm
  • Previous by thread: Whitespace weirdness.
  • Next by thread: Re: Whitespace weirdness.