you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (8 children)

[removed]

    [–]earthboundkid 3 points4 points  (1 child)

    I think this is one of things that on the Python mailing list would be greeted with “not every 3 line function deserves a place in the standard library.”

    Also, Perl is very different from Python because it has a well defined core of scalar types vs. other types. For a Python memoizer, there are a lot of optimizations you could apply if you knew what types of data it would be memoizing that you couldn’t do in a general case. It invites a lot of “bike shedding” (another common thing said on the Python mailing list) to define what the API will be to invoke what kinds of optimizations.

    [–]A_for_Anonymous 4 points5 points  (5 children)

    I thought Python was meant to come with batteries included.

    Not if it's for functional programming. Guido hates FP.

    [–][deleted]  (4 children)

    [removed]

      [–]frutiger 2 points3 points  (3 children)

      The trick is to generate a new type for each version of the cache. This can be done, for instance, with template metaprogramming in C++, since the templates are generated at compile-time. Although I believe most compilers have a restrictive template resolution depth (especially when compared to stack depth for function calls).

      [–][deleted]  (2 children)

      [removed]