<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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>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="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; ">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="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 11:13:00 +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>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_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><font class="EC_Apple-style-span" color="#0000ff"><font class="EC_Apple-style-span" face="Gill Sans"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Antony Hosking</span></span></font></font><font class="EC_Apple-style-span" face="Gill Sans"><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="Apple-converted-space"> </span>|<span class="Apple-converted-space"> </span></span></span><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; ">Associate Professor</span></span><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="font-family: 'Gill Sans'; "> | Computer Science | Purdue University</span></span></font></div><div><font class="EC_Apple-style-span" face="GillSans-Light"><span class="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_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Office</span></span></font><font class="EC_Apple-style-span" face="GillSans-Light"><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 |<span class="Apple-converted-space"> </span></span></span></font><font class="EC_Apple-style-span" face="Gill Sans" color="#0000ff"><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; "><span class="EC_Apple-style-span" style="color: rgb(0, 0, 255); font-family: 'Gill Sans'; ">Mobile</span></span></font><font class="EC_Apple-style-span" face="GillSans-Light"><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="EC_Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-converted-space"> </span>+1 765 427 5484</span></span></font></div><div><font class="EC_Apple-style-span" face="GillSans-Light"><br class="EC_khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="EC_Apple-interchange-newline"></span></div></span></div><br><div><div>On 12 Jan 2009, at 01:44, 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; ">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_Apple-converted-space"> </span><br> extern foo_t foo; <span class="EC_Apple-converted-space"> </span><br> <br> void UseFoo(foo_t*);<span class="EC_Apple-converted-space"> </span><br> foo_t* GetFoo(void);<span class="EC_Apple-converted-space"> </span><br> <br>Thanks,<br> - Jay<br><br><br><br></div></span></blockquote></div><br></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br></body></html>