<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Um, but can't tagged unions be safe?<BR>
Can't you tell the compiler which tag maps to which part of the union and all reads would be checked?<BR>
And writes would set the tag?<BR>
Something like that?<BR>
Plus optimize away some of the tag checks.<BR>
And then like you say, sometimes the tag can be combined with the value, nice description.<BR>
<BR>
After all, tagged unions are the only type in Microsoft VBScript and JScript, safe languages.<BR>
<BR>
Granted, as you say, objects often fit the same scenarios.<BR>
<BR>
- Jay<BR><BR> <BR>> Date: Tue, 2 Jun 2009 07:23:53 -0400<BR>> From: hendrik@topoi.pooq.com<BR>> To: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] Resummary of tagged reference proposals<BR>> <BR>> On Tue, Jun 02, 2009 at 08:51:31PM +1000, Tony Hosking wrote:<BR>> > Union types are anathema to the design of the Modula-3 type system.<BR>> <BR>> So I have heard. But I don't understand why. Certainly <BR>> variant records a la Pascal would be for security reasons. <BR>> Did they get tarred with the same brush? Or were unions <BR>> considered unnecessary once the language had objects and <BR>> inheritance?<BR>> <BR>> -- hendrik<BR></body>
</html>