On 06.12.2010, at 22:35, Ken Wesson wrote: >> I'd say what Java needs is not complex numbers as a value type, but a way to >> define additional value types. Complex numbers are just one applications. >> Another one is points (2D or 3D) for geometry and graphics. >> >> Unfortunately the problem is not just Java, but the JVM, meaning that >> Clojure inherits the problem. > > Clojure does not inherit the problem, if you use macros cleverly. You > can stack allocate individual primitives, separately, e.g. > > (let [x (int 3) y (double 4.2)] > ...) > > And with macros you can wrap that in an abstraction that looks like a > single object, such as a point or a complex number. Passing it to a > function would require a bit of magic, though -- say, bundling the
That's exactly the problem. An abstraction that doesn't pass a function boundary is of little use in a functional language. Decomposing complex numbers or points into primitives can be used as a local optimization technique, but not in a larger-scale design for software systems. Konrad. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
