<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Jay,<div><br></div><div>What the hell is the ROOT variable supposed to do now. I can't build m3core with a compiler that doesn't define ROOT. And why does the m3makefile that includes Uwaitpid.quake expect a hardwired cm3 directory hierarchy. Surely, I should be able to build m3core as a separate package, regardless of the structure in which it appears. You are doing damage to the package structures here too, by hardwiring these paths into the m3makefile.</div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-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; border-spacing: 0px 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; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>-- Tony</div><div><br></div><div>On 12 Jan 2009, at 17:58, Jay wrote:</div></span></span></span></span></span></span></span></span></div></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><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; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">We have conflicting goals.<br> <br>Keeping things as fast as possible and with as little C as possible, vs. keeping things more portable, more easily ported, more obviously correct.<br> <br>I want to drastically reduce the header cloning, or, the work of porting.<br> It is already reduced, but I want to keep going.<br> I think having to make any changes at all in m3-libs/m3core/src/unix can be removed, other than adding the platform to the list of platforms that uses the "portable" stuff.<br>Porting would devolve to:<span class="Apple-converted-space"> </span><br> update the lists of platforms -- including some in m3makefiles<span class="Apple-converted-space"> </span><br> update Target.m3<span class="Apple-converted-space"> </span><br> clone/edit Csetjmp.i3<span class="Apple-converted-space"> </span><br> add the GNU platform to m3cc/src/makefile<span class="Apple-converted-space"> </span><br> <br>and maybe nothing else.<br> <br>It is likely even that the IR is now portable, for "Posix" systems.<br>Pick word size, pick endian, generate 4 versions of IR, pick the right one for your platform.<br>Except for the OSConfigPosix that sometimes returns the platform name and cm3's defining "HOST".<br> <br>A variable isn't great, but it is faster and more source compatible than a function call, at least.<br>And the C variable really will generally be read only. Writes to it should fault.<br> <br> > In this particular case, you are wanting to use a Modula-3 parameter<br> > passing mechanism on something that is not declared in Modula-3.<br> <br>Isn't this just a variation on what is done all the time? -- having Modula-3 call C and sometimes vice versa?<br>C code calls Modula-3 signal handlers, with data created in the C code. The Modula-3 code can then pass them on. I don't see the line really.<br> <br> - Jay<br><br><br><hr id="stopSpelling"><br>From:<span class="Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>Date: Mon, 12 Jan 2009 12:32:15 +1100<br>CC:<span class="Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Subject: Re: [M3devel] declaring a type's existance but not enough to instantiate it?<br><br><br><div><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div style="word-wrap: break-word; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div>Jay, I really think you are bending over backwards too far just to be able to shoe-horn things into C. I *like* having the transpar of C header files expressed in Modula-3, *particularly* for system calls, where you might even be trying to build on a system that does not have the C header files installed, even though the libraries exist and can be linked to. Fundamentally, I think anytime the Modula-3 code is made less transparent you should think hard about what you are doing. The same with the change of constants to variables.</div><div><br></div><div>I am getting very nervous that the changes you are making are destroying the clarity of the Modula-3 run-time code.</div><div><br></div><div>In this particular case, you are wanting to use a Modula-3 parameter passing mechanism on something that is not declared in Modula-3. Seems kind of dubious to me. Also, I really don't like the idea of accessing external variables in C.</div><div><br></div><div>-- Tony</div></span></span></span></span></span></span></span></span></div></span></div><br><div><div>On 12 Jan 2009, at 11:55, Jay wrote:</div><br class="EC_Apple-interchange-newline"><blockquote><span class="EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div class="EC_hmmessage" style="font-size: 10pt; font-family: Verdana; ">I considered ADDRESS.<br>However I think it still doesn't satisfy.<br> <br>I want to be able to do this:<br> <br>TYPE Foo_t = something;<br><* EXTERNAL *> VAR Foo1, Foo2:Foo_t;<br><* EXTERNAL *> PROCEDURE UseFoo(READONLY (* or VAR *) foo:Foo_t);<br> <br>(* Modula-3, not external *)<br>PROCEDURE x()=<br>BEGIN<br> UseFoo(Foo1);<br> UseFoo(Foo2);<br>END x;<br> <br>AND I want any use of:<br>VAR Foo3:Foo3_t; (* Modula-3, not external *)<br><br>to error. This is sem_t and sigset_t in particular.<br> <br>Possibly renaming is the thing.<br>They used to be declared in Modula-3, system-dependently, but<br>I moved them to portable C.<br> <br>I could remove the types entirely and change UseFoo to take an address,<br>and declare mask and ackSem to be integers or I guess.<br><*EXTERNAL> VAR ackSem : RECORD END;<br> <br>That would satisfy but I thought it might be nicer to still provide the named<br>types to refer to the external variables.<br> <br> - Jay<br><br><hr id="EC_stopSpelling"><br>From:<span class="EC_Apple-converted-space"> </span><a href="mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</a><br>To:<span class="EC_Apple-converted-space"> </span><a href="mailto:jay.krell@cornell.edu">jay.krell@cornell.edu</a><br>Date: Mon, 12 Jan 2009 11:13:00 +1100<br>CC:<span class="EC_Apple-converted-space"> </span><a href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a><br>Subject: Re: [M3devel] declaring a type's existance but not enough to instantiate it?<br><br>What's wrong with using ADDRESS for references to opaque values? If sigset_t is never instantiated in Modula-3, then why do you need it declared there?<br><div><br><div><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div style="word-wrap: break-word; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div><font class="EC_EC_Apple-style-span" color="#0000ff"><font class="EC_EC_Apple-style-span" face="Gill Sans"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="EC_EC_Apple-style-span" face="Gill Sans"><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-converted-space"> </span>|<span class="EC_Apple-converted-space"> </span></span></span><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="EC_EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="EC_Apple-converted-space"> </span></span></span></font><font class="EC_EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="EC_EC_Apple-style-span" face="GillSans-Light"><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="EC_EC_Apple-style-span" face="GillSans-Light"><br class="EC_EC_khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="EC_EC_Apple-interchange-newline"></span></div></span></div><br><div><div>On 12 Jan 2009, at 01:44, Jay wrote:</div><br class="EC_EC_Apple-interchange-newline"><blockquote><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font: normal normal normal 12px/normal Helvetica; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; "><div class="EC_EC_hmmessage" style="font-size: 10pt; font-family: Verdana; ">Is there a way in Modula-3 to declare that a type exists, and there are <*external*> instances of it, without "fully" declaring it, so that no Modula-3 can instantiate it?<br> <br>I have done this for sigset_t and sem_t, but they could erroneously be instantiated by Modula-3 and I'd like to remove that ability to mess up so easily.<br> <br>(* This type is not declared correctly. It is only instantiated in C code. *)<br> sigset_t = RECORD END;<br><br>(* This type is not declared correctly. It is only instantiated in C code. *)<br> sem_t = RECORD END;<br><br>In C I believe you can do this, like:<br> typedef struct foo foo_t; <span class="EC_EC_Apple-converted-space"> </span><br> extern foo_t foo; <span class="EC_EC_Apple-converted-space"> </span><br> <br> void UseFoo(foo_t*);<span class="EC_EC_Apple-converted-space"> </span><br> foo_t* GetFoo(void);<span class="EC_EC_Apple-converted-space"> </span><br> <br>Thanks,<br> - Jay<br><br><br><br></div></span></blockquote></div><br></div></div></span><br class="EC_Apple-interchange-newline"></blockquote></div><br></div></span><br class="Apple-interchange-newline"></blockquote></div><br></div></body></html>