<html><head><base href="x-msg://589/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span class="Apple-style-span" style="font-size: medium; ">On 3 Feb 2010, at 00:28, Jay K wrote:</span></div></span></span></span></span></span></span></span></span></div></span></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">This is not where Modula-3 falls down due to verbosity.<br> <br> <br>Many C and C++ programmers discourage such terseness:<br>int a, b, c(), d();<br>typedef int T1, T2;<br> <br> <br>preferring:<br>int a;<br>int b;<br>int c();<br>int d();<br>typedef int T1;<br>typedef int T2;<br> <br> <br>Where is falls down, perhaps, is not using curly braces.<br>  (And perhaps for gyrations needed for safety, see my recent NTObjFile.m3 changes.<br>  Can they be safe and not duplicate code, or only one?)<br> <br> <br>My editor is geared toward curly braces and helps using them tremendously.<br>I can't switch editors. I've tried many times.</div></span></blockquote><div><br></div><div>... emacs...  :-)</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> I find the terseness Modula-3 does allow:<br>PROCEDURE(VAR a, b:INTEGER);<br></div></span></blockquote><div><br></div><div>Both are VAR.  VAR distributes over the list.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">TYPE A = RECORD c, d: INTEGER:= 0; END.<br></div></span></blockquote><div><br></div><div>They both get 0.</div><div><br></div><div>:= distributes over the list.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> ambiguous.<br> <br>I don't know if a and b are both VAR.<br>I don't know if c and d both have the initializer.<br>I'd prefer to see:<br>PROCEDURE(VAR a: INTEGER; VAR b:INTEGER);<br>TYPE A = RECORD c: INTEGER := 0; d: INTEGER:= 0; END.<br> <br> <br>(and I'm not sure that is equivalent, but I do know what it means.)<br>(newlines omited in RECORD just for *email brevity*: RECORD should have a newline per field!)<br> <br>I would be in favor of removing all these shorthands from the cm3 tree,<br>and maybe even warning about them. But they surely are all well defined<br>if you know the language well. It is meant to be a small language,<br>but goes a bit too far here I think.<br></div></span></blockquote><div><br></div><div>I've never really found this to be the case.  Perhaps because I learnt to program in Pascal.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; "> <br> <br> - Jay<br><br> <br>> Date: Tue, 2 Feb 2010 21:37:33 -0600<br>> From:<span class="Apple-converted-space"> </span><a href="mailto:rodney_bates@lcwb.coop">rodney_bates@lcwb.coop</a><br>> To:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>> Subject: Re: [M3devel] Shorthand type declarations?<br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> Chris wrote:<br>> > Alright, I'm finally getting the hang of things.<br>> ><span class="Apple-converted-space"> </span><br>> > One quick question..<br>> ><span class="Apple-converted-space"> </span><br>> > Is there a shorthand for declaring a whole bunch of types as one type? i.e....<br>> ><span class="Apple-converted-space"> </span><br>> > TYPE<span class="Apple-converted-space"> </span><br>> > Window, Pixmap, Cursor = unsigned_int;<br>> ><span class="Apple-converted-space"> </span><br>> > Or something similiar?<br>> ><span class="Apple-converted-space"> </span><br>> > Doing this<br>> > TYPE<br>> > Window = unsigned_int;<br>> > Pixmap = unsigned_int;<br>> > Cursor = unsigned_int;<br>> > etc...<br>> > Adds up to whole lot of typing.(No pun intended)<br>><span class="Apple-converted-space"> </span><br>> Unfortunately, this is the shortest you can get. I suppose the language designers<br>> thought that, while a whole lot of variables with the same type were a likely<br>> case:<br>><span class="Apple-converted-space"> </span><br>> VAR x, y, z, u, v, w, h, i, j, h, ... : INTEGER; ,<br>><span class="Apple-converted-space"> </span><br>> that more than just a few type names that are synonyms for the same type would not be common.<br>><span class="Apple-converted-space"> </span><br>> You may think me certifiably masochist, but I go the more longhanded way and write:<br>><span class="Apple-converted-space"> </span><br>> TYPE Window = unsigned_int;<br>> TYPE Pixmap = unsigned_int;<br>> TYPE Cursor = unsigned_int; ,<br>><span class="Apple-converted-space"> </span><br>> sacrificing writeability in favor of readability. (Yes, I repeat VAR and CONST too,<br>> almost every time.<br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> ><span class="Apple-converted-space"> </span><br>> > Any tips would be most welcome.<br>> ><span class="Apple-converted-space"> </span><br></div></span></blockquote></div><br></body></html>