<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Agreed!<BR>
C++ vs. WITH, C++ wins by not indenting unnecessarily.<BR>
See that change I was fiddling with in Time.m3 for examle.<BR>
 <BR>
Hm. Can we get consensus on a language change? :)<BR>
 <BR>
BEGIN<BR>  VAR a := 1;<BR>
  IO.PutInt(a);<BR>
  VAR b := 2, (* ? *) <BR>
         c := 3; (* ? *) <BR>
  IO.PutInt(b);<BR>
 <BR>
? Easier to require "VAR" on each, a bit wordy.<BR>
 <BR>
 - Jay<BR><BR>

<HR id=stopSpelling>
<BR>
> Date: Tue, 12 Feb 2008 08:52:05 -0500<BR>> From: hendrik@topoi.pooq.com<BR>> To: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] introducing VAR in more places?<BR>> <BR>> On Tue, Feb 12, 2008 at 05:41:31AM -0800, Mika Nystrom wrote:<BR>> > hendrik@topoi.pooq.com writes:<BR>> > >On Mon, Feb 11, 2008 at 10:17:13PM -0600, Rodney M. Bates wrote:<BR>> > >> I don't think this is what Tony meant. In C++, an opening brace<BR>> > >> starts a block, but every local declaration in that block has its own<BR>> > >> unique scope that only starts at that declaration and goes to the end<BR>> > >> of the block. This is particularly messy because the local declarations<BR>> > >> of a block need not all precede all the statements,<BR>> > ><BR>> > >That is, in my opinion, one of the few things that C and C++ did right, <BR>> > >well, almost right. It permits a coding style in which every <BR>> > >variable declaration is initialised, and is declared if and only if it <BR>> > <BR>> > You can do all kinds of fun stuff with C's declarations/initializations.<BR>> > <BR>> > switch (a) {<BR>> > int x=7;<BR>> > case 0:<BR>> > use(x); /* oops */<BR>> > ...<BR>> > }<BR>> > <BR>> > goto somewherefun;<BR>> > <BR>> > {<BR>> > int y=7;<BR>> > <BR>> > somewherefun:<BR>> > use(y); /* oops again */<BR>> > }<BR>> <BR>> That's more a problem with C's control structures. Each case should be <BR>> a block of its own. The bits outside any case shouldn't be there. <BR>> etc., etc.<BR>> <BR>> > <BR>> > <BR>> > >has a value. Now that's a useful property. It fails for recursion, <BR>> > >so there are limits in how far it can apply. And when coding like this, <BR>> > >you want the simplest syntax to define a constant identifier -- one <BR>> > >whose value cannot be rebound except by reexecuting the entire block. <BR>> > >Making something that can change should require more effort -- like <BR>> > >adding a keyword "var" or some such.<BR>> > <BR>> > Sounds to me like you're talking about Modula-3's WITH!<BR>> <BR>> Close, except for syntax. If you use WITH in the stype I'm <BR>> advocating you end up with extremely deep syntactic nesting, and you <BR>> indent off the side of the page. Also, the whole WITH syntax is quite <BR>> heavy.<BR>> <BR>> -- hendrik<BR><BR><br /><hr />Shed those extra pounds with MSN and The Biggest Loser! <a href='http://biggestloser.msn.com/' target='_new'>Learn more.</a></body>
</html>