On 2004-12-18, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> "Dima Dorfman" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Both languages compile all three functions (f and the two versions of
>> g) once and choose which g to return at run-time.
>
> *If* OCaml or any other 'other' language compiles the two versions of g to 
> the final and complete functions that get returned (but I don't know if 
> that is so for OCaml or and other appropriate 'other'), then it does 
> something different from and less flexible than Python.

Sorry, I glossed over the details to convey the general idea. In
OCaml, as in Python, the code is compiled once but the closure is made
at run-time.

  # f 3 == f 3;;
  - : bool = false

where "==" is the physical equality operator like Python's "is".
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to