On Monday 07 December 2009 18:31:55 John Cowan wrote:
> 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,

Yes. Structs are aggregate registers in the LLVM too.

> 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.

Users will want custom comparison, equality, hashing and serialization for 
their structs.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

--

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.


Reply via email to