From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2fa4069595cb9ef7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!s9g2000yqm.googlegroups.com!not-for-mail From: Gene Newsgroups: comp.lang.ada Subject: Re: Breaking a circularity Date: Mon, 28 Mar 2011 15:38:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5aac3e2d-a382-479e-90a3-8acd846ca204@o21g2000prh.googlegroups.com> NNTP-Posting-Host: 134.240.241.2 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1301351905 2310 127.0.0.1 (28 Mar 2011 22:38:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Mar 2011 22:38:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000yqm.googlegroups.com; posting-host=134.240.241.2; posting-account=-BkjswoAAACC3NU8b6V8c50JQ2JBOs04 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.2; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18559 Date: 2011-03-28T15:38:25-07:00 List-Id: On Mar 28, 7:37=A0am, Simon Wright wrote: > Ludovic Brenta writes: > > BTW, why does Event_Type have to be limited? If it weren't limited, > > you would not need Event_Ptr_Type. =A0Also, why does it have to be > > abstract? > > When I made my events limited, it was because any two events are > different. In this case, we have > > =A0 =A0type Event_Type is abstract record > =A0 =A0 =A0 Id : Positive; > =A0 =A0 =A0 Time : Time_Type; > =A0 =A0end record; > > so it probably won't make any sense for an Event to be copyable (what > would Id be in the copy?). Of course the events could be privately > nonlimited. Yes. > > I do wonder what Id is _for_. For tracing simulations. They're consecutive in temporal order. > > You'll certainly need pointers somewhere, because Event_Type instances > have to be held in the Queue. Indefinite_Ordered_Sets might do the > trick, though. It would save the bother of having Handle deallocate the > Event. Yes and no. The only reason for making Event_Queue generic is so that a State can be passed through the dispatching Handle call. Since this is an "in out" parameter that's invariably a record type, it's being passed by pointer behind the scenes. Yet there doesn't seem to be a way to take advantage of *this* pointer for breaking the circularity. (In (eeewwww) C we could use a void* or other pointer trick here.) E.g. if there were a generic parameter type for "access to incompletely declared type," we could pull it off by making Event_Queue generic in this way.