<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">No. I'm ok with that.</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">My point is, that basically, there are two really good forms of</font></div><div><font face="Calibri, sans-serif">interface that have the right level of revelation and hiding.</font></div><div><font face="Calibri, sans-serif">I don't see much point for in-between.</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">The two forms..they are kind of canonical C and C++ forms, but</font></div><div><font face="Calibri, sans-serif">they both map to Modula-3.</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">One form is a fully opaque type and a bunch of functions</font></div><div><font face="Calibri, sans-serif">that take that type as the first parameter.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">Like this:</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> struct Window_t; </font></div><div><font face="Calibri, sans-serif"> typedef struct Window_t* Window_t; </font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> Window_t* Window_Create(...); /* create is special -- first parameter</font></div><div><font face="Calibri, sans-serif"> isn't Window_t* */ </font></div><div><font face="Calibri, sans-serif"> void Window_Close(Window_t*...); </font></div><div><font face="Calibri, sans-serif"> void Window_SetTitle(Window_t*...); </font></div><div><font face="Calibri, sans-serif"> TEXT Window_GetTitle(Window_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">It maps directly to Modula-3.</font></div><div><font face="Calibri, sans-serif">Though I'm not sure exactly how.</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">Window.i3:</font></div><div><font face="Calibri, sans-serif">INTERFACE Window;</font></div><div><font face="Calibri, sans-serif">TYPE T <: ROOT;</font></div><div><font face="Calibri, sans-serif">PROCEDURE Close(T);</font></div><div><font face="Calibri, sans-serif">PROCEDURE SetTitle(T, TEXT);</font></div><div><font face="Calibri, sans-serif">PROCEDURE GetTitle(T): TEXT;</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">The other form is a bunch of pure virtual functions, no</font></div><div><font face="Calibri, sans-serif">data, no non-virtual functions. This is what COM prescribes.</font></div><div><font face="Calibri, sans-serif">And "Create" is special.</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">struct Window_t</font></div><div><font face="Calibri, sans-serif">{</font></div><div><font face="Calibri, sans-serif"> virtual void Close() = 0;</font></div><div><font face="Calibri, sans-serif"> virtual void SetTitle(TEXT) = 0;</font></div><div><font face="Calibri, sans-serif"> virtual TEXT GetTitle() = 0;</font></div><div><font face="Calibri, sans-serif">};</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">Window_t* Window_Create(...);</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">This maps well to Modula-3 as well:</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">Window.i3:</font></div><div><font face="Calibri, sans-serif">T <: OBJECT</font></div><div><font face="Calibri, sans-serif"> METHODS</font></div><div><font face="Calibri, sans-serif"> PROCEDURE Close();</font></div><div><font face="Calibri, sans-serif"> PROCEDURE SetTitle(TEXT);</font></div><div><font face="Calibri, sans-serif"> PROCEDURE GetTitle(): TEXT;</font></div><div><font face="Calibri, sans-serif">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">The in-between, which I'm not sure is all that worthwhile,</font></div><div><font face="Calibri, sans-serif">is where C++ offers "protected", and "worse", "private".</font></div><div><font face="Calibri, sans-serif">Really "private" doesn't belong in a header.</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">In the case of M3CG, I don't think we have any need for in-between.</font></div><div><font face="Calibri, sans-serif">I think currently clients either know it is <: ROOT or <: Ops.Public.</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 don't see the point in hiding <: Ops.Public.</font></div><div><font face="Calibri, sans-serif">You might as well let every client know that.</font></div><div><font face="Calibri, sans-serif">They just pass them around by value/reference, and not call</font></div><div><font face="Calibri, sans-serif">any methods/member-functions, but I don't see that hiding</font></div><div><font face="Calibri, sans-serif">them helps anything.</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">Typical "operating system" interfaces look like what I showed first,</font></div><div><font face="Calibri, sans-serif">except that Window_t* is replaced by "int" or "void*". Which I think is</font></div><div><font face="Calibri, sans-serif">mostly inferior. void* at least allows for basically the same implementation</font></div><div><font face="Calibri, sans-serif">strategies, including casting it to int and indexing into a table, but</font></div><div><font face="Calibri, sans-serif">having different pointer types allows for a little bit of type-safety</font></div><div><font face="Calibri, sans-serif">in the clients (i.e. avoiding passing a Windows_t* to File_Read).</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><br></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif"> - Jay</font></div><br><br><br><br><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: hosking@cs.purdue.edu<br>Date: Wed, 26 Sep 2012 15:53:26 -0400<br>To: jay.krell@cornell.edu<br>CC: m3devel@elegosoft.com<br>Subject: Re: [M3devel] M3CG_Ops.Public vs. M3CG.T<br><br>Are you saying that you don’t like importing M3CG as well as M3CG_Ops?<br><br>
<br><div><div>On Sep 26, 2012, at 3:30 PM, Jay <<a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div><div>Ok but this seems not great..<br><br> - Jay (briefly/pocket-sized-computer-aka-phone)</div><div><br>On Sep 26, 2012, at 8:58 AM, Antony Hosking <<a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a>> wrote:<br><br></div><div></div><blockquote>Yes, M3CG.T is the most abstract type.<div>Please don’t make this change.<br>
<br><div><div>On Sep 26, 2012, at 11:36 AM, Jay K <<a href="mailto:jay.krell@cornell.edu"></a><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px"><div dir="ltr"><font face="Calibri, sans-serif" size="3">It is not pervasive.</font><div style="font-family:Calibri, sans-serif;font-size:12pt">It is like one line in about six files. M3CG.T => M3CG_Ops.Publics.</div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt">I guess you are saying that M3CG.T is merely the extremely abstract ROOT, where M3CG_Ops.Public has a bunch of methods? Then I might argue that M3CG.T is overly abstract -- it is like void* instead of pointer just with a bunch of methods.</div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt">This isn't quite right, doesn't compilte, but rougly:</div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div><div><font face="Calibri, sans-serif">Index: M3CG_BinRd.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinRd.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.2</font></div><div><font face="Calibri, sans-serif">diff -u -r1.2 M3CG_BinRd.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_BinRd.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>12 Feb 2001 15:25:47 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.2</font></div><div><font face="Calibri, sans-serif">+++ M3CG_BinRd.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:32 -0000</font></div><div><font face="Calibri, sans-serif">@@ -3,9 +3,9 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> INTERFACE M3CG_BinRd;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-IMPORT M3CG, Rd;</font></div><div><font face="Calibri, sans-serif">+IMPORT M3CG_Ops, Rd;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE Inhale (rd: Rd.T; cg: M3CG.T);</font></div><div><font face="Calibri, sans-serif">+PROCEDURE Inhale (rd: Rd.T; cg: M3CG_Ops.Public);</font></div><div><font face="Calibri, sans-serif"> (* Parse the binary intermediate code M3CG calls from 'rd'</font></div><div><font face="Calibri, sans-serif"> and call 'cg' to implement them. *)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">Index: M3CG_BinRd.m3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinRd.m3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.19</font></div><div><font face="Calibri, sans-serif">diff -u -r1.19 M3CG_BinRd.m3</font></div><div><font face="Calibri, sans-serif">--- M3CG_BinRd.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>4 Sep 2012 14:29:54 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.19</font></div><div><font face="Calibri, sans-serif">+++ M3CG_BinRd.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:32 -0000</font></div><div><font face="Calibri, sans-serif">@@ -20,7 +20,7 @@</font></div><div><font face="Calibri, sans-serif"> TYPE</font></div><div><font face="Calibri, sans-serif"> State = RECORD</font></div><div><font face="Calibri, sans-serif"> rd : Rd.T;</font></div><div><font face="Calibri, sans-serif">- cg : M3CG.T;</font></div><div><font face="Calibri, sans-serif">+ cg : M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> buf : InputBuffer;</font></div><div><font face="Calibri, sans-serif"> buf_len: CARDINAL;</font></div><div><font face="Calibri, sans-serif"> buf_ptr: CARDINAL;</font></div><div><font face="Calibri, sans-serif">@@ -200,7 +200,7 @@</font></div><div><font face="Calibri, sans-serif"> Cmd {Bop.fetch_and_xor, fetch_and_xor}</font></div><div><font face="Calibri, sans-serif"> };</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE Inhale (rd: Rd.T; cg: M3CG.T) =</font></div><div><font face="Calibri, sans-serif">+PROCEDURE Inhale (rd: Rd.T; cg: M3CG_Ops.Public) =</font></div><div><font face="Calibri, sans-serif"> VAR s: State; op: M3CG.Name; cmd: INTEGER;</font></div><div><font face="Calibri, sans-serif"> BEGIN</font></div><div><font face="Calibri, sans-serif"> s.rd := rd;</font></div><div><font face="Calibri, sans-serif">Index: M3CG_BinWr.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinWr.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.2</font></div><div><font face="Calibri, sans-serif">diff -u -r1.2 M3CG_BinWr.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_BinWr.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>12 Feb 2001 15:25:47 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.2</font></div><div><font face="Calibri, sans-serif">+++ M3CG_BinWr.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:32 -0000</font></div><div><font face="Calibri, sans-serif">@@ -3,9 +3,9 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> INTERFACE M3CG_BinWr;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-IMPORT M3CG, Wr;</font></div><div><font face="Calibri, sans-serif">+IMPORT M3CG_Ops, Wr;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE New (wr: Wr.T): M3CG.T;</font></div><div><font face="Calibri, sans-serif">+PROCEDURE New (wr: Wr.T): M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> (* returns a fresh, initialized code generator that writes its</font></div><div><font face="Calibri, sans-serif"> calls as binary intermediate code on 'wr'. See M3CG_Binary</font></div><div><font face="Calibri, sans-serif"> for the binary format. *)</font></div><div><font face="Calibri, sans-serif">Index: M3CG_BinWr.m3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinWr.m3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.23</font></div><div><font face="Calibri, sans-serif">diff -u -r1.23 M3CG_BinWr.m3</font></div><div><font face="Calibri, sans-serif">--- M3CG_BinWr.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>4 Sep 2012 15:20:09 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.23</font></div><div><font face="Calibri, sans-serif">+++ M3CG_BinWr.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:32 -0000</font></div><div><font face="Calibri, sans-serif">@@ -27,7 +27,7 @@</font></div><div><font face="Calibri, sans-serif"> END;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> TYPE</font></div><div><font face="Calibri, sans-serif">- U = M3CG.T OBJECT</font></div><div><font face="Calibri, sans-serif">+ U = M3CG_Ops.Public OBJECT</font></div><div><font face="Calibri, sans-serif"> wr : Wr.T := NIL;</font></div><div><font face="Calibri, sans-serif"> buf : M3Buf.T := NIL;</font></div><div><font face="Calibri, sans-serif"> buf_len : INTEGER := 0;</font></div><div><font face="Calibri, sans-serif">@@ -375,7 +375,7 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> (*---------------------------------------------------------------------------*)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE New (output: Wr.T): M3CG.T =</font></div><div><font face="Calibri, sans-serif">+PROCEDURE New (output: Wr.T): M3CG_Ops.Public =</font></div><div><font face="Calibri, sans-serif"> VAR mbuf := M3Buf.New ();</font></div><div><font face="Calibri, sans-serif"> BEGIN</font></div><div><font face="Calibri, sans-serif"> M3Buf.AttachDrain (mbuf, output);</font></div><div><font face="Calibri, sans-serif">Index: M3CG_Check.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Check.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.1.1.1</font></div><div><font face="Calibri, sans-serif">diff -u -r1.1.1.1 M3CG_Check.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Check.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>14 Jan 2001 13:40:37 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.1.1.1</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Check.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:32 -0000</font></div><div><font face="Calibri, sans-serif">@@ -7,11 +7,11 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> INTERFACE M3CG_Check;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-IMPORT M3CG;</font></div><div><font face="Calibri, sans-serif">+IMPORT M3CG_Ops;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE New (child: M3CG.T;</font></div><div><font face="Calibri, sans-serif">+PROCEDURE New (child: M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> clean_jumps, clean_stores: BOOLEAN;</font></div><div><font face="Calibri, sans-serif">- nested_calls, nested_procs: BOOLEAN): M3CG.T;</font></div><div><font face="Calibri, sans-serif">+ nested_calls, nested_procs: BOOLEAN): M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> (* returns a fresh, initialized code generator that passes its calls</font></div><div><font face="Calibri, sans-serif"> to 'child' and checks that the stream obeys the M3CG restrictions.</font></div><div><font face="Calibri, sans-serif"> If 'clean_jumps', it also checks that the stack is empty at every</font></div><div><font face="Calibri, sans-serif">Index: M3CG_Check.m3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Check.m3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.17</font></div><div><font face="Calibri, sans-serif">diff -u -r1.17 M3CG_Check.m3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Check.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>4 Sep 2012 14:47:43 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.17</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Check.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -32,7 +32,7 @@</font></div><div><font face="Calibri, sans-serif"> };</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> TYPE</font></div><div><font face="Calibri, sans-serif">- U = M3CG.T OBJECT</font></div><div><font face="Calibri, sans-serif">+ U = M3CG_Ops.Public OBJECT</font></div><div><font face="Calibri, sans-serif"> clean_stores := FALSE;</font></div><div><font face="Calibri, sans-serif"> clean_jumps := FALSE;</font></div><div><font face="Calibri, sans-serif"> nested_calls := TRUE;</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Ops.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.12</font></div><div><font face="Calibri, sans-serif">diff -u -r1.12 M3CG_Ops.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Ops.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>16 Aug 2012 13:12:35 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.12</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Ops.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -30,7 +30,7 @@</font></div><div><font face="Calibri, sans-serif"> Public = OBJECT</font></div><div><font face="Calibri, sans-serif"> (*------------------------------------------------ READONLY configuration ---*)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-child: M3CG.T := NIL;</font></div><div><font face="Calibri, sans-serif">+child: Public := NIL;</font></div><div><font face="Calibri, sans-serif"> (* The default methods simply call the corresponding method in 'child',</font></div><div><font face="Calibri, sans-serif"> hence a vanilla 'M3CG.T' can be used as a filter where you override</font></div><div><font face="Calibri, sans-serif"> only the methods of interest. *)</font></div><div><font face="Calibri, sans-serif">Index: M3CG_Rd.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Rd.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.1.1.1</font></div><div><font face="Calibri, sans-serif">diff -u -r1.1.1.1 M3CG_Rd.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Rd.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>14 Jan 2001 13:40:37 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.1.1.1</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Rd.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -7,9 +7,9 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> INTERFACE M3CG_Rd;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-IMPORT M3CG, Rd;</font></div><div><font face="Calibri, sans-serif">+IMPORT M3CG_Ops, Rd;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE Inhale (rd: Rd.T; cg: M3CG.T);</font></div><div><font face="Calibri, sans-serif">+PROCEDURE Inhale (rd: Rd.T; cg: M3CG_Ops.Public);</font></div><div><font face="Calibri, sans-serif"> (* Parse the M3CG calls from 'rd' and call 'cg' to implement them. *)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> END M3CG_Rd.</font></div><div><font face="Calibri, sans-serif">Index: M3CG_Rd.m3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Rd.m3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.15</font></div><div><font face="Calibri, sans-serif">diff -u -r1.15 M3CG_Rd.m3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Rd.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>4 Sep 2012 14:52:46 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.15</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Rd.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -22,7 +22,7 @@</font></div><div><font face="Calibri, sans-serif"> TYPE</font></div><div><font face="Calibri, sans-serif"> State = RECORD</font></div><div><font face="Calibri, sans-serif"> rd : Rd.T;</font></div><div><font face="Calibri, sans-serif">- cg : M3CG.T;</font></div><div><font face="Calibri, sans-serif">+ cg : M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> ch : CHAR; (* current scan character *)</font></div><div><font face="Calibri, sans-serif"> buf : InputBuffer;</font></div><div><font face="Calibri, sans-serif"> buf_len: CARDINAL;</font></div><div><font face="Calibri, sans-serif">@@ -206,7 +206,7 @@</font></div><div><font face="Calibri, sans-serif"> cmds: IntIntTbl.T := NIL;</font></div><div><font face="Calibri, sans-serif"> types: IntIntTbl.T := NIL;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE Inhale (rd: Rd.T; cg: M3CG.T) =</font></div><div><font face="Calibri, sans-serif">+PROCEDURE Inhale (rd: Rd.T; cg: M3CG_Ops.Public) =</font></div><div><font face="Calibri, sans-serif"> VAR s: State; op: M3CG.Name; cmd: INTEGER;</font></div><div><font face="Calibri, sans-serif"> BEGIN</font></div><div><font face="Calibri, sans-serif"> s.rd := rd;</font></div><div><font face="Calibri, sans-serif">Index: M3CG_Wr.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Wr.i3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.1.1.1</font></div><div><font face="Calibri, sans-serif">diff -u -r1.1.1.1 M3CG_Wr.i3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Wr.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>14 Jan 2001 13:40:37 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.1.1.1</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Wr.i3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -7,9 +7,9 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> INTERFACE M3CG_Wr;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-IMPORT M3CG, Wr;</font></div><div><font face="Calibri, sans-serif">+IMPORT M3CG_Ops, Wr;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE New (wr: Wr.T): M3CG.T;</font></div><div><font face="Calibri, sans-serif">+PROCEDURE New (wr: Wr.T): M3CG_Ops.Public;</font></div><div><font face="Calibri, sans-serif"> (* returns a fresh, initialized code generator that writes its</font></div><div><font face="Calibri, sans-serif"> calls as readable ASCII on 'wr'. *)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">Index: M3CG_Wr.m3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div><div><font face="Calibri, sans-serif">RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Wr.m3,v</font></div><div><font face="Calibri, sans-serif">retrieving revision 1.18</font></div><div><font face="Calibri, sans-serif">diff -u -r1.18 M3CG_Wr.m3</font></div><div><font face="Calibri, sans-serif">--- M3CG_Wr.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>22 Aug 2012 14:15:40 -0000<span class="ecxApple-tab-span" style="white-space:pre"> </span>1.18</font></div><div><font face="Calibri, sans-serif">+++ M3CG_Wr.m3<span class="ecxApple-tab-span" style="white-space:pre"> </span>26 Sep 2012 15:34:33 -0000</font></div><div><font face="Calibri, sans-serif">@@ -27,7 +27,7 @@</font></div><div><font face="Calibri, sans-serif"> END;</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> TYPE</font></div><div><font face="Calibri, sans-serif">- U = M3CG.T OBJECT</font></div><div><font face="Calibri, sans-serif">+ U = M3CG_Ops.Public OBJECT</font></div><div><font face="Calibri, sans-serif"> wr : Wr.T := NIL;</font></div><div><font face="Calibri, sans-serif"> buf : M3Buf.T := NIL;</font></div><div><font face="Calibri, sans-serif"> buf_len : INTEGER := 0;</font></div><div><font face="Calibri, sans-serif">@@ -375,7 +375,7 @@</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif"> (*---------------------------------------------------------------------------*)</font></div><div><font face="Calibri, sans-serif"> </font></div><div><font face="Calibri, sans-serif">-PROCEDURE New (output: Wr.T): M3CG.T =</font></div><div><font face="Calibri, sans-serif">+PROCEDURE New (output: Wr.T): M3CG_Ops.Public =</font></div><div><font face="Calibri, sans-serif"> VAR mbuf := M3Buf.New ();</font></div><div><font face="Calibri, sans-serif"> BEGIN</font></div><div><font face="Calibri, sans-serif"> M3Buf.AttachDrain (mbuf, output);</font></div><div><font face="Calibri, sans-serif">Index: Target.i3</font></div><div><font face="Calibri, sans-serif">===================================================================</font></div></div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt"><br></div><div style="font-family:Calibri, sans-serif;font-size:12pt"> - Jay<br><br><div><div id="ecxSkyDrivePlaceholder"></div><hr id="ecxstopSpelling">From: <a href="mailto:hosking@cs.purdue.edu"></a><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>Date: Wed, 26 Sep 2012 10:42:26 -0400<br>To: <a href="mailto:jay.krell@cornell.edu"></a><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>CC: <a href="mailto:m3devel@elegosoft.com"></a><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Subject: Re: [M3devel] M3CG_Ops.Public vs. M3CG.T<br><br>I disagree. M3CG.T is more abstract than M3CG_Ops. The revelation of M3CG.T <: M3CG_Ops.Public is in M3CG_Ops. If you want the ops you simply import that interface to get the revelation. Please don’t make pervasive changes in interfaces that some of us are developing against.<br><br><div><div>On Sep 26, 2012, at 4:11 AM, Jay K <<a href="mailto:jay.krell@cornell.edu"></a><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a>> wrote:</div><br class="ecxApple-interchange-newline"><blockquote><div class="ecxhmmessage" style="font-size:12pt;font-family:Calibri;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px"><div dir="ltr"><div><font face="Calibri, sans-serif">M3CG_Ops.i3:</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">child: M3CG.T := NIL;</font></div><div><font face="Calibri, sans-serif">(* The default methods simply call the corresponding method in 'child',</font></div><div><font face="Calibri, sans-serif"> hence a vanilla 'M3CG.T' can be used as a filter where you override</font></div><div><font face="Calibri, sans-serif"> only the methods of interest. *)</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">1)</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">I am not keen on fixing this, but I feel this was clearly a mistake.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div><font face="Calibri, sans-serif">M3CG_Ops.Public should have been "purely abstract" with no default</font></div><div><font face="Calibri, sans-serif">implementation.</font></div><div><font face="Calibri, sans-serif">M3CG_Filter.T or somesuch could have been as described.</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">2) I am fixing:</font></div><div><font face="Calibri, sans-serif">M3CG.T is overused.</font></div><div><font face="Calibri, sans-serif">Most uses should be M3CG_Ops.Public.</font></div><div><font face="Calibri, sans-serif">It is ok to derive from -- though that was a mistake.</font></div><div><font face="Calibri, sans-serif">But functions that take or return M3CG.T should really be</font></div><div><font face="Calibri, sans-serif">taking and returning M3CG_Ops.Public.</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"> - Jay</font></div></div></div></blockquote></div></div></div></div></div></blockquote></div><br></div></blockquote></div></blockquote></div><br></div> </div></body>
</html>