<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><font face="Calibri, sans-serif">Given GENERIC INTERFACE Vector(T);</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">I'd like to say:</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">TYPE Foo = REF RECORD ... END;</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">VAR foo := NEW(Sequence(Foo));</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">without messing around with any Quake code.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">Is this really so much to ask?</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">Today instead I have to either mess around with Quake,</font></div><div><font face="Calibri, sans-serif">or store REFANY and constantly NARROW them.</font></div><div><font face="Calibri, sans-serif">Like storing a void* in a container, but safer and slower.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">C++, Java, and C# all provide about the same thing here.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">From a language point of view, I think this is easy.</font></div><div><font face="Calibri, sans-serif">The only complication is what name to give the thing internally.</font></div><div><font face="Calibri, sans-serif">There are a few obvious choice:</font></div><div><font face="Calibri, sans-serif"> Prepend/append the current module/interface.</font></div><div><font face="Calibri, sans-serif"> This is easiest. But might lead to some bloat.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> Prepend/append a hash. Or maybe nothing.</font></div><div><font face="Calibri, sans-serif"> This provides for single instancing,</font></div><div><font face="Calibri, sans-serif"> It either requires builder or linker cooperation.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> Mark the code as "file level static" using whatever mechanism C does.</font></div><div><font face="Calibri, sans-serif"> This is presumably easy and might lead to some bloat.</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> Given a 64bit Sequence(INTEGER), Sequence(LONGINT),</font></div><div><font face="Calibri, sans-serif"> the Microsoft linker will automatically combine any resulting</font></div><div><font face="Calibri, sans-serif"> code -- when optimization, it combines duplicate </font></div><div><font face="Calibri, sans-serif"> code that is "the same" but has different names.</font></div><div><font face="Calibri, sans-serif"> Note that it is easy to inhibit, e.g.:</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> int F1() { static int i; return ++i; }</font></div><div><font face="Calibri, sans-serif"> int F2() { static int i; return ++i; }</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> are NOT the same, because they must reference different "i".</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> Thoughts?</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> - Jay</font></div><br> </div></body>
</html>