<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I don't at this time want to write C a parser.<BR>
(Actually I do, as part of an entire compiler, but...)<BR>
I'd rather run the one I already have -- the C compiler.<BR>
<BR>
I briefly in the past dreamt that C programmers might start writing "xml" (schema?!) or "idl".<BR>
<BR>
Oh, and you can't rely on headers being written in an easy to parse C subset.<BR>
There are inlines, #pragmas, compiler-specific extensions, etc.<BR>
Best just to use them as part of compiling C with the intended compiler.<BR>
<BR>
Well, I have parsed C subsets actually..more than once.<BR>
One didn't really have to be very complete.<BR>
One "lived" with the headers and there was flexibility to fix the headers to suit.<BR>
<BR>
- Jay<BR><BR>> To: jay.krell@cornell.edu<BR>> Date: Mon, 12 Jan 2009 02:13:25 -0800<BR>> From: mika@async.caltech.edu<BR>> CC: m3devel@elegosoft.com<BR>> Subject: Re: [M3devel] declaring a type's existance but not enough to instantiate it?<BR>> <BR>> <BR>> I think you're misunderstanding me a bit. You don't need C either.<BR>> I would use a Lisp-based language for the "top level" just because<BR>> they are good at handling things like parse trees, if one gets to<BR>> that.<BR>> <BR>> The objectives are:<BR>> <BR>> * A finished system in Pure Modula-3 (no executable C)<BR>> <BR>> * Make it as self-contained as possible<BR>> <BR>> You'd start by simply bundling the existing headers with m3bundle<BR>> and printing them out. Then you'd find duplication (what you've<BR>> been doing) and express that programmatically. Then you might find<BR>> things that might conceivably change in the OS headers and use<BR>> whatever tricks were necessary to figure them out automatically.<BR>> Does this involve C? Maybe on some architecture it does, maybe on<BR>> another it doesn't. On some it might not involve running C but<BR>> merely parsing C headers. Perhaps the program is just hand-written<BR>> and just a way of distilling all the duplication into one place<BR>> where it can be clearly described and documented. Since this is a<BR>> Modula-3 distribution, obviously the program I'm talking about is<BR>> written in Modula-3, not in C or Perl or Python.<BR>> <BR>> Mika<BR>> <BR>> Jay writes:<BR>> >--_2e194b09-14b6-4301-9116-a9e4d1e522b4_<BR>> >Content-Type: text/plain; charset="iso-8859-1"<BR>> >Content-Transfer-Encoding: quoted-printable<BR>> ><BR>> ><BR>> >Yes=2C generating the headers is viable.<BR>> >I thought I mentioned that a few times.<BR>> >They could be generated in any build "that can". i.e. a native build=2C th=<BR>> >at has a working C development system and checked against the checked in o=<BR>> >nes.<BR>> > So then porting is: copy the generator to new system=2C run it=2C copy r=<BR>> >esults back=2C proceed=20<BR>> > Maybe a good compromise. Not good for "embedded systems"=2C but heck=2C i=<BR>> >s there any such thing any longer? Doesn't everything have megs of RAM and=<BR>> > gigs of persistant storage? :)<BR>> >You don't need Scheme.<BR>> >Just Quake + compiling and running C code.<BR>> >Assuming a native build system.<BR>> >I've done stuff in cross build systems like:<BR>> >typedef struct foo_t {int i=3B int j=3B } foo_t=3B<BR>> >extern const int xi =3D offsetof(foo_t=2C i)=3B<BR>> >=20<BR>> >compile that=2C and read the value of xi out of the .obj file.<BR>> >=20<BR>> > The .obj file reader was written in Perl. :)=20<BR>> > (Python not available.)<BR>> > but to do that here=2C I'd have to support multiple .obj file formats.<BR>> >=20<BR>> > - Jay> To: jay.krell@cornell.edu> Date: Mon=2C 12 Jan 2009 01:34:24 -0800>=<BR>> > From: mika@async.caltech.edu> CC: m3devel@elegosoft.com> Subject: Re: [M3d=<BR>> >evel] declaring a type's existance but not enough to instantiate it?> > > Y=<BR>> >ou present it as a true tragic Dilemma.> > But isn't there a Third Way---to=<BR>> > wit=2C can't you "Ask the Computer"> to do the work for you?> > Generate t=<BR>> >he code somehow... Parsing the C headers is an obvious> way but there may b=<BR>> >e others that are simpler=2C such as writing a> Modula-3 program to generat=<BR>> >e the cloned M3 headers=2C sorry=2C interfaces.> > If I had to do this I wo=<BR>> >uld use my Scheme interpreter that's coded> in Modula-3 to write a Scheme p=<BR>> >rogram to generate the headers. This> program could pull whatever tricks ar=<BR>> >e deemed necessary and suitable=2C> down to the point of generating and com=<BR>> >piling and running C programs> as necessary (or parsing C code=2C or readin=<BR>> >g tea leaves). But the> end result would be a set of interfaces written in =<BR>> >"Pure Modula-3".> The process of running the header generator would also ha=<BR>> >ve very> few dependencies on anything outside the M3 distribution.> > Mika>=<BR>> > > Jay writes:> >--_6117a048-9185-4c03-badb-ef8f93402268_> >Content-Type: t=<BR>> >ext/plain=3B charset=3D"iso-8859-1"> >Content-Transfer-Encoding: quoted-pri=<BR>> >ntable> >> >> >This is what you "have to" chose between.> >Header cloning o=<BR>> >r C code (and C headers).> >=3D20> >CONST or VAR (or functions?)> >=3D20> >=<BR>> >I'm going to likely make the Uerror change tonight.> >You can still veto it=<BR>> > (er=3D2C vote against it :) )> >=3D20> >Possibly some convuluted C (enum/#=<BR>> >undef)=3D2C or splitting the Modula-3> >at boundaries that weren't previous=<BR>> >ly believed "natural".> >(See how SetupHandlers is ~two lines in Modula-3 a=<BR>> >nd the rest in C=3D3B> >this is partly out of ignorance. I don't know how t=<BR>> >o write those> >two lines in C=3D3B and laziness=3D2C I didn't look into ho=<BR>> >w).> >=3D20> >=3D20> >=3D20> >Remember I'm still staying away from mainstre=<BR>> >am platforms=3D2C> >so the value isn't what it might appear to be=3D2C but =<BR>> >it is "stage setting"=3D> >=3D2C> >and the show might go on. :)> >=3D20> >=<BR>> >=3D20> >Also=3D2C the dilemna does get more difficult now=3D2C with the lit=<BR>> >tle C header=3D> > cloning that remains.> >=3D20> >For example=3D2C look at=<BR>> > Upthreads.i3.> >Mainly=3D2C look at function prototypes.> >Constants and t=<BR>> >ypes are "known problems".> >Prototypes are gray. They actually tend to be =<BR>> >portable.> >=3D20> >For example:> >=3D20> >TYPE pid_t =3D3D INTEGER=3D3B> >=<BR>> ><*EXTERNAL "m3_getpid*> PROCEDURE getpid():pid_t=3D3B> >=3D20> >or leave it=<BR>> > alone?> >getpid is probably the worst example.> >It is so very portable de=<BR>> >clared in Modula-3.> >But still=3D2C imagine pid_t might be 16bits or 32 or=<BR>> > 64.> >Writing a wrapper is more portable -- as long as the pid isn't stuff=<BR>> > into s=3D> >ome record that the system defines.> >=3D20> >=3D20> >Again=3D=<BR>> >2C Upthreads.i3.> >Would you like to see it reduced=3D2C or left alone?> >O=<BR>> >nly deal with the types and initializers=3D2C or also the prototypes?> >You=<BR>> > know=3D2C I could write a little portable layer=3D2C where all the types a=<BR>> >r=3D> >e pointers=3D2C always null initialized.> >It would buy /some/ porta=<BR>> >bility=3D2C and cost some.> >=3D20> >=3D20> >Do you like the sem_t change? =<BR>> >Partly? Not at all?> >There is one sem_t in the system. So I moved it to be=<BR>> > in C code.> >Or=3D2C as I had it before=3D2C declared as the max size/alig=<BR>> >n of all the platf=3D> >orms -- getting that right is the same work as gett=<BR>> >ing it right "the old wa=3D> >y"=3D2C except if you make a mistake=3D2C odd=<BR>> >s are still good of it being ok.> >=3D20> >=3D20> >Should the line be drawn=<BR>> > at generating the remaining headers=3D2C rather than=3D> > eliminating the=<BR>> >m?> >Uerror.i3 is easily generated. Good enough?> >=3D20> >Upthread.i3's ty=<BR>> >pes can be generated generally as records with opaque array=3D> >s with the=<BR>> > right size and alignment.> >=3D20> >Other stuff can be generated or at lea=<BR>> >st checked.> >e.g. to check that getpid is declared correctly=3D2C you can =<BR>> >assign it to a f=3D> >unction pointer and see if that compiles.> >=3D20> >P=<BR>> >erf on Uerror arguably doesn't matter.> >Is it only error handling code?Or =<BR>> >do sockets often go down "error" paths=3D2C=3D> > because they are slow and=<BR>> > you are waiting for more data?> >=3D20> >Anyway=3D2C point is=3D2C I agree=<BR>> > for sure this is valuable=3D2C but I might be h=3D> >itting the "tail" of =<BR>> >the approach and should switch=3D2C I'm not sure. I keep=3D> > saying that =<BR>> >though=3D2C and then press further.> >=3D20> >=3D20> > - Jay> >> >> >> >Fro=<BR>> >m: hosking@cs.purdue.eduTo: jay.krell@cornell.eduDate: Mon=3D2C 12 Jan 200=<BR>> >=3D> >9 19:24:50 +1100CC: m3devel@elegosoft.comSubject: Re: [M3devel] decla=<BR>> >ring a=3D> > type's existance but not enough to instantiate it?> >> >> >Poi=<BR>> >nt taken. We live in a C universe and so need to interact. I do think =3D> =<BR>> >>your work with the headers is useful=3D2C and I want it to continue. Espec=<BR>> >ia=3D> >lly in simplifying ports.> >> >> >On 12 Jan 2009=3D2C at 19:18=3D2C=<BR>> > Jay wrote:> >> >I don't think a development system without C headers is in=<BR>> >teresting.. Is it=3D> > really? The transform I apply at times is wherever =<BR>> >there is interaction wi=3D> >th C code that is described by system-dependen=<BR>> >t headers=3D2C or perhaps even =3D> >fairly system-independent headers outs=<BR>> >ide the Modula-3 tree=3D2C either write=3D> > wrapper functions for the fun=<BR>> >ctionality in the headers (e.g. stat=3D2C waitp=3D> >id)=3D2C which can be =<BR>> >done in a system-independent way=3D2C or move the Modula-=3D> >3<->C transi=<BR>> >tion higher=3D2C which is also usually system-independent=3D2C e.g.=3D> > T=<BR>> >hreadPThreadC_SetupHandlers. It is either that or clone the headers=3D2C wh=<BR>> >=3D> >ich seems like the worse evil. There is always going to be a Modula-3=<BR>> ><->C t=3D> >ransition=3D2C it is just a matter of where it occurs. - Jay> >=<BR>> >> >CC: m3devel@elegosoft.comFrom: hosking@cs.purdue.eduTo: jay.krell@cornel=<BR>> >l.e=3D> >duSubject: Re: [M3devel] declaring a type's existance but not enou=<BR>> >gh to ins=3D> >tantiate it?Date: Mon=3D2C 12 Jan 2009 12:32:15 +1100> >> >>=<BR>> > >Jay=3D2C I really think you are bending over backwards too far just to be=<BR>> > abl=3D> >e to shoe-horn things into C. I *like* having the transpar of C h=<BR>> >eader fil=3D> >es expressed in Modula-3=3D2C *particularly* for system call=<BR>> >s=3D2C where you mi=3D> >ght even be trying to build on a system that does =<BR>> >not have the C header fil=3D> >es installed=3D2C even though the libraries =<BR>> >exist and can be linked to. Fund=3D> >amentally=3D2C I think anytime the Mo=<BR>> >dula-3 code is made less transparent you=3D> > should think hard about what=<BR>> > you are doing. The same with the change of c=3D> >onstants to variables.> =<BR>> >>> >I am getting very nervous that the changes you are making are destroyin=<BR>> >g th=3D> >e clarity of the Modula-3 run-time code.> >> >In this particular =<BR>> >case=3D2C you are wanting to use a Modula-3 parameter pass=3D> >ing mechani=<BR>> >sm on something that is not declared in Modula-3. Seems kind of=3D> > dubio=<BR>> >us to me. Also=3D2C I really don't like the idea of accessing external=3D> =<BR>> >> variables in C.> >> >-- Tony> >> >On 12 Jan 2009=3D2C at 11:55=3D2C Jay w=<BR>> >rote:> >> >I considered ADDRESS.However I think it still doesn't satisfy. I=<BR>> > want to be=3D> > able to do this: TYPE Foo_t =3D3D something=3D3B<* EXTERN=<BR>> >AL *> VAR Foo1=3D2C Foo=3D> >2:Foo_t=3D3B<* EXTERNAL *> PROCEDURE UseFoo(RE=<BR>> >ADONLY (* or VAR *) foo:Foo_t)=3D> >=3D3B (* Modula-3=3D2C not external *)P=<BR>> >ROCEDURE x()=3D3DBEGIN UseFoo(Foo1)=3D3B U=3D> >seFoo(Foo2)=3D3BEND x=3D3B =<BR>> >AND I want any use of:VAR Foo3:Foo3_t=3D3B (* Modula-3=3D> >=3D2C not exter=<BR>> >nal *)to error. This is sem_t and sigset_t in particular. Poss=3D> >ibly re=<BR>> >naming is the thing.They used to be declared in Modula-3=3D2C system-d=3D> =<BR>> >>ependently=3D2C butI moved them to portable C. I could remove the types en=<BR>> >tir=3D> >ely and change UseFoo to take an address=3D2Cand declare mask and =<BR>> >ackSem to b=3D> >e integers or I guess.<*EXTERNAL> VAR ackSem : RECORD END=<BR>> >=3D3B That would sat=3D> >isfy but I thought it might be nicer to still pro=<BR>> >vide the namedtypes to ref=3D> >er to the external variables. - Jay> >> >Fr=<BR>> >om: hosking@cs.purdue.eduTo: jay.krell@cornell.eduDate: Mon=3D2C 12 Jan 200=<BR>> >=3D> >9 11:13:00 +1100CC: m3devel@elegosoft.comSubject: Re: [M3devel] decla=<BR>> >ring a=3D> > type's existance but not enough to instantiate it?What's wrong=<BR>> > with using =3D> >ADDRESS for references to opaque values? If sigset_t is n=<BR>> >ever instantiated=3D> > in Modula-3=3D2C then why do you need it declared t=<BR>> >here?> >> >> >> >Antony Hosking | Associate Professor | Computer Science | =<BR>> >Purdue University> >305 N. University Street | West Lafayette | IN 47907 | =<BR>> >USA> >Office +1 765 494 6001 | Mobile +1 765 427 5484> >> >> >On 12 Jan 200=<BR>> >9=3D2C at 01:44=3D2C Jay wrote:> >> >Is there a way in Modula-3 to declare =<BR>> >that a type exists=3D2C and there are <=3D> >*external*> instances of it=3D=<BR>> >2C without "fully" declaring it=3D2C so that no M=3D> >odula-3 can instanti=<BR>> >ate it? I have done this for sigset_t and sem_t=3D2C but =3D> >they could e=<BR>> >rroneously be instantiated by Modula-3 and I'd like to remove t=3D> >hat ab=<BR>> >ility to mess up so easily. (* This type is not declared correctly. I=3D> >=<BR>> >t is only instantiated in C code. *) sigset_t =3D3D RECORD END=3D3B(* This =<BR>> >typ=3D> >e is not declared correctly. It is only instantiated in C code. *)=<BR>> > sem_t =3D> >=3D3D RECORD END=3D3BIn C I believe you can do this=3D2C like:=<BR>> > typedef struct fo=3D> >o foo_t=3D3B extern foo_t foo=3D3B void UseFoo(foo_=<BR>> >t*)=3D3B foo_t* GetFoo=3D> >(void)=3D3B Thanks=3D2C - Jay=3D> >> >--_6117a0=<BR>> >48-9185-4c03-badb-ef8f93402268_> >Content-Type: text/html=3B charset=3D"iso=<BR>> >-8859-1"> >Content-Transfer-Encoding: quoted-printable> >> ><html>> ><head>=<BR>> >> ><style>> >.hmmessage P> >{> >margin:0px=3D3B> >padding:0px> >}> >body.hm=<BR>> >message> >{> >font-size: 10pt=3D3B> >font-family:Verdana> >}> ></style>> ><=<BR>> >/head>> ><body class=3D3D'hmmessage'>> >This is what you "have to" chose be=<BR>> >tween.<BR>> >Header cloning or C code (and C headers).<BR>> > =3D3B<BR>=<BR>> >> >CONST or VAR (or functions?)<BR>> > =3D3B<BR>> >I'm going to likely =<BR>> >make the Uerror change tonight.<BR>> >You can still veto it (er=3D2C vote a=<BR>> >gainst it :) )<BR>> > =3D3B<BR>> >Possibly some convuluted C (enum/#und=<BR>> >ef)=3D2C or splitting the Modula-3<BR>> >at boundaries that weren't previou=<BR>> >sly believed "natural".<BR>> >(See how SetupHandlers is ~two lines in Modul=<BR>> >a-3 and the rest in C=3D3B<BR>> >this is partly out of ignorance. I don't k=<BR>> >now how to write those<BR>> >two lines in C=3D3B and laziness=3D2C I didn't=<BR>> > look into how).<BR>> > =3D3B<BR>> > =3D3B<BR>> > =3D3B<BR>> >R=<BR>> >emember I'm still staying away from mainstream platforms=3D2C<BR>> >so the =<BR>> >value isn't what it might appear to be=3D2C but it is "stage setting"=3D> >=<BR>> >=3D2C<BR>> >and the show might go on. :)<BR>> > =3D3B<BR>> > =3D3B<=<BR>> >BR>> >Also=3D2C the dilemna does get more difficult now=3D2C with the littl=<BR>> >e C header=3D> > cloning that remains.<BR>> > =3D3B<BR>> >For example=<BR>> >=3D2C look at Upthreads.i3.<BR>> >Mainly=3D2C look at function prototypes.<=<BR>> >BR>> >Constants and types are "known problems".<BR>> >Prototypes are gray. =<BR>> >They actually tend to be portable.<BR>> > =3D3B<BR>> >For example:<BR>>=<BR>> > > =3D3B<BR>> >TYPE pid_t =3D3D INTEGER=3D3B<BR>> ><=3D3B*EXTERNAL "m=<BR>> >3_getpid*>=3D3B PROCEDURE getpid():pid_t=3D3B<BR>> > =3D3B<BR>> >or l=<BR>> >eave it alone?<BR>> >getpid is probably the worst example.<BR>> >It is so v=<BR>> >ery portable declared in Modula-3.<BR>> >But still=3D2C imagine pid_t might=<BR>> > be 16bits or 32 or 64.<BR>> >Writing a wrapper is more portable -- as long=<BR>> > as the pid isn't stuff into s=3D> >ome record that the system defines.<BR>=<BR>> >> > =3D3B<BR>> > =3D3B<BR>> >Again=3D2C Upthreads.i3.<BR>> >Would y=<BR>> >ou like to see it reduced=3D2C or left alone?<BR>> >Only deal with the type=<BR>> >s and initializers=3D2C or also the prototypes?<BR>> >You know=3D2C I could=<BR>> > write a little portable layer=3D2C where all the types ar=3D> >e pointers=<BR>> >=3D2C always null initialized.<BR>> >It would buy /some/ portability=3D2C a=<BR>> >nd cost some.<BR>> > =3D3B<BR>> > =3D3B<BR>> >Do you like the sem_t=<BR>> > change? Partly? Not at all?<BR>> >There is one sem_t in the system. So I m=<BR>> >oved it to be in C code.<BR>> >Or=3D2C as I had it before=3D2C declared as =<BR>> >the max size/align of all the platf=3D> >orms -- getting that right is the =<BR>> >same work as getting it right "the old wa=3D> >y"=3D2C except if you make a=<BR>> > mistake=3D2C odds are still good of it being ok.<B=3D> >R>> > =3D3B<BR=<BR>> >>> > =3D3B<BR>> >Should the line be drawn at generating the remaining h=<BR>> >eaders=3D2C rather than=3D> > eliminating them?<BR>> >Uerror.i3 is easily g=<BR>> >enerated. Good enough?<BR>> > =3D3B<BR>> >Upthread.i3's types can be ge=<BR>> >nerated generally as records with opaque array=3D> >s with the right size a=<BR>> >nd alignment.<BR>> > =3D3B<BR>> >Other stuff can be generated or at lea=<BR>> >st checked.<BR>> >e.g. to check that getpid is declared correctly=3D2C you =<BR>> >can assign it to a f=3D> >unction pointer and see if that compiles.<BR>> >&=<BR>> >nbsp=3D3B<BR>> >Perf on Uerror arguably doesn't matter.<BR>> >Is it only er=<BR>> >ror handling code?<BR>Or do sockets often go down "error" path=3D> >s=3D2C =<BR>> >because they are slow and you are waiting for more data?<BR>> > =3D3B<B=<BR>> >R>> >Anyway=3D2C point is=3D2C I agree for sure this is valuable=3D2C but I=<BR>> > might be h=3D> >itting the "tail" of the approach and should switch=3D2C I=<BR>> >'m not sure. I keep=3D> > saying that though=3D2C and then press further.<B=<BR>> >R>> > =3D3B<BR>> > =3D3B<BR>> > =3D3B- Jay<BR><BR>> >> ><HR id=<BR>> >=3D3DstopSpelling>> <BR>> >From: hosking@cs.purdue.edu<BR>To: jay.krell@cor=<BR>> >nell.edu<BR>Date: Mon=3D2C 12=3D> > Jan 2009 19:24:50 +1100<BR>CC: m3devel@=<BR>> >elegosoft.com<BR>Subject: Re: [M3de=3D> >vel] declaring a type's existance =<BR>> >but not enough to instantiate it?<BR><BR>=3D> ><BR>> ><DIV><SPAN class=3D3D=<BR>> >EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: =3D> >12px Helv=<BR>> >etica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-IN=<BR>> >D=3D> >ENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B B=<BR>> >ORDER-COLLAPS=3D> >E: separate">> ><DIV style=3D3D"WORD-WRAP: break-word"><=<BR>> >SPAN class=3D3DEC_Apple-style-span styl=3D> >e=3D3D"WORD-SPACING: 0px=3D3B =<BR>> >FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B C=3D> >OLOR: rgb(0=3D2C=<BR>> >0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-S=3D> >=<BR>> >PACING: normal=3D3B BORDER-COLLAPSE: separate"><SPAN class=3D3DEC_Apple-sty=<BR>> >le-s=3D> >pan style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B T=<BR>> >EXT-TRANSFORM: n=3D> >one=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: =<BR>> >0px=3D3B WHITE-SPACE: normal=3D3B =3D> >LETTER-SPACING: normal=3D3B BORDER-=<BR>> >COLLAPSE: separate"><SPAN class=3D3DEC_Apple=3D> >-style-span style=3D3D"WO=<BR>> >RD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRAN=3D> >SFORM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: no=<BR>> >=3D> >rmal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate"><SPA=<BR>> >N class=3D3D=3D> >EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FON=<BR>> >T: 12px Helvetica=3D3B T=3D> >EXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=<BR>> >=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-S=3D> >PACE: normal=3D3B LETTER-SP=<BR>> >ACING: normal=3D3B BORDER-COLLAPSE: separate"><SPAN =3D> >class=3D3DEC_Appl=<BR>> >e-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvet=3D> >ica=<BR>> >=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT:=<BR>> > 0px=3D3B=3D> > WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER=<BR>> >-COLLAPSE: separate=3D> >"><SPAN class=3D3DEC_Apple-style-span style=3D3D"W=<BR>> >ORD-SPACING: 0px=3D3B FONT: 12p=3D> >x Helvetica=3D3B TEXT-TRANSFORM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT=3D> >: 0px=3D3B WHITE-SPAC=<BR>> >E: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: =3D> >separate"=<BR>> >><SPAN class=3D3DEC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B F=3D=<BR>> >> >ONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D=<BR>> >2C0)=3D3B TEX=3D> >T-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACI=<BR>> >NG: normal=3D3B BORDER-CO=3D> >LLAPSE: separate"><SPAN class=3D3DEC_Apple-s=<BR>> >tyle-span style=3D3D"WORD-SPACING: =3D> >0px=3D3B FONT: 12px Helvetica=3D3B=<BR>> > TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0=3D> >)=3D3B TEXT-INDENT=<BR>> >: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B B=3D> >ORDE=<BR>> >R-COLLAPSE: separate">> ><DIV>Point taken.  =3D3BWe live in a C univers=<BR>> >e and so need to interact. =3D> > =3D3BI do think your work with the he=<BR>> >aders is useful=3D2C and I want it to=3D> > continue.  =3D3BEspecially =<BR>> >in simplifying ports.</DIV>> ><DIV><BR></DIV></SPAN></SPAN></SPAN></SPAN></=<BR>> >SPAN></SPAN></SPAN></SPAN></DI=3D> >V></SPAN></DIV>> ><DIV>> ><DIV>On 12 Ja=<BR>> >n 2009=3D2C at 19:18=3D2C Jay wrote:</DIV><BR class=3D3DEC_Apple-int=3D> >e=<BR>> >rchange-newline>> ><BLOCKQUOTE><SPAN class=3D3DEC_Apple-style-span style=3D=<BR>> >3D"WORD-SPACING: 0px=3D3B=3D> > FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: n=<BR>> >one=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B T=3D> >EXT-INDENT: 0px=3D3B WHITE-S=<BR>> >PACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-=3D> >COLLAPSE: separa=<BR>> >te">> ><DIV class=3D3DEC_hmmessage style=3D3D"FONT-SIZE: 10pt=3D3B FONT-FAM=<BR>> >ILY: Verdana"=3D> >>I don't think a development system without C headers is=<BR>> > interesting.. Is i=3D> >t really?<BR> =3D3B<BR>The transform I apply a=<BR>> >t times is wherever there i=3D> >s interaction with C code that is describe=<BR>> >d by system-dependent headers=3D2C =3D> >or perhaps even fairly system-inde=<BR>> >pendent headers outside the Modula-3 tree=3D> >=3D2C either write wrapper f=<BR>> >unctions for the functionality in the headers (e.=3D> >g. stat=3D2C waitpid=<BR>> >)=3D2C which =3D3Bcan be done in a system-independent way=3D> >=3D2C&nb=<BR>> >sp=3D3Bor move the Modula-3<=3D3B->=3D3BC transition higher=3D2C which =<BR>> >is=3D> > also usually system-independent=3D2C e.g. ThreadPThreadC_SetupHand=<BR>> >lers.<BR>&=3D> >nbsp=3D3B<BR>It is either that or clone the headers=3D2C wh=<BR>> >ich seems like the w=3D> >orse evil.<BR> =3D3B<BR>There is always going=<BR>> > to be a Modula-3<=3D3B->=3D> >=3D3BC transition=3D2C it is just a matt=<BR>> >er of where it occurs.<BR> =3D3B<BR>&=3D> >nbsp=3D3B- Jay<BR><BR>> ><HR=<BR>> > id=3D3DEC_stopSpelling>> ><BR>CC:<SPAN class=3D3DEC_Apple-converted-space>=<BR>> > =3D3B</SPAN><A href=3D3D"mai=3D> >lto:m3devel@elegosoft.com">m3devel@e=<BR>> >legosoft.com</A><BR>From:<SPAN class=3D3D=3D> >EC_Apple-converted-space>&nb=<BR>> >sp=3D3B</SPAN><A href=3D3D"mailto:hosking@cs.purdue=3D> >.edu">hosking@cs.p=<BR>> >urdue.edu</A><BR>To:<SPAN class=3D3DEC_Apple-converted-spac=3D> >e> =3D=<BR>> >3B</SPAN><A href=3D3D"mailto:jay.krell@cornell.edu">jay.krell@cornell=3D> >=<BR>> >.edu</A><BR>Subject: Re: [M3devel] declaring a type's existance but not eno=<BR>> >=3D> >ugh to instantiate it?<BR>Date: Mon=3D2C 12 Jan 2009 12:32:15 +1100<B=<BR>> >R><BR><B=3D> >R>> <DIV><SPAN class=3D3DEC_EC_Apple-style-span style=3D3D"WO=<BR>> >RD-SPACING: 0px=3D3B FON=3D> >T: 12px Helvetica=3D3B TEXT-TRANSFORM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-=3D> >INDENT: 0px=3D3B WHITE-SPAC=<BR>> >E: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLL=3D> >APSE: separate"=<BR>> >>> ><DIV style=3D3D"WORD-WRAP: break-word"><SPAN class=3D3DEC_EC_Apple-styl=<BR>> >e-span s=3D> >tyle=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TE=<BR>> >XT-TRANSFORM: none=3D> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0=<BR>> >px=3D3B WHITE-SPACE: normal=3D3B LET=3D> >TER-SPACING: normal=3D3B BORDER-C=<BR>> >OLLAPSE: separate"><SPAN class=3D3DEC_EC_Apple=3D> >-style-span style=3D3D"=<BR>> >WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRAN=3D> >SFORM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: no=<BR>> >=3D> >rmal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate"><SPA=<BR>> >N class=3D3D=3D> >EC_EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B =<BR>> >FONT: 12px Helvetica=3D> >=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C=<BR>> >0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WH=3D> >ITE-SPACE: normal=3D3B LETTER-S=<BR>> >PACING: normal=3D3B BORDER-COLLAPSE: separate"><=3D> >SPAN class=3D3DEC_EC_=<BR>> >Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12p=3D> >x Helveti=<BR>> >ca=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDEN=<BR>> >T=3D> >: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORD=<BR>> >ER-COLLAPSE: =3D> >separate"><SPAN class=3D3DEC_EC_Apple-style-span style=<BR>> >=3D3D"WORD-SPACING: 0px=3D> >=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM=<BR>> >: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D> >=3D3B TEXT-INDENT: 0px=3D3B WHIT=<BR>> >E-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BO=3D> >RDER-COLLAPSE: sep=<BR>> >arate"><SPAN class=3D3DEC_EC_Apple-style-span style=3D3D"WORD=3D> >-SPACING=<BR>> >: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb=<BR>> >=3D> >(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B L=<BR>> >ETTER-SPACING: n=3D> >ormal=3D3B BORDER-COLLAPSE: separate"><SPAN class=3D3=<BR>> >DEC_EC_Apple-style-span st=3D> >yle=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px =<BR>> >Helvetica=3D3B TEXT-TRANSFORM: none=3D3B=3D> > COLOR: rgb(0=3D2C0=3D2C0)=3D=<BR>> >3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER=3D> >-SPACING: nor=<BR>> >mal=3D3B BORDER-COLLAPSE: separate"><SPAN class=3D3DEC_EC_Apple-st=3D> >yle=<BR>> >-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRAN=<BR>> >SFO=3D> >RM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B=<BR>> > WHITE-SPACE: norma=3D> >l=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE=<BR>> >: separate">> ><DIV>Jay=3D2C I really think you are bending over backwards =<BR>> >too far just to b=3D> >e able to shoe-horn things into C.  =3D3BI *like=<BR>> >* having the transpar of =3D> >C header files expressed in Modula-3=3D2C *p=<BR>> >articularly* for system calls=3D2C =3D> >where you might even be trying to =<BR>> >build on a system that does not have the =3D> >C header files installed=3D2=<BR>> >C even though the libraries exist and can be link=3D> >ed to.  =3D3BFun=<BR>> >damentally=3D2C I think anytime the Modula-3 code is made l=3D> >ess transp=<BR>> >arent you should think hard about what you are doing.  =3D3BThe=3D> > s=<BR>> >ame with the change of constants to variables.</DIV>> ><DIV><BR></DIV>> ><D=<BR>> >IV>I am getting very nervous that the changes you are making are destroyi=<BR>> >=3D> >ng the clarity of the Modula-3 run-time code.</DIV>> ><DIV><BR></DIV>=<BR>> >> ><DIV>In this particular case=3D2C you are wanting to use a Modula-3 para=<BR>> >meter=3D> > passing mechanism on something that is not declared in Modula-3=<BR>> >.  =3D3BS=3D> >eems kind of dubious to me.  =3D3BAlso=3D2C I really=<BR>> > don't like the idea of=3D> > accessing external variables in C.</DIV>> ><D=<BR>> >IV><BR></DIV>> ><DIV>-- Tony</DIV></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN=<BR>> >></SPAN></SPAN><=3D> >/DIV></SPAN></DIV><BR>> ><DIV>> ><DIV>On 12 Jan 2009=<BR>> >=3D2C at 11:55=3D2C Jay wrote:</DIV><BR class=3D3DEC_EC_Apple-=3D> >interch=<BR>> >ange-newline>> ><BLOCKQUOTE><SPAN class=3D3DEC_EC_Apple-style-span style=3D=<BR>> >3D"WORD-SPACING: 0px=3D> >=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: n=<BR>> >one=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D> >=3D3B TEXT-INDENT: 0px=3D3B WHITE-S=<BR>> >PACE: normal=3D3B LETTER-SPACING: normal=3D3B BO=3D> >RDER-COLLAPSE: separa=<BR>> >te">> ><DIV class=3D3DEC_EC_hmmessage style=3D3D"FONT-SIZE: 10pt=3D3B FONT-=<BR>> >FAMILY: Verda=3D> >na">I considered ADDRESS.<BR>However I think it still do=<BR>> >esn't satisfy.<BR>&=3D> >nbsp=3D3B<BR>I want to be able to do this:<BR>&nbs=<BR>> >p=3D3B<BR>TYPE =3D3BFoo_t =3D> >=3D3D something=3D3B<BR><=3D3B* EXTER=<BR>> >NAL *>=3D3B VAR Foo1=3D2C Foo2:Foo_t=3D3B<BR>&=3D> >lt=3D3B* EXTERNAL *&g=<BR>> >t=3D3B PROCEDURE =3D3BUseFoo(READONLY (* or VAR *) foo:F=3D> >oo_t)=3D3=<BR>> >B<BR> =3D3B<BR>(* Modula-3=3D2C not external *)<BR>PROCEDURE x()=3D3D<=<BR>> >=3D> >BR>BEGIN<BR> =3D3B UseFoo(Foo1)=3D3B<BR> =3D3B UseFoo(Foo2)=<BR>> >=3D3B<BR>END x=3D> >=3D3B<BR> =3D3B<BR>AND I want any use of:<BR>VAR Fo=<BR>> >o3:Foo3_t=3D3B (* Modula-3=3D> >=3D2C not external *)<BR><BR>to error. This=<BR>> > is sem_t and sigset_t in particul=3D> >ar.<BR> =3D3B<BR>Possibly renam=<BR>> >ing is the thing.<BR>They used to be decla=3D> >red in Modula-3=3D2C system=<BR>> >-dependently=3D2C but<BR>I moved them to portable C.=3D> ><BR> =3D3B<BR=<BR>> >>I could remove the types entirely and change UseFoo to take=3D> > an addre=<BR>> >ss=3D2C<BR>and declare mask and ackSem to be integers or I guess.<BR=3D> >>=<BR>> ><=3D3B*EXTERNAL>=3D3B VAR ackSem =3D3B: RECORD END=3D3B<BR> =3D=<BR>> >3B<BR>Tha=3D> >t would satisfy but I thought it might be nicer to still pro=<BR>> >vide the named<=3D> >BR>types to refer to the external variables.<BR> =<BR>> >=3D3B<BR> =3D3B- Jay<B=3D> >R><BR>> ><HR id=3D3DEC_EC_stopSpelling>> ><=<BR>> >BR>From:<SPAN class=3D3DEC_EC_Apple-converted-space> =3D3B</SPAN><A hre=<BR>> >f=3D> >=3D3D"mailto:hosking@cs.purdue.edu">hosking@cs.purdue.edu</A><BR>To:=<BR>> ><SPAN cla=3D> >ss=3D3DEC_EC_Apple-converted-space> =3D3B</SPAN><A href=<BR>> >=3D3D"mailto:jay.krell=3D> >@cornell.edu">jay.krell@cornell.edu</A><BR>Date=<BR>> >: Mon=3D2C 12 Jan 2009 11:13:0=3D> >0 +1100<BR>CC:<SPAN class=3D3DEC_EC_App=<BR>> >le-converted-space> =3D3B</SPAN><A h=3D> >ref=3D3D"mailto:m3devel@elego=<BR>> >soft.com">m3devel@elegosoft.com</A><BR>Subject: =3D> >Re: [M3devel] declari=<BR>> >ng a type's existance but not enough to instantiate it=3D> >?<BR><BR>What's=<BR>> > wrong with using ADDRESS for references to opaque values? &=3D> >nbsp=3D3B=<BR>> >If sigset_t is never instantiated in Modula-3=3D2C then why do you nee=3D> =<BR>> >>d it declared there?<BR>> ><DIV><BR>> ><DIV><SPAN class=3D3DEC_EC_EC_Apple=<BR>> >-style-span style=3D3D"WORD-SPACING: 0px=3D3B =3D> >FONT: 12px Helvetica=3D=<BR>> >3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TE=3D> >XT-INDE=<BR>> >NT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-C=<BR>> >=3D> >OLLAPSE: separate">> ><DIV style=3D3D"WORD-WRAP: break-word"><SPAN cl=<BR>> >ass=3D3DEC_EC_EC_Apple-style-spa=3D> >n style=3D3D"WORD-SPACING: 0px=3D3B F=<BR>> >ONT: 12px Helvetica=3D3B TEXT-TRANSFORM: non=3D> >e=3D3B COLOR: rgb(0=3D2C0=<BR>> >=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LE=3D> >TTER-SP=<BR>> >ACING: normal=3D3B BORDER-COLLAPSE: separate"><SPAN class=3D3DEC_EC_EC_A=3D=<BR>> >> >pple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=<BR>> >=3D3B TEXT-=3D> >TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-I=<BR>> >NDENT: 0px=3D3B WHITE-SPACE=3D> >: normal=3D3B LETTER-SPACING: normal=3D3B =<BR>> >BORDER-COLLAPSE: separate"><SPAN clas=3D> >s=3D3DEC_EC_EC_Apple-style-span =<BR>> >style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helv=3D> >etica=3D3B TEXT-TRAN=<BR>> >SFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D> >=3D3B=<BR>> > WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: sepa=<BR>> >r=3D> >ate"><SPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACI=<BR>> >NG: 0px=3D3B =3D> >FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLO=<BR>> >R: rgb(0=3D2C0=3D2C0)=3D3B TE=3D> >XT-INDENT: 0px=3D3B WHITE-SPACE: normal=<BR>> >=3D3B LETTER-SPACING: normal=3D3B BORDER-C=3D> >OLLAPSE: separate"><SPAN cl=<BR>> >ass=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SP=3D> >ACING: 0px=3D3B F=<BR>> >ONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D> >=3D2C0=<BR>> >=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING:=<BR>> > nor=3D> >mal=3D3B BORDER-COLLAPSE: separate"><SPAN class=3D3DEC_EC_EC_Appl=<BR>> >e-style-span s=3D> >tyle=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=<BR>> >=3D3B TEXT-TRANSFORM: none=3D> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-I=<BR>> >NDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LET=3D> >TER-SPACING: normal=3D3B =<BR>> >BORDER-COLLAPSE: separate"><SPAN class=3D3DEC_EC_EC_Ap=3D> >ple-style-span =<BR>> >style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-T=3D> >RAN=<BR>> >SFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE=<BR>> >-SPACE:=3D> > normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: sepa=<BR>> >rate"><SPAN class=3D> >=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACI=<BR>> >NG: 0px=3D3B FONT: 12px Helve=3D> >tica=3D3B TEXT-TRANSFORM: none=3D3B COLO=<BR>> >R: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D> >=3D3B WHITE-SPACE: normal=<BR>> >=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separ=3D> >ate">> ><DIV>=<BR>> ><FONT class=3D3DEC_EC_EC_Apple-style-span color=3D3D#0000ff><FONT class=3D3=<BR>> >D=3D> >EC_EC_EC_Apple-style-span face=3D3D"Gill Sans"><SPAN class=3D3DEC_EC=<BR>> >_EC_Apple-s=3D> >tyle-span style=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=3D3B FONT=<BR>> >-FAMILY: 'Gill Sans'"><SP=3D> >AN class=3D3DEC_EC_EC_Apple-style-span style=<BR>> >=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=3D3B FO=3D> >NT-FAMILY: 'Gill Sans'">Anto=<BR>> >ny Hosking</SPAN></SPAN></FONT></FONT><FONT cla=3D> >ss=3D3DEC_EC_EC_Apple-=<BR>> >style-span face=3D3D"Gill Sans"><SPAN class=3D3DEC_EC_EC_Ap=3D> >ple-style-=<BR>> >span style=3D3D"FONT-FAMILY: 'Gill Sans'"><SPAN class=3D3DEC_EC_EC_Ap=3D> >=<BR>> >ple-style-span style=3D3D"FONT-FAMILY: 'Gill Sans'"><SPAN class=3D3DEC_EC_A=<BR>> >pple=3D> >-converted-space> =3D3B</SPAN>|<SPAN class=3D3DEC_EC_Apple-co=<BR>> >nverted-space>=3D> > =3D3B</SPAN></SPAN></SPAN><SPAN class=3D3DEC_EC_EC=<BR>> >_Apple-style-span style=3D> >=3D3D"FONT-FAMILY: 'Gill Sans'"><SPAN class=3D=<BR>> >3DEC_EC_EC_Apple-style-span style=3D> >=3D3D"FONT-FAMILY: 'Gill Sans'">Asso=<BR>> >ciate Professor</SPAN></SPAN><SPAN class=3D> >=3D3DEC_EC_EC_Apple-style-spa=<BR>> >n style=3D3D"FONT-FAMILY: 'Gill Sans'"><SPAN class=3D> >=3D3DEC_EC_EC_Apple=<BR>> >-style-span style=3D3D"FONT-FAMILY: 'Gill Sans'"> =3D3B| C=3D> >omputer=<BR>> > Science | Purdue University</SPAN></SPAN></FONT></DIV>> ><DIV><FONT class=<BR>> >=3D3DEC_EC_EC_Apple-style-span face=3D3DGillSans-Light><SPAN cl=3D> >ass=3D=<BR>> >3DEC_EC_EC_Apple-style-span style=3D3D"FONT-FAMILY: GillSans-Light">305 N=<BR>> >=3D> >. University Street | West Lafayette | IN 47907 | USA</SPAN></FONT></=<BR>> >DIV>> ><DIV><FONT class=3D3DEC_EC_EC_Apple-style-span face=3D3D"Gill Sans" =<BR>> >color=3D3D#00=3D> >00ff><SPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3=<BR>> >D"COLOR: rgb(0=3D2C0=3D2C25=3D> >5)=3D3B FONT-FAMILY: 'Gill Sans'"><SPAN cl=<BR>> >ass=3D3DEC_EC_EC_Apple-style-span sty=3D> >le=3D3D"COLOR: rgb(0=3D2C0=3D2C2=<BR>> >55)=3D3B FONT-FAMILY: 'Gill Sans'">Office</SPAN></S=3D> >PAN></FONT><FONT c=<BR>> >lass=3D3DEC_EC_EC_Apple-style-span face=3D3DGillSans-Light><S=3D> >PAN clas=<BR>> >s=3D3DEC_EC_EC_Apple-style-span style=3D3D"FONT-FAMILY: GillSans-Light"=3D>=<BR>> > >><SPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"FONT-FAMILY: GillSa=<BR>> >ns-Lig=3D> >ht"> =3D3B+1 765 494 6001 |<SPAN class=3D3DEC_EC_Apple-conv=<BR>> >erted-space>&nbs=3D> >p=3D3B</SPAN></SPAN></SPAN></FONT><FONT class=3D3DEC_=<BR>> >EC_EC_Apple-style-span fac=3D> >e=3D3D"Gill Sans" color=3D3D#0000ff><SPAN c=<BR>> >lass=3D3DEC_EC_EC_Apple-style-span sty=3D> >le=3D3D"COLOR: rgb(0=3D2C0=3D2C=<BR>> >255)=3D3B FONT-FAMILY: 'Gill Sans'"><SPAN class=3D3DEC=3D> >_EC_EC_Apple-st=<BR>> >yle-span style=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=3D3B FONT-FAMILY: 'G=3D> >i=<BR>> >ll Sans'">Mobile</SPAN></SPAN></FONT><FONT class=3D3DEC_EC_EC_Apple-style-s=<BR>> >p=3D> >an face=3D3DGillSans-Light><SPAN class=3D3DEC_EC_EC_Apple-style-span=<BR>> > style=3D3D"F=3D> >ONT-FAMILY: GillSans-Light"><SPAN class=3D3DEC_EC_EC_App=<BR>> >le-style-span style=3D> >=3D3D"FONT-FAMILY: GillSans-Light"><SPAN class=3D3=<BR>> >DEC_EC_Apple-converted-space>=3D> > =3D3B</SPAN>+1 765 427 5484</SPAN><=<BR>> >/SPAN></FONT></DIV>> ><DIV><FONT class=3D3DEC_EC_EC_Apple-style-span face=<BR>> >=3D3DGillSans-Light><BR clas=3D> >s=3D3DEC_EC_EC_khtml-block-placeholder></=<BR>> >FONT></DIV></SPAN></SPAN></SPAN></SP=3D> >AN></SPAN></SPAN></SPAN><BR class=<BR>> >=3D3DEC_EC_EC_Apple-interchange-newline></SP=3D> >AN></DIV></SPAN></DIV><BR=<BR>> >>> ><DIV>> ><DIV>On 12 Jan 2009=3D2C at 01:44=3D2C Jay wrote:</DIV><BR clas=<BR>> >s=3D3DEC_EC_EC_App=3D> >le-interchange-newline>> ><BLOCKQUOTE><SPAN class=<BR>> >=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACING: =3D> >0px=3D3B FONT=<BR>> >: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0=3D=<BR>> >> >)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: no=<BR>> >rmal=3D3B B=3D> >ORDER-COLLAPSE: separate">> ><DIV class=3D3DEC_EC_EC_hmmes=<BR>> >sage style=3D3D"FONT-SIZE: 10pt=3D3B FONT-FAMILY: Ve=3D> >rdana">Is there a=<BR>> > way in Modula-3 to declare that =3D3Ba type exists=3D2C a=3D> >nd ther=<BR>> >e are <=3D3B*external*>=3D3B instances of it=3D2C without "fully" decl=<BR>> >=3D> >aring it=3D2C so that no Modula-3 can instantiate it?<BR> =3D3B<B=<BR>> >R>I have d=3D> >one this for sigset_t and sem_t=3D2C but they could erroneo=<BR>> >usly be instantiat=3D> >ed by Modula-3 and I'd like to remove that ability =<BR>> >to mess up so easily.<BR=3D> >> =3D3B<BR>(* This type is not declared c=<BR>> >orrectly. It is only instantiate=3D> >d in C code. *)<BR> =3D3B sigset_=<BR>> >t =3D3D RECORD END=3D3B<BR><BR>(* This type =3D> >is not declared correctly=<BR>> >. It is only instantiated in C code. *)<BR> =3D> >=3D3B sem_t =3D3D REC=<BR>> >ORD END=3D3B<BR><BR>In C I believe you can do this=3D2C like:<=3D> >BR>&nbs=<BR>> >p=3D3B =3D3Btypedef struct foo foo_t=3D3B =3D3B<SPAN class=3D3DEC_E=<BR>> >C_E=3D> >C_Apple-converted-space> =3D3B</SPAN><BR> =3D3B =3D3Be=<BR>> >xtern foo_t foo=3D> >=3D3B =3D3B<SPAN class=3D3DEC_EC_EC_Apple-converte=<BR>> >d-space> =3D3B</SPAN><BR>=3D> > =3D3B<BR> =3D3Bvoid UseFoo(foo_=<BR>> >t*)=3D3B<SPAN class=3D3DEC_EC_EC_Apple-conv=3D> >erted-space> =3D3B</SP=<BR>> >AN><BR> =3D3B foo_t* GetFoo(void)=3D3B<SPAN class=3D> >=3D3DEC_EC_EC_Ap=<BR>> >ple-converted-space> =3D3B</SPAN><BR> =3D3B<BR>Thanks=3D2C<=3D> >BR=<BR>> >> =3D3B- Jay<BR><BR><BR><BR></DIV></SPAN></BLOCKQUOTE></DIV><BR></DIV><=<BR>> >=3D> >/DIV></SPAN><BR class=3D3DEC_EC_Apple-interchange-newline></BLOCKQUOT=<BR>> >E></DIV>=3D> ><BR></DIV></SPAN><BR class=3D3DEC_Apple-interchange-newline><=<BR>> >/BLOCKQUOTE></DI=3D> >V><BR></body>> ></html>=3D> >> >--_6117a048-9185-4c03=<BR>> >-badb-ef8f93402268_--=<BR>> ><BR>> >--_2e194b09-14b6-4301-9116-a9e4d1e522b4_<BR>> >Content-Type: text/html; charset="iso-8859-1"<BR>> >Content-Transfer-Encoding: quoted-printable<BR>> ><BR>> ><html><BR>> ><head><BR>> ><style><BR>> >.hmmessage P<BR>> >{<BR>> >margin:0px=3B<BR>> >padding:0px<BR>> >}<BR>> >body.hmmessage<BR>> >{<BR>> >font-size: 10pt=3B<BR>> >font-family:Verdana<BR>> >}<BR>> ></style><BR>> ></head><BR>> ><body class=3D'hmmessage'><BR>> >Yes=2C generating the headers is viable.<BR><BR>> >I thought I mentioned that a few times.<BR><BR>> They could be generated in any build "that can".<BR> =3B i.e. a native =<BR>> >build=2C that has a working C development system<BR> =3B and checked ag=<BR>> >ainst the checked in ones.<BR><BR>> > =3BSo then porting is: <BR> =3B copy the generator to new system=<BR>> >=2C run it=2C copy results back=2C proceed <BR><BR>> ><BR> =3BMaybe a good compromise. <BR> =3BNot good for "embedded sys=<BR>> >tems"=2C but heck=2C is there any such thing<BR> =3B any longer? Doesn'=<BR>> >t everything have megs of RAM and gigs of persistant storage? :)<BR><BR>> ><BR>You don't need =3BScheme.<BR><BR>> >Just Quake =3B+ compiling and running C code.<BR><BR>> >Assuming a native build system.<BR><BR>> >I've done stuff in cross build systems like:<BR><BR>> >typedef struct foo_t {int i=3B int j=3B } foo_t=3B<BR><BR>> >extern const int xi =3D offsetof(foo_t=2C i)=3B<BR><BR>> > =3B<BR><BR>> >compile that=2C and read the value of xi out of the .obj file.<BR><BR>> > =3B<BR><BR>> > =3BThe .obj file reader was written in Perl. :) <BR><BR>> > =3B (Python not available.)<BR><BR>> > =3Bbut to do that here=2C I'd have to support multiple .obj file forma=<BR>> >ts.<BR><BR>> > =3B<BR><BR>> > =3B- Jay<BR><BR>>=3B To: jay.krell@cornell.edu<BR>>=3B Date: Mon=<BR>> >=2C 12 Jan 2009 01:34:24 -0800<BR>>=3B From: mika@async.caltech.edu<BR>&g=<BR>> >t=3B CC: m3devel@elegosoft.com<BR>>=3B Subject: Re: [M3devel] declaring a=<BR>> > type's existance but not enough to instantiate it?<BR>>=3B <BR>>=3B <B=<BR>> >R>>=3B You present it as a true tragic Dilemma.<BR>>=3B <BR>>=3B But =<BR>> >isn't there a Third Way---to wit=2C can't you "Ask the Computer"<BR>>=3B =<BR>> >to do the work for you?<BR>>=3B <BR>>=3B Generate the code somehow... P=<BR>> >arsing the C headers is an obvious<BR>>=3B way but there may be others th=<BR>> >at are simpler=2C such as writing a<BR>>=3B Modula-3 program to generate =<BR>> >the cloned M3 headers=2C sorry=2C interfaces.<BR>>=3B <BR>>=3B If I had=<BR>> > to do this I would use my Scheme interpreter that's coded<BR>>=3B in Mod=<BR>> >ula-3 to write a Scheme program to generate the headers. This<BR>>=3B pro=<BR>> >gram could pull whatever tricks are deemed necessary and suitable=2C<BR>>=<BR>> >=3B down to the point of generating and compiling and running C programs<BR=<BR>> >>>=3B as necessary (or parsing C code=2C or reading tea leaves). But the<=<BR>> >BR>>=3B end result would be a set of interfaces written in "Pure Modula-3=<BR>> >".<BR>>=3B The process of running the header generator would also have ve=<BR>> >ry<BR>>=3B few dependencies on anything outside the M3 distribution.<BR>&=<BR>> >gt=3B <BR>>=3B Mika<BR>>=3B <BR>>=3B Jay writes:<BR>>=3B >=3B--_6=<BR>> >117a048-9185-4c03-badb-ef8f93402268_<BR>>=3B >=3BContent-Type: text/pla=<BR>> >in=3B charset=3D"iso-8859-1"<BR>>=3B >=3BContent-Transfer-Encoding: quo=<BR>> >ted-printable<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B >=3BThis is wha=<BR>> >t you "have to" chose between.<BR>>=3B >=3BHeader cloning or C code (an=<BR>> >d C headers).<BR>>=3B >=3B=3D20<BR>>=3B >=3BCONST or VAR (or functi=<BR>> >ons?)<BR>>=3B >=3B=3D20<BR>>=3B >=3BI'm going to likely make the Ue=<BR>> >rror change tonight.<BR>>=3B >=3BYou can still veto it (er=3D2C vote ag=<BR>> >ainst it :) )<BR>>=3B >=3B=3D20<BR>>=3B >=3BPossibly some convulute=<BR>> >d C (enum/#undef)=3D2C or splitting the Modula-3<BR>>=3B >=3Bat boundar=<BR>> >ies that weren't previously believed "natural".<BR>>=3B >=3B(See how Se=<BR>> >tupHandlers is ~two lines in Modula-3 and the rest in C=3D3B<BR>>=3B >=<BR>> >=3Bthis is partly out of ignorance. I don't know how to write those<BR>>=<BR>> >=3B >=3Btwo lines in C=3D3B and laziness=3D2C I didn't look into how).<BR=<BR>> >>>=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>>=3B &=<BR>> >gt=3BRemember I'm still staying away from mainstream platforms=3D2C<BR>>=<BR>> >=3B >=3Bso the value isn't what it might appear to be=3D2C but it is "sta=<BR>> >ge setting"=3D<BR>>=3B >=3B=3D2C<BR>>=3B >=3Band the show might go =<BR>> >on. :)<BR>>=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>>=3B >=3BAlso=3D2=<BR>> >C the dilemna does get more difficult now=3D2C with the little C header=3D<=<BR>> >BR>>=3B >=3B cloning that remains.<BR>>=3B >=3B=3D20<BR>>=3B >=<BR>> >=3BFor example=3D2C look at Upthreads.i3.<BR>>=3B >=3BMainly=3D2C look =<BR>> >at function prototypes.<BR>>=3B >=3BConstants and types are "known prob=<BR>> >lems".<BR>>=3B >=3BPrototypes are gray. They actually tend to be portab=<BR>> >le.<BR>>=3B >=3B=3D20<BR>>=3B >=3BFor example:<BR>>=3B >=3B=3D2=<BR>> >0<BR>>=3B >=3BTYPE pid_t =3D3D INTEGER=3D3B<BR>>=3B >=3B<=3B*EXTE=<BR>> >RNAL "m3_getpid*>=3B PROCEDURE getpid():pid_t=3D3B<BR>>=3B >=3B=3D20<=<BR>> >BR>>=3B >=3Bor leave it alone?<BR>>=3B >=3Bgetpid is probably the w=<BR>> >orst example.<BR>>=3B >=3BIt is so very portable declared in Modula-3.<=<BR>> >BR>>=3B >=3BBut still=3D2C imagine pid_t might be 16bits or 32 or 64.<B=<BR>> >R>>=3B >=3BWriting a wrapper is more portable -- as long as the pid isn=<BR>> >'t stuff into s=3D<BR>>=3B >=3Bome record that the system defines.<BR>&=<BR>> >gt=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>>=3B >=3BAgain=3D2C Upthread=<BR>> >s.i3.<BR>>=3B >=3BWould you like to see it reduced=3D2C or left alone?<=<BR>> >BR>>=3B >=3BOnly deal with the types and initializers=3D2C or also the =<BR>> >prototypes?<BR>>=3B >=3BYou know=3D2C I could write a little portable l=<BR>> >ayer=3D2C where all the types ar=3D<BR>>=3B >=3Be pointers=3D2C always =<BR>> >null initialized.<BR>>=3B >=3BIt would buy /some/ portability=3D2C and =<BR>> >cost some.<BR>>=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>>=3B >=3BDo y=<BR>> >ou like the sem_t change? Partly? Not at all?<BR>>=3B >=3BThere is one =<BR>> >sem_t in the system. So I moved it to be in C code.<BR>>=3B >=3BOr=3D2C=<BR>> > as I had it before=3D2C declared as the max size/align of all the platf=3D=<BR>> ><BR>>=3B >=3Borms -- getting that right is the same work as getting it =<BR>> >right "the old wa=3D<BR>>=3B >=3By"=3D2C except if you make a mistake=<BR>> >=3D2C odds are still good of it being ok.<BR>>=3B >=3B=3D20<BR>>=3B &=<BR>> >gt=3B=3D20<BR>>=3B >=3BShould the line be drawn at generating the remai=<BR>> >ning headers=3D2C rather than=3D<BR>>=3B >=3B eliminating them?<BR>>=<BR>> >=3B >=3BUerror.i3 is easily generated. Good enough?<BR>>=3B >=3B=3D20=<BR>> ><BR>>=3B >=3BUpthread.i3's types can be generated generally as records =<BR>> >with opaque array=3D<BR>>=3B >=3Bs with the right size and alignment.<B=<BR>> >R>>=3B >=3B=3D20<BR>>=3B >=3BOther stuff can be generated or at lea=<BR>> >st checked.<BR>>=3B >=3Be.g. to check that getpid is declared correctly=<BR>> >=3D2C you can assign it to a f=3D<BR>>=3B >=3Bunction pointer and see i=<BR>> >f that compiles.<BR>>=3B >=3B=3D20<BR>>=3B >=3BPerf on Uerror argua=<BR>> >bly doesn't matter.<BR>>=3B >=3BIs it only error handling code?Or do so=<BR>> >ckets often go down "error" paths=3D2C=3D<BR>>=3B >=3B because they are=<BR>> > slow and you are waiting for more data?<BR>>=3B >=3B=3D20<BR>>=3B &g=<BR>> >t=3BAnyway=3D2C point is=3D2C I agree for sure this is valuable=3D2C but I =<BR>> >might be h=3D<BR>>=3B >=3Bitting the "tail" of the approach and should =<BR>> >switch=3D2C I'm not sure. I keep=3D<BR>>=3B >=3B saying that though=3D2=<BR>> >C and then press further.<BR>>=3B >=3B=3D20<BR>>=3B >=3B=3D20<BR>&g=<BR>> >t=3B >=3B - Jay<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=<BR>> >=3B >=3BFrom: hosking@cs.purdue.eduTo: jay.krell@cornell.eduDate: Mon=3D2=<BR>> >C 12 Jan 200=3D<BR>>=3B >=3B9 19:24:50 +1100CC: m3devel@elegosoft.comSu=<BR>> >bject: Re: [M3devel] declaring a=3D<BR>>=3B >=3B type's existance but n=<BR>> >ot enough to instantiate it?<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B &g=<BR>> >t=3BPoint taken. We live in a C universe and so need to interact. I do thin=<BR>> >k =3D<BR>>=3B >=3Byour work with the headers is useful=3D2C and I want =<BR>> >it to continue. Especia=3D<BR>>=3B >=3Blly in simplifying ports.<BR>>=<BR>> >=3B >=3B<BR>>=3B >=3B<BR>>=3B >=3BOn 12 Jan 2009=3D2C at 19:18=3D=<BR>> >2C Jay wrote:<BR>>=3B >=3B<BR>>=3B >=3BI don't think a development =<BR>> >system without C headers is interesting.. Is it=3D<BR>>=3B >=3B really?=<BR>> > The transform I apply at times is wherever there is interaction wi=3D<BR>&=<BR>> >gt=3B >=3Bth C code that is described by system-dependent headers=3D2C or=<BR>> > perhaps even =3D<BR>>=3B >=3Bfairly system-independent headers outside=<BR>> > the Modula-3 tree=3D2C either write=3D<BR>>=3B >=3B wrapper functions =<BR>> >for the functionality in the headers (e.g. stat=3D2C waitp=3D<BR>>=3B >=<BR>> >=3Bid)=3D2C which can be done in a system-independent way=3D2C or move the =<BR>> >Modula-=3D<BR>>=3B >=3B3<=3B->=3BC transition higher=3D2C which is =<BR>> >also usually system-independent=3D2C e.g.=3D<BR>>=3B >=3B ThreadPThread=<BR>> >C_SetupHandlers. It is either that or clone the headers=3D2C wh=3D<BR>>=<BR>> >=3B >=3Bich seems like the worse evil. There is always going to be a Modu=<BR>> >la-3<=3B->=3BC t=3D<BR>>=3B >=3Bransition=3D2C it is just a matter =<BR>> >of where it occurs. - Jay<BR>>=3B >=3B<BR>>=3B >=3BCC: m3devel@eleg=<BR>> >osoft.comFrom: hosking@cs.purdue.eduTo: jay.krell@cornell.e=3D<BR>>=3B &g=<BR>> >t=3BduSubject: Re: [M3devel] declaring a type's existance but not enough to=<BR>> > ins=3D<BR>>=3B >=3Btantiate it?Date: Mon=3D2C 12 Jan 2009 12:32:15 +11=<BR>> >00<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B >=3BJay=3D2C I really thin=<BR>> >k you are bending over backwards too far just to be abl=3D<BR>>=3B >=3B=<BR>> >e to shoe-horn things into C. I *like* having the transpar of C header fil=<BR>> >=3D<BR>>=3B >=3Bes expressed in Modula-3=3D2C *particularly* for system=<BR>> > calls=3D2C where you mi=3D<BR>>=3B >=3Bght even be trying to build on =<BR>> >a system that does not have the C header fil=3D<BR>>=3B >=3Bes installe=<BR>> >d=3D2C even though the libraries exist and can be linked to. Fund=3D<BR>>=<BR>> >=3B >=3Bamentally=3D2C I think anytime the Modula-3 code is made less tra=<BR>> >nsparent you=3D<BR>>=3B >=3B should think hard about what you are doing=<BR>> >. The same with the change of c=3D<BR>>=3B >=3Bonstants to variables.<B=<BR>> >R>>=3B >=3B<BR>>=3B >=3BI am getting very nervous that the changes =<BR>> >you are making are destroying th=3D<BR>>=3B >=3Be clarity of the Modula=<BR>> >-3 run-time code.<BR>>=3B >=3B<BR>>=3B >=3BIn this particular case=<BR>> >=3D2C you are wanting to use a Modula-3 parameter pass=3D<BR>>=3B >=3Bi=<BR>> >ng mechanism on something that is not declared in Modula-3. Seems kind of=<BR>> >=3D<BR>>=3B >=3B dubious to me. Also=3D2C I really don't like the idea =<BR>> >of accessing external=3D<BR>>=3B >=3B variables in C.<BR>>=3B >=3B<=<BR>> >BR>>=3B >=3B-- Tony<BR>>=3B >=3B<BR>>=3B >=3BOn 12 Jan 2009=3D2=<BR>> >C at 11:55=3D2C Jay wrote:<BR>>=3B >=3B<BR>>=3B >=3BI considered AD=<BR>> >DRESS.However I think it still doesn't satisfy. I want to be=3D<BR>>=3B &=<BR>> >gt=3B able to do this: TYPE Foo_t =3D3D something=3D3B<=3B* EXTERNAL *>=<BR>> >=3B VAR Foo1=3D2C Foo=3D<BR>>=3B >=3B2:Foo_t=3D3B<=3B* EXTERNAL *>=<BR>> >=3B PROCEDURE UseFoo(READONLY (* or VAR *) foo:Foo_t)=3D<BR>>=3B >=3B=<BR>> >=3D3B (* Modula-3=3D2C not external *)PROCEDURE x()=3D3DBEGIN UseFoo(Foo1)=<BR>> >=3D3B U=3D<BR>>=3B >=3BseFoo(Foo2)=3D3BEND x=3D3B AND I want any use of=<BR>> >:VAR Foo3:Foo3_t=3D3B (* Modula-3=3D<BR>>=3B >=3B=3D2C not external *)t=<BR>> >o error. This is sem_t and sigset_t in particular. Poss=3D<BR>>=3B >=3B=<BR>> >ibly renaming is the thing.They used to be declared in Modula-3=3D2C system=<BR>> >-d=3D<BR>>=3B >=3Bependently=3D2C butI moved them to portable C. I coul=<BR>> >d remove the types entir=3D<BR>>=3B >=3Bely and change UseFoo to take a=<BR>> >n address=3D2Cand declare mask and ackSem to b=3D<BR>>=3B >=3Be integer=<BR>> >s or I guess.<=3B*EXTERNAL>=3B VAR ackSem : RECORD END=3D3B That would =<BR>> >sat=3D<BR>>=3B >=3Bisfy but I thought it might be nicer to still provid=<BR>> >e the namedtypes to ref=3D<BR>>=3B >=3Ber to the external variables. - =<BR>> >Jay<BR>>=3B >=3B<BR>>=3B >=3BFrom: hosking@cs.purdue.eduTo: jay.kre=<BR>> >ll@cornell.eduDate: Mon=3D2C 12 Jan 200=3D<BR>>=3B >=3B9 11:13:00 +1100=<BR>> >CC: m3devel@elegosoft.comSubject: Re: [M3devel] declaring a=3D<BR>>=3B &g=<BR>> >t=3B type's existance but not enough to instantiate it?What's wrong with us=<BR>> >ing =3D<BR>>=3B >=3BADDRESS for references to opaque values? If sigset_=<BR>> >t is never instantiated=3D<BR>>=3B >=3B in Modula-3=3D2C then why do yo=<BR>> >u need it declared there?<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B >=<BR>> >=3B<BR>>=3B >=3BAntony Hosking | Associate Professor | Computer Science=<BR>> > | Purdue University<BR>>=3B >=3B305 N. University Street | West Lafaye=<BR>> >tte | IN 47907 | USA<BR>>=3B >=3BOffice +1 765 494 6001 | Mobile +1 765=<BR>> > 427 5484<BR>>=3B >=3B<BR>>=3B >=3B<BR>>=3B >=3BOn 12 Jan 2009=<BR>> >=3D2C at 01:44=3D2C Jay wrote:<BR>>=3B >=3B<BR>>=3B >=3BIs there a =<BR>> >way in Modula-3 to declare that a type exists=3D2C and there are <=3B=3D<=<BR>> >BR>>=3B >=3B*external*>=3B instances of it=3D2C without "fully" decla=<BR>> >ring it=3D2C so that no M=3D<BR>>=3B >=3Bodula-3 can instantiate it? I =<BR>> >have done this for sigset_t and sem_t=3D2C but =3D<BR>>=3B >=3Bthey cou=<BR>> >ld erroneously be instantiated by Modula-3 and I'd like to remove t=3D<BR>&=<BR>> >gt=3B >=3Bhat ability to mess up so easily. (* This type is not declared =<BR>> >correctly. I=3D<BR>>=3B >=3Bt is only instantiated in C code. *) sigset=<BR>> >_t =3D3D RECORD END=3D3B(* This typ=3D<BR>>=3B >=3Be is not declared co=<BR>> >rrectly. It is only instantiated in C code. *) sem_t =3D<BR>>=3B >=3B=<BR>> >=3D3D RECORD END=3D3BIn C I believe you can do this=3D2C like: typedef stru=<BR>> >ct fo=3D<BR>>=3B >=3Bo foo_t=3D3B extern foo_t foo=3D3B void UseFoo(foo=<BR>> >_t*)=3D3B foo_t* GetFoo=3D<BR>>=3B >=3B(void)=3D3B Thanks=3D2C - Jay=3D=<BR>> ><BR>>=3B >=3B<BR>>=3B >=3B--_6117a048-9185-4c03-badb-ef8f93402268_<=<BR>> >BR>>=3B >=3BContent-Type: text/html=3B charset=3D"iso-8859-1"<BR>>=3B=<BR>> > >=3BContent-Transfer-Encoding: quoted-printable<BR>>=3B >=3B<BR>>=<BR>> >=3B >=3B<=3Bhtml>=3B<BR>>=3B >=3B<=3Bhead>=3B<BR>>=3B >=<BR>> >=3B<=3Bstyle>=3B<BR>>=3B >=3B.hmmessage P<BR>>=3B >=3B{<BR>>=<BR>> >=3B >=3Bmargin:0px=3D3B<BR>>=3B >=3Bpadding:0px<BR>>=3B >=3B}<BR>=<BR>> >>=3B >=3Bbody.hmmessage<BR>>=3B >=3B{<BR>>=3B >=3Bfont-size: 10=<BR>> >pt=3D3B<BR>>=3B >=3Bfont-family:Verdana<BR>>=3B >=3B}<BR>>=3B >=<BR>> >=3B<=3B/style>=3B<BR>>=3B >=3B<=3B/head>=3B<BR>>=3B >=3B<=<BR>> >=3Bbody class=3D3D'hmmessage'>=3B<BR>>=3B >=3BThis is what you "have =<BR>> >to" chose between.<=3BBR>=3B<BR>>=3B >=3BHeader cloning or C code (=<BR>> >and C headers).<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=<BR>> >=3B<BR>>=3B >=3BCONST or VAR (or functions?)<=3BBR>=3B<BR>>=3B &g=<BR>> >t=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3BI'm going to likely make=<BR>> > the Uerror change tonight.<=3BBR>=3B<BR>>=3B >=3BYou can still vet=<BR>> >o it (er=3D2C vote against it :) )<=3BBR>=3B<BR>>=3B >=3B&=3Bnbs=<BR>> >p=3D3B<=3BBR>=3B<BR>>=3B >=3BPossibly some convuluted C (enum/#unde=<BR>> >f)=3D2C or splitting the Modula-3<=3BBR>=3B<BR>>=3B >=3Bat boundari=<BR>> >es that weren't previously believed "natural".<=3BBR>=3B<BR>>=3B >=<BR>> >=3B(See how SetupHandlers is ~two lines in Modula-3 and the rest in C=3D3B&=<BR>> >lt=3BBR>=3B<BR>>=3B >=3Bthis is partly out of ignorance. I don't know=<BR>> > how to write those<=3BBR>=3B<BR>>=3B >=3Btwo lines in C=3D3B and l=<BR>> >aziness=3D2C I didn't look into how).<=3BBR>=3B<BR>>=3B >=3B&=3B=<BR>> >nbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>&=<BR>> >gt=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3BRemember I'm sti=<BR>> >ll staying away from mainstream platforms=3D2C<=3BBR>=3B<BR>>=3B >=<BR>> >=3Bso the value isn't what it might appear to be=3D2C but it is "stage sett=<BR>> >ing"=3D<BR>>=3B >=3B=3D2C<=3BBR>=3B<BR>>=3B >=3Band the show mi=<BR>> >ght go on. :)<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<=<BR>> >BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3BAlso=3D2C th=<BR>> >e dilemna does get more difficult now=3D2C with the little C header=3D<BR>&=<BR>> >gt=3B >=3B cloning that remains.<=3BBR>=3B<BR>>=3B >=3B&=3Bnbs=<BR>> >p=3D3B<=3BBR>=3B<BR>>=3B >=3BFor example=3D2C look at Upthreads.i3.=<BR>> ><=3BBR>=3B<BR>>=3B >=3BMainly=3D2C look at function prototypes.<=<BR>> >=3BBR>=3B<BR>>=3B >=3BConstants and types are "known problems".<=3B=<BR>> >BR>=3B<BR>>=3B >=3BPrototypes are gray. They actually tend to be port=<BR>> >able.<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=<BR>> >=3B >=3BFor example:<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3B=<BR>> >BR>=3B<BR>>=3B >=3BTYPE pid_t =3D3D INTEGER=3D3B<=3BBR>=3B<BR>>=<BR>> >=3B >=3B&=3Blt=3D3B*EXTERNAL "m3_getpid*&=3Bgt=3D3B PROCEDURE getpi=<BR>> >d():pid_t=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B=<BR>> ><BR>>=3B >=3Bor leave it alone?<=3BBR>=3B<BR>>=3B >=3Bgetpid is=<BR>> > probably the worst example.<=3BBR>=3B<BR>>=3B >=3BIt is so very po=<BR>> >rtable declared in Modula-3.<=3BBR>=3B<BR>>=3B >=3BBut still=3D2C i=<BR>> >magine pid_t might be 16bits or 32 or 64.<=3BBR>=3B<BR>>=3B >=3BWri=<BR>> >ting a wrapper is more portable -- as long as the pid isn't stuff into s=3D=<BR>> ><BR>>=3B >=3Bome record that the system defines.<=3BBR>=3B<BR>>=<BR>> >=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B&l=<BR>> >t=3BBR>=3B<BR>>=3B >=3BAgain=3D2C Upthreads.i3.<=3BBR>=3B<BR>>=<BR>> >=3B >=3BWould you like to see it reduced=3D2C or left alone?<=3BBR>=<BR>> >=3B<BR>>=3B >=3BOnly deal with the types and initializers=3D2C or also =<BR>> >the prototypes?<=3BBR>=3B<BR>>=3B >=3BYou know=3D2C I could write a=<BR>> > little portable layer=3D2C where all the types ar=3D<BR>>=3B >=3Be poi=<BR>> >nters=3D2C always null initialized.<=3BBR>=3B<BR>>=3B >=3BIt would =<BR>> >buy /some/ portability=3D2C and cost some.<=3BBR>=3B<BR>>=3B >=3B&a=<BR>> >mp=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B=<BR>> ><BR>>=3B >=3BDo you like the sem_t change? Partly? Not at all?<=3BBR&=<BR>> >gt=3B<BR>>=3B >=3BThere is one sem_t in the system. So I moved it to be=<BR>> > in C code.<=3BBR>=3B<BR>>=3B >=3BOr=3D2C as I had it before=3D2C d=<BR>> >eclared as the max size/align of all the platf=3D<BR>>=3B >=3Borms -- g=<BR>> >etting that right is the same work as getting it right "the old wa=3D<BR>&g=<BR>> >t=3B >=3By"=3D2C except if you make a mistake=3D2C odds are still good of=<BR>> > it being ok.<=3BB=3D<BR>>=3B >=3BR>=3B<BR>>=3B >=3B&=3Bnbsp=<BR>> >=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=<BR>> >=3B >=3BShould the line be drawn at generating the remaining headers=3D2C=<BR>> > rather than=3D<BR>>=3B >=3B eliminating them?<=3BBR>=3B<BR>>=3B =<BR>> >>=3BUerror.i3 is easily generated. Good enough?<=3BBR>=3B<BR>>=3B &=<BR>> >gt=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3BUpthread.i3's types can=<BR>> > be generated generally as records with opaque array=3D<BR>>=3B >=3Bs w=<BR>> >ith the right size and alignment.<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=<BR>> >=3D3B<=3BBR>=3B<BR>>=3B >=3BOther stuff can be generated or at leas=<BR>> >t checked.<=3BBR>=3B<BR>>=3B >=3Be.g. to check that getpid is decla=<BR>> >red correctly=3D2C you can assign it to a f=3D<BR>>=3B >=3Bunction poin=<BR>> >ter and see if that compiles.<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3=<BR>> >B<=3BBR>=3B<BR>>=3B >=3BPerf on Uerror arguably doesn't matter.<=<BR>> >=3BBR>=3B<BR>>=3B >=3BIs it only error handling code?<=3BBR>=3BOr=<BR>> > do sockets often go down "error" path=3D<BR>>=3B >=3Bs=3D2C because th=<BR>> >ey are slow and you are waiting for more data?<=3BBR>=3B<BR>>=3B >=<BR>> >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3BAnyway=3D2C point is=3D2C=<BR>> > I agree for sure this is valuable=3D2C but I might be h=3D<BR>>=3B >=<BR>> >=3Bitting the "tail" of the approach and should switch=3D2C I'm not sure. I=<BR>> > keep=3D<BR>>=3B >=3B saying that though=3D2C and then press further.&l=<BR>> >t=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=<BR>> >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B- Jay<=<BR>> >=3BBR>=3B<=3BBR>=3B<BR>>=3B >=3B<BR>>=3B >=3B<=3BHR id=3D3D=<BR>> >stopSpelling>=3B<BR>>=3B <=3BBR>=3B<BR>>=3B >=3BFrom: hosking@c=<BR>> >s.purdue.edu<=3BBR>=3BTo: jay.krell@cornell.edu<=3BBR>=3BDate: Mon=<BR>> >=3D2C 12=3D<BR>>=3B >=3B Jan 2009 19:24:50 +1100<=3BBR>=3BCC: m3dev=<BR>> >el@elegosoft.com<=3BBR>=3BSubject: Re: [M3de=3D<BR>>=3B >=3Bvel] de=<BR>> >claring a type's existance but not enough to instantiate it?<=3BBR>=3B&=<BR>> >lt=3BBR>=3B=3D<BR>>=3B >=3B<=3BBR>=3B<BR>>=3B >=3B<=3BDIV&g=<BR>> >t=3B<=3BSPAN class=3D3DEC_Apple-style-span style=3D3D"WORD-SPACING: 0px=<BR>> >=3D3B FONT: =3D<BR>>=3B >=3B12px Helvetica=3D3B TEXT-TRANSFORM: none=3D=<BR>> >3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-IND=3D<BR>>=3B >=3BENT: 0px=3D3B=<BR>> > WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPS=3D<BR>=<BR>> >>=3B >=3BE: separate">=3B<BR>>=3B >=3B<=3BDIV style=3D3D"WORD-W=<BR>> RAP: break-word">=3B<=3BSPAN class=3D3DEC_Apple-style-span styl=3D<BR>&=<BR>> >gt=3B >=3Be=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TR=<BR>> >ANSFORM: none=3D3B C=3D<BR>>=3B >=3BOLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-=<BR>> >INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-S=3D<BR>>=3B >=3BPACIN=<BR>> >G: normal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=3D3DEC_Appl=<BR>> >e-style-s=3D<BR>>=3B >=3Bpan style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12=<BR>> >px Helvetica=3D3B TEXT-TRANSFORM: n=3D<BR>>=3B >=3Bone=3D3B COLOR: rgb(=<BR>> >0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B =3D<BR>&=<BR>> >gt=3B >=3BLETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate">=3B<=<BR>> >=3BSPAN class=3D3DEC_Apple=3D<BR>>=3B >=3B-style-span style=3D3D"WORD-S=<BR>> >PACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRAN=3D<BR>>=3B >=3BSFO=<BR>> >RM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SP=<BR>> >ACE: no=3D<BR>>=3B >=3Brmal=3D3B LETTER-SPACING: normal=3D3B BORDER-COL=<BR>> >LAPSE: separate">=3B<=3BSPAN class=3D3D=3D<BR>>=3B >=3BEC_Apple-sty=<BR>> >le-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B T=3D<BR=<BR>> >>>=3B >=3BEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-=<BR>> >INDENT: 0px=3D3B WHITE-S=3D<BR>>=3B >=3BPACE: normal=3D3B LETTER-SPACIN=<BR>> >G: normal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN =3D<BR>>=3B >=<BR>> >=3Bclass=3D3DEC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12=<BR>> >px Helvet=3D<BR>>=3B >=3Bica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(=<BR>> >0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B=3D<BR>>=3B >=3B WHITE-SPACE: =<BR>> >normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate=3D<BR>>=<BR>> >=3B >=3B">=3B<=3BSPAN class=3D3DEC_Apple-style-span style=3D3D"WORD-S=<BR>> >PACING: 0px=3D3B FONT: 12p=3D<BR>>=3B >=3Bx Helvetica=3D3B TEXT-TRANSFO=<BR>> >RM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT=3D<BR>>=3B >=<BR>> >=3B: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-C=<BR>> >OLLAPSE: =3D<BR>>=3B >=3Bseparate">=3B<=3BSPAN class=3D3DEC_Apple-s=<BR>> >tyle-span style=3D3D"WORD-SPACING: 0px=3D3B F=3D<BR>>=3B >=3BONT: 12px =<BR>> >Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEX=<BR>> >=3D<BR>>=3B >=3BT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPAC=<BR>> >ING: normal=3D3B BORDER-CO=3D<BR>>=3B >=3BLLAPSE: separate">=3B<=3B=<BR>> >SPAN class=3D3DEC_Apple-style-span style=3D3D"WORD-SPACING: =3D<BR>>=3B &=<BR>> >gt=3B0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rg=<BR>> >b(0=3D2C0=3D2C0=3D<BR>>=3B >=3B)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE=<BR>> >: normal=3D3B LETTER-SPACING: normal=3D3B B=3D<BR>>=3B >=3BORDER-COLLAP=<BR>> >SE: separate">=3B<BR>>=3B >=3B<=3BDIV>=3BPoint taken. &=3Bnbsp=<BR>> >=3D3BWe live in a C universe and so need to interact. =3D<BR>>=3B >=3B&=<BR>> >amp=3Bnbsp=3D3BI do think your work with the headers is useful=3D2C and I w=<BR>> >ant it to=3D<BR>>=3B >=3B continue. &=3Bnbsp=3D3BEspecially in simpl=<BR>> >ifying ports.<=3B/DIV>=3B<BR>>=3B >=3B<=3BDIV>=3B<=3BBR>=3B=<BR>> ><=3B/DIV>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/S=<BR>> >PAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=<BR>> >=3B<=3B/DI=3D<BR>>=3B >=3BV>=3B<=3B/SPAN>=3B<=3B/DIV>=3B<BR=<BR>> >>>=3B >=3B<=3BDIV>=3B<BR>>=3B >=3B<=3BDIV>=3BOn 12 Jan 2009=<BR>> >=3D2C at 19:18=3D2C Jay wrote:<=3B/DIV>=3B<=3BBR class=3D3DEC_Apple-i=<BR>> >nt=3D<BR>>=3B >=3Berchange-newline>=3B<BR>>=3B >=3B<=3BBLOCKQUO=<BR>> >TE>=3B<=3BSPAN class=3D3DEC_Apple-style-span style=3D3D"WORD-SPACING: 0=<BR>> >px=3D3B=3D<BR>>=3B >=3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B T=3D<BR>>=3B >=3BEXT-INDENT: 0px=<BR>> >=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-=3D<BR>&g=<BR>> >t=3B >=3BCOLLAPSE: separate">=3B<BR>>=3B >=3B<=3BDIV class=3D3DEC=<BR>> >_hmmessage style=3D3D"FONT-SIZE: 10pt=3D3B FONT-FAMILY: Verdana"=3D<BR>>=<BR>> >=3B >=3B>=3BI don't think a development system without C headers is int=<BR>> >eresting.. Is i=3D<BR>>=3B >=3Bt really?<=3BBR>=3B&=3Bnbsp=3D3B&=<BR>> >lt=3BBR>=3BThe transform I apply at times is wherever there i=3D<BR>>=<BR>> >=3B >=3Bs interaction with C code that is described by system-dependent h=<BR>> >eaders=3D2C =3D<BR>>=3B >=3Bor perhaps even fairly system-independent h=<BR>> >eaders outside the Modula-3 tree=3D<BR>>=3B >=3B=3D2C either write wrap=<BR>> >per functions for the functionality in the headers (e.=3D<BR>>=3B >=3Bg=<BR>> >. stat=3D2C waitpid)=3D2C which&=3Bnbsp=3D3Bcan be done in a system-inde=<BR>> >pendent way=3D<BR>>=3B >=3B=3D2C&=3Bnbsp=3D3Bor move the Modula-3&am=<BR>> >p=3Blt=3D3B-&=3Bgt=3D3BC transition higher=3D2C which is=3D<BR>>=3B &g=<BR>> >t=3B also usually system-independent=3D2C e.g. ThreadPThreadC_SetupHandlers=<BR>> >.<=3BBR>=3B&=3B=3D<BR>>=3B >=3Bnbsp=3D3B<=3BBR>=3BIt is eith=<BR>> >er that or clone the headers=3D2C which seems like the w=3D<BR>>=3B >=<BR>> >=3Borse evil.<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3BThere is always go=<BR>> >ing to be a Modula-3&=3Blt=3D3B-&=3Bgt=3D<BR>>=3B >=3B=3D3BC tran=<BR>> >sition=3D2C it is just a matter of where it occurs.<=3BBR>=3B&=3Bnbs=<BR>> >p=3D3B<=3BBR>=3B&=3B=3D<BR>>=3B >=3Bnbsp=3D3B- Jay<=3BBR>=3B=<BR>> ><=3BBR>=3B<BR>>=3B >=3B<=3BHR id=3D3DEC_stopSpelling>=3B<BR>>=<BR>> >=3B >=3B<=3BBR>=3BCC:<=3BSPAN class=3D3DEC_Apple-converted-space>=<BR>> >=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BA href=3D3D"mai=3D<BR>>=3B >=<BR>> >=3Blto:m3devel@elegosoft.com">=3Bm3devel@elegosoft.com<=3B/A>=3B<=<BR>> >=3BBR>=3BFrom:<=3BSPAN class=3D3D=3D<BR>>=3B >=3BEC_Apple-converted=<BR>> >-space>=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BA href=3D3D"mailto:hoski=<BR>> >ng@cs.purdue=3D<BR>>=3B >=3B.edu">=3Bhosking@cs.purdue.edu<=3B/A>=<BR>> >=3B<=3BBR>=3BTo:<=3BSPAN class=3D3DEC_Apple-converted-spac=3D<BR>>=<BR>> >=3B >=3Be>=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BA href=3D3D"mailto:=<BR>> >jay.krell@cornell.edu">=3Bjay.krell@cornell=3D<BR>>=3B >=3B.edu<=3B=<BR>> >/A>=3B<=3BBR>=3BSubject: Re: [M3devel] declaring a type's existance b=<BR>> >ut not eno=3D<BR>>=3B >=3Bugh to instantiate it?<=3BBR>=3BDate: Mon=<BR>> >=3D2C 12 Jan 2009 12:32:15 +1100<=3BBR>=3B<=3BBR>=3B<=3BB=3D<BR>&=<BR>> >gt=3B >=3BR>=3B<BR>>=3B <=3BDIV>=3B<=3BSPAN class=3D3DEC_EC_App=<BR>> >le-style-span style=3D3D"WORD-SPACING: 0px=3D3B FON=3D<BR>>=3B >=3BT: 1=<BR>> >2px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B=<BR>> > TEXT-=3D<BR>>=3B >=3BINDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-=<BR>> >SPACING: normal=3D3B BORDER-COLL=3D<BR>>=3B >=3BAPSE: separate">=3B<B=<BR>> >R>>=3B >=3B<=3BDIV style=3D3D"WORD-WRAP: break-word">=3B<=3BSPAN =<BR>> >class=3D3DEC_EC_Apple-style-span s=3D<BR>>=3B >=3Btyle=3D3D"WORD-SPACIN=<BR>> >G: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D<BR>>=3B >=<BR>> >=3B=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: =<BR>> >normal=3D3B LET=3D<BR>>=3B >=3BTER-SPACING: normal=3D3B BORDER-COLLAPSE=<BR>> >: separate">=3B<=3BSPAN class=3D3DEC_EC_Apple=3D<BR>>=3B >=3B-style=<BR>> >-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRAN=<BR>> >=3D<BR>>=3B >=3BSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-IN=<BR>> >DENT: 0px=3D3B WHITE-SPACE: no=3D<BR>>=3B >=3Brmal=3D3B LETTER-SPACING:=<BR>> > normal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=3D3D=3D<BR>&g=<BR>> >t=3B >=3BEC_EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 1=<BR>> >2px Helvetica=3D<BR>>=3B >=3B=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb=<BR>> >(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WH=3D<BR>>=3B >=3BITE-SPACE:=<BR>> > normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate">=3B&l=<BR>> >t=3B=3D<BR>>=3B >=3BSPAN class=3D3DEC_EC_Apple-style-span style=3D3D"WO=<BR>> >RD-SPACING: 0px=3D3B FONT: 12p=3D<BR>>=3B >=3Bx Helvetica=3D3B TEXT-TRA=<BR>> >NSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT=3D<BR>>=3B &=<BR>> >gt=3B: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER=<BR>> >-COLLAPSE: =3D<BR>>=3B >=3Bseparate">=3B<=3BSPAN class=3D3DEC_EC_Ap=<BR>> >ple-style-span style=3D3D"WORD-SPACING: 0px=3D<BR>>=3B >=3B=3D3B FONT: =<BR>> >12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D<=<BR>> >BR>>=3B >=3B=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER=<BR>> >-SPACING: normal=3D3B BO=3D<BR>>=3B >=3BRDER-COLLAPSE: separate">=3B&=<BR>> >lt=3BSPAN class=3D3DEC_EC_Apple-style-span style=3D3D"WORD=3D<BR>>=3B >=<BR>> >=3B-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B C=<BR>> >OLOR: rgb=3D<BR>>=3B >=3B(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHI=<BR>> >TE-SPACE: normal=3D3B LETTER-SPACING: n=3D<BR>>=3B >=3Bormal=3D3B BORDE=<BR>> >R-COLLAPSE: separate">=3B<=3BSPAN class=3D3DEC_EC_Apple-style-span st=<BR>> >=3D<BR>>=3B >=3Byle=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D=<BR>> >3B TEXT-TRANSFORM: none=3D3B=3D<BR>>=3B >=3B COLOR: rgb(0=3D2C0=3D2C0)=<BR>> >=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER=3D<BR>>=3B &g=<BR>> >t=3B-SPACING: normal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=<BR>> >=3D3DEC_EC_Apple-st=3D<BR>>=3B >=3Byle-span style=3D3D"WORD-SPACING: 0p=<BR>> >x=3D3B FONT: 12px Helvetica=3D3B TEXT-TRANSFO=3D<BR>>=3B >=3BRM: none=<BR>> >=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: nor=<BR>> >ma=3D<BR>>=3B >=3Bl=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: s=<BR>> >eparate">=3B<BR>>=3B >=3B<=3BDIV>=3BJay=3D2C I really think you a=<BR>> >re bending over backwards too far just to b=3D<BR>>=3B >=3Be able to sh=<BR>> >oe-horn things into C. &=3Bnbsp=3D3BI *like* having the transpar of =3D<=<BR>> >BR>>=3B >=3BC header files expressed in Modula-3=3D2C *particularly* fo=<BR>> >r system calls=3D2C =3D<BR>>=3B >=3Bwhere you might even be trying to b=<BR>> >uild on a system that does not have the =3D<BR>>=3B >=3BC header files =<BR>> >installed=3D2C even though the libraries exist and can be link=3D<BR>>=3B=<BR>> > >=3Bed to. &=3Bnbsp=3D3BFundamentally=3D2C I think anytime the Modula=<BR>> >-3 code is made l=3D<BR>>=3B >=3Bess transparent you should think hard =<BR>> >about what you are doing. &=3Bnbsp=3D3BThe=3D<BR>>=3B >=3B same with=<BR>> > the change of constants to variables.<=3B/DIV>=3B<BR>>=3B >=3B<=<BR>> >=3BDIV>=3B<=3BBR>=3B<=3B/DIV>=3B<BR>>=3B >=3B<=3BDIV>=3BI=<BR>> > am getting very nervous that the changes you are making are destroyi=3D<BR=<BR>> >>>=3B >=3Bng the clarity of the Modula-3 run-time code.<=3B/DIV>=3B=<BR>> ><BR>>=3B >=3B<=3BDIV>=3B<=3BBR>=3B<=3B/DIV>=3B<BR>>=3B &g=<BR>> >t=3B<=3BDIV>=3BIn this particular case=3D2C you are wanting to use a Mo=<BR>> >dula-3 parameter=3D<BR>>=3B >=3B passing mechanism on something that is=<BR>> > not declared in Modula-3. &=3Bnbsp=3D3BS=3D<BR>>=3B >=3Beems kind o=<BR>> >f dubious to me. &=3Bnbsp=3D3BAlso=3D2C I really don't like the idea of=<BR>> >=3D<BR>>=3B >=3B accessing external variables in C.<=3B/DIV>=3B<BR>=<BR>> >>=3B >=3B<=3BDIV>=3B<=3BBR>=3B<=3B/DIV>=3B<BR>>=3B >=3B=<BR>> ><=3BDIV>=3B-- Tony<=3B/DIV>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=<BR>> >=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPA=<BR>> >N>=3B<=3B/SPAN>=3B<=3B=3D<BR>>=3B >=3B/DIV>=3B<=3B/SPAN>=<BR>> >=3B<=3B/DIV>=3B<=3BBR>=3B<BR>>=3B >=3B<=3BDIV>=3B<BR>>=3B=<BR>> > >=3B<=3BDIV>=3BOn 12 Jan 2009=3D2C at 11:55=3D2C Jay wrote:<=3B/DI=<BR>> >V>=3B<=3BBR class=3D3DEC_EC_Apple-=3D<BR>>=3B >=3Binterchange-newli=<BR>> >ne>=3B<BR>>=3B >=3B<=3BBLOCKQUOTE>=3B<=3BSPAN class=3D3DEC_EC_A=<BR>> >pple-style-span style=3D3D"WORD-SPACING: 0px=3D<BR>>=3B >=3B=3D3B FONT:=<BR>> > 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D=<BR>> ><BR>>=3B >=3B=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTE=<BR>> >R-SPACING: normal=3D3B BO=3D<BR>>=3B >=3BRDER-COLLAPSE: separate">=3B=<BR>> ><BR>>=3B >=3B<=3BDIV class=3D3DEC_EC_hmmessage style=3D3D"FONT-SIZE: =<BR>> >10pt=3D3B FONT-FAMILY: Verda=3D<BR>>=3B >=3Bna">=3BI considered ADDRE=<BR>> >SS.<=3BBR>=3BHowever I think it still doesn't satisfy.<=3BBR>=3B&am=<BR>> >p=3B=3D<BR>>=3B >=3Bnbsp=3D3B<=3BBR>=3BI want to be able to do this=<BR>> >:<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3BTYPE&=3Bnbsp=3D3BFoo_t =3D<=<BR>> >BR>>=3B >=3B=3D3D something=3D3B<=3BBR>=3B&=3Blt=3D3B* EXTERNAL =<BR>> >*&=3Bgt=3D3B VAR Foo1=3D2C Foo2:Foo_t=3D3B<=3BBR>=3B&=3B=3D<BR>&g=<BR>> >t=3B >=3Blt=3D3B* EXTERNAL *&=3Bgt=3D3B PROCEDURE&=3Bnbsp=3D3BUseFo=<BR>> >o(READONLY (* or VAR *) foo:F=3D<BR>>=3B >=3Boo_t)=3D3B<=3BBR>=3B&a=<BR>> >mp=3Bnbsp=3D3B<=3BBR>=3B(* Modula-3=3D2C not external *)<=3BBR>=3BP=<BR>> >ROCEDURE x()=3D3D<=3B=3D<BR>>=3B >=3BBR>=3BBEGIN<=3BBR>=3B&=<BR>> >=3Bnbsp=3D3B UseFoo(Foo1)=3D3B<=3BBR>=3B&=3Bnbsp=3D3B UseFoo(Foo2)=<BR>> >=3D3B<=3BBR>=3BEND x=3D<BR>>=3B >=3B=3D3B<=3BBR>=3B&=3Bnbsp=<BR>> >=3D3B<=3BBR>=3BAND I want any use of:<=3BBR>=3BVAR Foo3:Foo3_t=3D3B=<BR>> > (* Modula-3=3D<BR>>=3B >=3B=3D2C not external *)<=3BBR>=3B<=3BBR=<BR>> >>=3Bto error. This is sem_t and sigset_t in particul=3D<BR>>=3B >=3Ba=<BR>> >r.<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3BPossibly renaming is the thin=<BR>> >g.<=3BBR>=3BThey used to be decla=3D<BR>>=3B >=3Bred in Modula-3=3D=<BR>> >2C system-dependently=3D2C but<=3BBR>=3BI moved them to portable C.=3D<=<BR>> >BR>>=3B >=3B<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3BI could remove =<BR>> >the types entirely and change UseFoo to take=3D<BR>>=3B >=3B an address=<BR>> >=3D2C<=3BBR>=3Band declare mask and ackSem to be integers or I guess.&l=<BR>> >t=3BBR=3D<BR>>=3B >=3B>=3B&=3Blt=3D3B*EXTERNAL&=3Bgt=3D3B VAR a=<BR>> >ckSem&=3Bnbsp=3D3B: RECORD END=3D3B<=3BBR>=3B&=3Bnbsp=3D3B<=3BB=<BR>> >R>=3BTha=3D<BR>>=3B >=3Bt would satisfy but I thought it might be nic=<BR>> >er to still provide the named<=3B=3D<BR>>=3B >=3BBR>=3Btypes to ref=<BR>> >er to the external variables.<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3B&a=<BR>> >mp=3Bnbsp=3D3B- Jay<=3BB=3D<BR>>=3B >=3BR>=3B<=3BBR>=3B<BR>>=<BR>> >=3B >=3B<=3BHR id=3D3DEC_EC_stopSpelling>=3B<BR>>=3B >=3B<=3BBR=<BR>> >>=3BFrom:<=3BSPAN class=3D3DEC_EC_Apple-converted-space>=3B&=3Bnbs=<BR>> >p=3D3B<=3B/SPAN>=3B<=3BA href=3D<BR>>=3B >=3B=3D3D"mailto:hosking=<BR>> >@cs.purdue.edu">=3Bhosking@cs.purdue.edu<=3B/A>=3B<=3BBR>=3BTo:&l=<BR>> >t=3BSPAN cla=3D<BR>>=3B >=3Bss=3D3DEC_EC_Apple-converted-space>=3B&am=<BR>> >p=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BA href=3D3D"mailto:jay.krell=3D<BR>>=<BR>> >=3B >=3B@cornell.edu">=3Bjay.krell@cornell.edu<=3B/A>=3B<=3BBR>=<BR>> >=3BDate: Mon=3D2C 12 Jan 2009 11:13:0=3D<BR>>=3B >=3B0 +1100<=3BBR>=<BR>> >=3BCC:<=3BSPAN class=3D3DEC_EC_Apple-converted-space>=3B&=3Bnbsp=3D3=<BR>> >B<=3B/SPAN>=3B<=3BA h=3D<BR>>=3B >=3Bref=3D3D"mailto:m3devel@eleg=<BR>> >osoft.com">=3Bm3devel@elegosoft.com<=3B/A>=3B<=3BBR>=3BSubject: =<BR>> >=3D<BR>>=3B >=3BRe: [M3devel] declaring a type's existance but not enou=<BR>> >gh to instantiate it=3D<BR>>=3B >=3B?<=3BBR>=3B<=3BBR>=3BWhat's=<BR>> > wrong with using ADDRESS for references to opaque values? &=3B=3D<BR>&g=<BR>> >t=3B >=3Bnbsp=3D3BIf sigset_t is never instantiated in Modula-3=3D2C then=<BR>> > why do you nee=3D<BR>>=3B >=3Bd it declared there?<=3BBR>=3B<BR>&g=<BR>> >t=3B >=3B<=3BDIV>=3B<=3BBR>=3B<BR>>=3B >=3B<=3BDIV>=3B<=<BR>> >=3BSPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D=<BR>> >3B =3D<BR>>=3B >=3BFONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B =<BR>> >COLOR: rgb(0=3D2C0=3D2C0)=3D3B TE=3D<BR>>=3B >=3BXT-INDENT: 0px=3D3B WH=<BR>> >ITE-SPACE: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-C=3D<BR>>=3B &g=<BR>> >t=3BOLLAPSE: separate">=3B<BR>>=3B >=3B<=3BDIV style=3D3D"WORD-WRAP=<BR>> >: break-word">=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-spa=3D<BR>>=<BR>> >=3B >=3Bn style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEX=<BR>> >T-TRANSFORM: non=3D<BR>>=3B >=3Be=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B T=<BR>> >EXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LE=3D<BR>>=3B >=3BTTER-SP=<BR>> >ACING: normal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=3D3DEC_=<BR>> >EC_EC_A=3D<BR>>=3B >=3Bpple-style-span style=3D3D"WORD-SPACING: 0px=3D3=<BR>> >B FONT: 12px Helvetica=3D3B TEXT-=3D<BR>>=3B >=3BTRANSFORM: none=3D3B C=<BR>> >OLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE=3D<BR>>=<BR>> >=3B >=3B: normal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separa=<BR>> >te">=3B<=3BSPAN clas=3D<BR>>=3B >=3Bs=3D3DEC_EC_EC_Apple-style-span=<BR>> > style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helv=3D<BR>>=3B >=3Betica=<BR>> >=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT:=<BR>> > 0px=3D<BR>>=3B >=3B=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: norm=<BR>> >al=3D3B BORDER-COLLAPSE: separ=3D<BR>>=3B >=3Bate">=3B<=3BSPAN clas=<BR>> >s=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B =3D<BR>&g=<BR>> >t=3B >=3BFONT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=<BR>> >=3D2C0=3D2C0)=3D3B TE=3D<BR>>=3B >=3BXT-INDENT: 0px=3D3B WHITE-SPACE: n=<BR>> >ormal=3D3B LETTER-SPACING: normal=3D3B BORDER-C=3D<BR>>=3B >=3BOLLAPSE:=<BR>> > separate">=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"W=<BR>> >ORD-SP=3D<BR>>=3B >=3BACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-TR=<BR>> >ANSFORM: none=3D3B COLOR: rgb(0=3D<BR>>=3B >=3B=3D2C0=3D2C0)=3D3B TEXT-=<BR>> >INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: nor=3D<BR>>=3B =<BR>> >>=3Bmal=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=3D3DEC_EC_E=<BR>> >C_Apple-style-span s=3D<BR>>=3B >=3Btyle=3D3D"WORD-SPACING: 0px=3D3B FO=<BR>> >NT: 12px Helvetica=3D3B TEXT-TRANSFORM: none=3D<BR>>=3B >=3B=3D3B COLOR=<BR>> >: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LE=<BR>> >T=3D<BR>>=3B >=3BTER-SPACING: normal=3D3B BORDER-COLLAPSE: separate">=<BR>> >=3B<=3BSPAN class=3D3DEC_EC_EC_Ap=3D<BR>>=3B >=3Bple-style-span style=<BR>> >=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px Helvetica=3D3B TEXT-T=3D<BR>>=3B =<BR>> >>=3BRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=<BR>> >=3D3B WHITE-SPACE:=3D<BR>>=3B >=3B normal=3D3B LETTER-SPACING: normal=<BR>> >=3D3B BORDER-COLLAPSE: separate">=3B<=3BSPAN class=3D<BR>>=3B >=3B=<BR>> >=3D3DEC_EC_EC_Apple-style-span style=3D3D"WORD-SPACING: 0px=3D3B FONT: 12px=<BR>> > Helve=3D<BR>>=3B >=3Btica=3D3B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=<BR>> >=3D2C0=3D2C0)=3D3B TEXT-INDENT: 0px=3D<BR>>=3B >=3B=3D3B WHITE-SPACE: n=<BR>> >ormal=3D3B LETTER-SPACING: normal=3D3B BORDER-COLLAPSE: separ=3D<BR>>=3B =<BR>> >>=3Bate">=3B<BR>>=3B >=3B<=3BDIV>=3B<=3BFONT class=3D3DEC_EC_=<BR>> >EC_Apple-style-span color=3D3D#0000ff>=3B<=3BFONT class=3D3D=3D<BR>>=<BR>> >=3B >=3BEC_EC_EC_Apple-style-span face=3D3D"Gill Sans">=3B<=3BSPAN cl=<BR>> >ass=3D3DEC_EC_EC_Apple-s=3D<BR>>=3B >=3Btyle-span style=3D3D"COLOR: rgb=<BR>> >(0=3D2C0=3D2C255)=3D3B FONT-FAMILY: 'Gill Sans'">=3B<=3BSP=3D<BR>>=3B=<BR>> > >=3BAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"COLOR: rgb(0=3D2C0=<BR>> >=3D2C255)=3D3B FO=3D<BR>>=3B >=3BNT-FAMILY: 'Gill Sans'">=3BAntony Ho=<BR>> >sking<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/FONT>=3B<=3B/FONT>=3B&l=<BR>> >t=3BFONT cla=3D<BR>>=3B >=3Bss=3D3DEC_EC_EC_Apple-style-span face=3D3D"=<BR>> >Gill Sans">=3B<=3BSPAN class=3D3DEC_EC_EC_Ap=3D<BR>>=3B >=3Bple-sty=<BR>> >le-span style=3D3D"FONT-FAMILY: 'Gill Sans'">=3B<=3BSPAN class=3D3DEC_E=<BR>> >C_EC_Ap=3D<BR>>=3B >=3Bple-style-span style=3D3D"FONT-FAMILY: 'Gill San=<BR>> >s'">=3B<=3BSPAN class=3D3DEC_EC_Apple=3D<BR>>=3B >=3B-converted-spa=<BR>> >ce>=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B|<=3BSPAN class=3D3DEC_EC_Apple-=<BR>> >converted-space>=3B=3D<BR>>=3B >=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B&=<BR>> >lt=3B/SPAN>=3B<=3B/SPAN>=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-=<BR>> >span style=3D<BR>>=3B >=3B=3D3D"FONT-FAMILY: 'Gill Sans'">=3B<=3BSP=<BR>> >AN class=3D3DEC_EC_EC_Apple-style-span style=3D<BR>>=3B >=3B=3D3D"FONT-=<BR>> >FAMILY: 'Gill Sans'">=3BAssociate Professor<=3B/SPAN>=3B<=3B/SPAN&g=<BR>> >t=3B<=3BSPAN class=3D<BR>>=3B >=3B=3D3DEC_EC_EC_Apple-style-span styl=<BR>> >e=3D3D"FONT-FAMILY: 'Gill Sans'">=3B<=3BSPAN class=3D<BR>>=3B >=3B=<BR>> >=3D3DEC_EC_EC_Apple-style-span style=3D3D"FONT-FAMILY: 'Gill Sans'">=3B&a=<BR>> >mp=3Bnbsp=3D3B| C=3D<BR>>=3B >=3Bomputer Science | Purdue University<=<BR>> >=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/FONT>=3B<=3B/DIV>=3B<BR>>=3B =<BR>> >>=3B<=3BDIV>=3B<=3BFONT class=3D3DEC_EC_EC_Apple-style-span face=3D=<BR>> >3DGillSans-Light>=3B<=3BSPAN cl=3D<BR>>=3B >=3Bass=3D3DEC_EC_EC_App=<BR>> >le-style-span style=3D3D"FONT-FAMILY: GillSans-Light">=3B305 N=3D<BR>>=<BR>> >=3B >=3B. University Street | West Lafayette | IN 47907 | USA<=3B/SPAN&=<BR>> >gt=3B<=3B/FONT>=3B<=3B/DIV>=3B<BR>>=3B >=3B<=3BDIV>=3B<=<BR>> >=3BFONT class=3D3DEC_EC_EC_Apple-style-span face=3D3D"Gill Sans" color=3D3D=<BR>> >#00=3D<BR>>=3B >=3B00ff>=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-=<BR>> >span style=3D3D"COLOR: rgb(0=3D2C0=3D2C25=3D<BR>>=3B >=3B5)=3D3B FONT-F=<BR>> >AMILY: 'Gill Sans'">=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-span sty=<BR>> >=3D<BR>>=3B >=3Ble=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=3D3B FONT-FAMILY: '=<BR>> >Gill Sans'">=3BOffice<=3B/SPAN>=3B<=3B/S=3D<BR>>=3B >=3BPAN>=<BR>> >=3B<=3B/FONT>=3B<=3BFONT class=3D3DEC_EC_EC_Apple-style-span face=3D3=<BR>> >DGillSans-Light>=3B<=3BS=3D<BR>>=3B >=3BPAN class=3D3DEC_EC_EC_Appl=<BR>> >e-style-span style=3D3D"FONT-FAMILY: GillSans-Light"=3D<BR>>=3B >=3B>=<BR>> >=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-span style=3D3D"FONT-FAMILY: G=<BR>> >illSans-Lig=3D<BR>>=3B >=3Bht">=3B&=3Bnbsp=3D3B+1 765 494 6001 |&l=<BR>> >t=3BSPAN class=3D3DEC_EC_Apple-converted-space>=3B&=3Bnbs=3D<BR>>=3B=<BR>> > >=3Bp=3D3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/FONT=<BR>> >>=3B<=3BFONT class=3D3DEC_EC_EC_Apple-style-span fac=3D<BR>>=3B >=<BR>> >=3Be=3D3D"Gill Sans" color=3D3D#0000ff>=3B<=3BSPAN class=3D3DEC_EC_EC_A=<BR>> >pple-style-span sty=3D<BR>>=3B >=3Ble=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=<BR>> >=3D3B FONT-FAMILY: 'Gill Sans'">=3B<=3BSPAN class=3D3DEC=3D<BR>>=3B &=<BR>> >gt=3B_EC_EC_Apple-style-span style=3D3D"COLOR: rgb(0=3D2C0=3D2C255)=3D3B FO=<BR>> >NT-FAMILY: 'G=3D<BR>>=3B >=3Bill Sans'">=3BMobile<=3B/SPAN>=3B<=<BR>> >=3B/SPAN>=3B<=3B/FONT>=3B<=3BFONT class=3D3DEC_EC_EC_Apple-style-sp=<BR>> >=3D<BR>>=3B >=3Ban face=3D3DGillSans-Light>=3B<=3BSPAN class=3D3DEC=<BR>> >_EC_EC_Apple-style-span style=3D3D"F=3D<BR>>=3B >=3BONT-FAMILY: GillSan=<BR>> >s-Light">=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-span style=3D<BR>&g=<BR>> >t=3B >=3B=3D3D"FONT-FAMILY: GillSans-Light">=3B<=3BSPAN class=3D3DEC_=<BR>> >EC_Apple-converted-space>=3B=3D<BR>>=3B >=3B&=3Bnbsp=3D3B<=3B/SP=<BR>> >AN>=3B+1 765 427 5484<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/FONT>=3B&=<BR>> >lt=3B/DIV>=3B<BR>>=3B >=3B<=3BDIV>=3B<=3BFONT class=3D3DEC_EC_E=<BR>> >C_Apple-style-span face=3D3DGillSans-Light>=3B<=3BBR clas=3D<BR>>=3B =<BR>> >>=3Bs=3D3DEC_EC_EC_khtml-block-placeholder>=3B<=3B/FONT>=3B<=3B/D=<BR>> >IV>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SP=3D<BR>=<BR>> >>=3B >=3BAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=3B/SPAN>=3B<=<BR>> >=3BBR class=3D3DEC_EC_EC_Apple-interchange-newline>=3B<=3B/SP=3D<BR>>=<BR>> >=3B >=3BAN>=3B<=3B/DIV>=3B<=3B/SPAN>=3B<=3B/DIV>=3B<=3BBR=<BR>> >>=3B<BR>>=3B >=3B<=3BDIV>=3B<BR>>=3B >=3B<=3BDIV>=3BOn 12=<BR>> > Jan 2009=3D2C at 01:44=3D2C Jay wrote:<=3B/DIV>=3B<=3BBR class=3D3DE=<BR>> >C_EC_EC_App=3D<BR>>=3B >=3Ble-interchange-newline>=3B<BR>>=3B >=<BR>> >=3B<=3BBLOCKQUOTE>=3B<=3BSPAN class=3D3DEC_EC_EC_Apple-style-span sty=<BR>> >le=3D3D"WORD-SPACING: =3D<BR>>=3B >=3B0px=3D3B FONT: 12px Helvetica=3D3=<BR>> >B TEXT-TRANSFORM: none=3D3B COLOR: rgb(0=3D2C0=3D2C0=3D<BR>>=3B >=3B)=<BR>> >=3D3B TEXT-INDENT: 0px=3D3B WHITE-SPACE: normal=3D3B LETTER-SPACING: normal=<BR>> >=3D3B B=3D<BR>>=3B >=3BORDER-COLLAPSE: separate">=3B<BR>>=3B >=3B=<BR>> ><=3BDIV class=3D3DEC_EC_EC_hmmessage style=3D3D"FONT-SIZE: 10pt=3D3B FONT=<BR>> >-FAMILY: Ve=3D<BR>>=3B >=3Brdana">=3BIs there a way in Modula-3 to de=<BR>> >clare that&=3Bnbsp=3D3Ba type exists=3D2C a=3D<BR>>=3B >=3Bnd there =<BR>> >are &=3Blt=3D3B*external*&=3Bgt=3D3B instances of it=3D2C without "fu=<BR>> >lly" decl=3D<BR>>=3B >=3Baring it=3D2C so that no Modula-3 can instanti=<BR>> >ate it?<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR>=3BI have d=3D<BR>>=3B &g=<BR>> >t=3Bone this for sigset_t and sem_t=3D2C but they could erroneously be inst=<BR>> >antiat=3D<BR>>=3B >=3Bed by Modula-3 and I'd like to remove that abilit=<BR>> >y to mess up so easily.<=3BBR=3D<BR>>=3B >=3B>=3B&=3Bnbsp=3D3B&l=<BR>> >t=3BBR>=3B(* This type is not declared correctly. It is only instantiate=<BR>> >=3D<BR>>=3B >=3Bd in C code. *)<=3BBR>=3B&=3Bnbsp=3D3B sigset_t =<BR>> >=3D3D RECORD END=3D3B<=3BBR>=3B<=3BBR>=3B(* This type =3D<BR>>=3B=<BR>> > >=3Bis not declared correctly. It is only instantiated in C code. *)<=<BR>> >=3BBR>=3B&=3Bnbsp=3D<BR>>=3B >=3B=3D3B sem_t =3D3D RECORD END=3D3B=<BR>> ><=3BBR>=3B<=3BBR>=3BIn C I believe you can do this=3D2C like:<=3B=<BR>> >=3D<BR>>=3B >=3BBR>=3B&=3Bnbsp=3D3B&=3Bnbsp=3D3Btypedef struct =<BR>> >foo foo_t=3D3B&=3Bnbsp=3D3B<=3BSPAN class=3D3DEC_EC_E=3D<BR>>=3B >=<BR>> >=3BC_Apple-converted-space>=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BBR&g=<BR>> >t=3B&=3Bnbsp=3D3B&=3Bnbsp=3D3Bextern foo_t foo=3D<BR>>=3B >=3B=3D=<BR>> >3B&=3Bnbsp=3D3B<=3BSPAN class=3D3DEC_EC_EC_Apple-converted-space>=3B=<BR>> >&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BBR>=3B=3D<BR>>=3B >=3B&=3Bn=<BR>> >bsp=3D3B<=3BBR>=3B&=3Bnbsp=3D3Bvoid UseFoo(foo_t*)=3D3B<=3BSPAN cl=<BR>> >ass=3D3DEC_EC_EC_Apple-conv=3D<BR>>=3B >=3Berted-space>=3B&=3Bnbsp=<BR>> >=3D3B<=3B/SPAN>=3B<=3BBR>=3B&=3Bnbsp=3D3B foo_t* GetFoo(void)=3D=<BR>> >3B<=3BSPAN class=3D<BR>>=3B >=3B=3D3DEC_EC_EC_Apple-converted-space&g=<BR>> >t=3B&=3Bnbsp=3D3B<=3B/SPAN>=3B<=3BBR>=3B&=3Bnbsp=3D3B<=3BBR=<BR>> >>=3BThanks=3D2C<=3B=3D<BR>>=3B >=3BBR>=3B&=3Bnbsp=3D3B- Jay<=<BR>> >=3BBR>=3B<=3BBR>=3B<=3BBR>=3B<=3BBR>=3B<=3B/DIV>=3B<=3B=<BR>> >/SPAN>=3B<=3B/BLOCKQUOTE>=3B<=3B/DIV>=3B<=3BBR>=3B<=3B/DIV&=<BR>> >gt=3B<=3B=3D<BR>>=3B >=3B/DIV>=3B<=3B/SPAN>=3B<=3BBR class=3D=<BR>> >3DEC_EC_Apple-interchange-newline>=3B<=3B/BLOCKQUOTE>=3B<=3B/DIV>=<BR>> >=3B=3D<BR>>=3B >=3B<=3BBR>=3B<=3B/DIV>=3B<=3B/SPAN>=3B<=<BR>> >=3BBR class=3D3DEC_Apple-interchange-newline>=3B<=3B/BLOCKQUOTE>=3B&l=<BR>> >t=3B/DI=3D<BR>>=3B >=3BV>=3B<=3BBR>=3B<=3B/body>=3B<BR>>=3B=<BR>> > >=3B<=3B/html>=3B=3D<BR>>=3B >=3B<BR>>=3B >=3B--_6117a048-91=<BR>> >85-4c03-badb-ef8f93402268_--<BR><BR></body><BR>> ></html>=<BR>> ><BR>> >--_2e194b09-14b6-4301-9116-a9e4d1e522b4_--<BR><BR></body>
</html>