On Tue, 12 Dec 2006 16:35:48 +1300, greg wrote: > When a Lisp compiler sees > > (setq c (+ a b)) > > it can reasonably infer that the + is the built-in numeric > addition operator. But a Python compiler seeing > > c = a + b > > can't tell *anything* about what the + means without > knowing the types of a and b. They might be numbers, or > strings, or lists, or some user-defined class with its > own definition of addition.
That may be true, but lisp's numeric addition operator knows how to add fixnums, bignums, rationals and whatever the lisp name for floating points is (imprecise?) -- something that not many (if any) processor instruction sets can manage. So that's still type-dependent dispatch, which isn't going to get us to the speeds that we actually see reported unless there's extra stuff going on. Type inference? Declarations? Cheers, -- Andrew -- http://mail.python.org/mailman/listinfo/python-list