[squeak-dev] Closure testers needed

Ken Causey ken at kencausey.com
Thu Jul 16 16:59:27 UTC 2009


On Thu, 2009-07-16 at 10:23 -0400, Ian Trudel wrote:
> SqueakVM-Win32-3.11.3-bin.zip
> Squeak3.10-7159-basic.image
> SqueakV39.sources
> 
> All updates applied according to the given protocol.
> 
> fib := [:n| n < 2 ifTrue:[1] ifFalse:[(fib value:n-1) + (fib value:n-2)]].
> fib value: 10.
> 
>  89
> 
> Slight problem here...
> 
> /* wxMaxima 0.8.0
> 
> (%i1) fib(10);
> (%o1) 55
> 
> Ian.

The problem here is the fib implementation and not closure support, you
will get the same result in any Smalltalk implementation.  It defines
the fib value: 0 as 1 and not 0 so as a result the implementation is off
by one step at every point.

Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090716/dac977a7/attachment.pgp


More information about the Squeak-dev mailing list