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

RE: call/cc




   From: "David Simmons" <David.Simmons@smallscript.net>
   Date: Mon, 17 Dec 2001 15:58:33 -0800
   ...
   > For a really good test that will provide better separation
   > of the languages, try curried addition of first one parameter,
   > then the other, plus 1:
   > 
   > (((lambda (x) (lambda (y) (+ x y 1))) 3) 5)     Scheme, 24 tokens
   > 
   > --Guy
   
   SmallScript (superset of Smalltalk):
   
       [:x|[:y|x+y+1]](3)(5)		"13 tokens"
   
   -- Dave S. [SmallScript LLC]

How is that 13 tokens?  I'm a little unclear on how you would
count ":x|" and ":y|", but surely

[  [  x  +  y  +  1  ]  ]  (  3  )  (  5  )

is already 15 tokens, so the whole thing must be somewhere
between 17 and 21 tokens?  If 21, then it saves two "lambda"s
and a pair of parens over Lisp, then loses one back by needing
a second "+".

--Guy