<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>I had:</div><div><br></div><div><br></div><div>PROCEDURE CompileProcAllocateJmpbufs (p: Proc) =</div><div>VAR module := Module.Current ();</div><div> alloca := Module.GetAlloca (module);</div><div> size := Module.GetJmpbufSize (module);</div><div> try_count := p.try_count;</div><div>BEGIN</div><div><br></div><div><br></div><div>which is fairly nice and elegant.</div><div>I like the static type inference.</div><div><br></div><div><br></div><div>but p could be NIL so I need like:</div><div><br></div><div><br></div><div>PROCEDURE CompileProcAllocateJmpbufs (p: Proc) =</div><div>VAR module: Module.T;</div><div> alloca: CG.Proc;</div><div> size: CG.Var;</div><div> try_count: INTEGER;</div><div>BEGIN</div><div> IF p = NIL THEN RETURN END;</div><div> module := Module.Current ();</div><div> alloca := Module.GetAlloca (module);</div><div> size := Module.GetJmpbufSize (module);</div><div> try_count := p.try_count;</div><div><br></div><div><br></div><div>double the lines, and a need to state types that I didn't have to state before,</div><div><br></div><div><br></div><div>OR I can use WITH to get the "best" of both, but implied extra indentation.</div><div><br></div><div><br></div><div><br></div><div>Pretty much all other mainstream languages in use today,</div><div>except C89, are "better" than this, they all let you</div><div>both delay local variable declaration until arbitrarily</div><div>into a function, but with implying that you should indent further,</div><div>or close an extra block.</div><div><br></div><div><br></div><div>Most mainstream languages also share Modula-3's type inference</div><div>and let you omit the type, except C.</div><div><br></div><div><br></div><div>Can we update Modula-3 here somehow?</div><div><br></div><div><br></div><div>Or just use "with"?</div><div><br></div><div><br></div><div>Proposals for a syntax that works well with the existing language and compiler?</div><div><br></div><div><br></div><div>Thank you,</div><div> - Jay</div><br><br> </div></body>
</html>