On 18/06/2010, at 2:26 PM, David Nolen wrote: > On Fri, Jun 18, 2010 at 12:24 AM, Antony Blakey <antony.bla...@gmail.com> > wrote: > > That's fine for fact, but as a consumer of library functions, how do I know > when I should pass in bigints? How do I know when an intermediate value, for > my particular combination of parameter values, is going to overflow? > > If the library isn't communicating that to you isn't that just a broken API > that you don't want to participate in? Tag information on arglists is > available:
No. How do I know whether I need to pass a bigint literal or not? For what possible input values will overflow be an issue? It's easy to see with fact, but that's because the function implementation is clearly visible, and has well known growth properties of a single argument. And it's not just literals - when functions are composed from other functions that have this same problem and return primitive types - hence using the static versions of functions - the question in general becomes impossible to answer, not only because there might be a number of parameters with interdependencies, but because the structure of intermediate results may not be visible to the consumer. And what if you don't have the source to the function? This proposal not only puts the burden of promotion and representation choice onto the user of a function, but it requires that promotion be done before the function is executed, in a precautionary way, rather than iff needed. This proposal is IMO a very bad idea. Antony Blakey -------------------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Lack of will power has caused more failure than lack of intelligence or ability. -- Flower A. Newhouse -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en