<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
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: hosking@cs.purdue.edu<BR>To: jay.krell@cornell.edu<BR>Date: Mon, 12 Jan 2009 11:13:00 +1100<BR>CC: m3devel@elegosoft.com<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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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: 12px 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></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></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"> +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: 12px 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></body>
</html>