[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fun-O Basic Edition Compiler




"Scott McKay" <swm@mediaone.net> wrote in message
iQkW7.39099$5W5.14789627@typhoon.ne.mediaone.net">news:iQkW7.39099$5W5.14789627@typhoon.ne.mediaone.net...
>
> "Carl Gay" <carlgay@mediaone.net> wrote in message
> news:3C2938A6.4242FE86@mediaone.net...
>
> >
> > define method tak (x :: <integer>, y :: <integer>, z :: <integer>)
> >   if (y >= x)
> >     z
> >   else
> >     tak(tak(x - 1, y, z),
> >         tak(y - 1, z, x),
> >         tak(z - 1, x, y))
> >   end if
> > end;
> >
>
> Try adding '=> (r :: <integer>)' as the return result of 'tak'.  I'll bet
> that your use of the implicit return type of <object> is defeating some
> of FD's optimizations.
>
>

Oh, and the timing loop should be for (i :: <integer> from 0 below 2000).
You should add a fixnum decl to the Lisp code, too.

Then you'll be comparing apples to apples in all the code, because the
Java code is fully typed as 'int'...