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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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-7-bit Path: g2news1.google.com!news3.google.com!feeder2.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Breaking a circularity Date: Mon, 28 Mar 2011 22:01:24 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <5aac3e2d-a382-479e-90a3-8acd846ca204@o21g2000prh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1301367686 3384 69.95.181.76 (29 Mar 2011 03:01:26 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 29 Mar 2011 03:01:26 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Xref: g2news1.google.com comp.lang.ada:18566 Date: 2011-03-28T22:01:24-05:00 List-Id: "Gene" wrote in message news:f22049a1-0983-4c22-ba94-b5da81aaba88@s9g2000yqm.googlegroups.com... On Mar 28, 7:37 am, Simon Wright wrote: >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.) The way we handled this problem in Claw was to make State an abstract tagged type (rather than using a generic). Then, the parameter to the Handle call can be class-wide, which allows it to access any extension of the type. I suspect that this also breaks the circularity (since the State type doesn't need to be defined until much later), but I haven't tried to figure it out. Randy.