On Mon, Dec 7, 2009 at 2:19 PM, Jon Harrop <[email protected]> wrote:
> The JVM is incapable of expressing structs so no JVM-based language can > support them. CLR-based languages supporting structs (e.g. C# and F#) simply > delegate the work to the CLR. The obvious approach, though I haven't worked out all details, is to expand structs into groups of variables, including any nested structs, of course. This would nicely handle all uses of structs in local variables, assignments, and procedure calls, though it wouldn't allow methods on structs (do we really need those, given that struct instance variables are public?) If you want to allow non-default constructors, you have to be able to inline them, though, so they can't be too complicated. The struct still needs to be represented by a classfile at compile time so that the compiler knows what to do, but the class never needs to be loaded. -- GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures -- You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.
