From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Breaking a circularity
Date: Mon, 28 Mar 2011 22:01:24 -0500
Date: 2011-03-28T22:01:24-05:00 [thread overview]
Message-ID: <imri26$39o$1@munin.nbi.dk> (raw)
In-Reply-To: f22049a1-0983-4c22-ba94-b5da81aaba88@s9g2000yqm.googlegroups.com
"Gene" <gene.ressler@gmail.com> wrote in message
news:f22049a1-0983-4c22-ba94-b5da81aaba88@s9g2000yqm.googlegroups.com...
On Mar 28, 7:37 am, Simon Wright <si...@pushface.org> 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.
next prev parent reply other threads:[~2011-03-29 3:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 4:11 Breaking a circularity Gene
2011-03-28 9:59 ` Ludovic Brenta
2011-03-28 11:37 ` Simon Wright
2011-03-28 22:38 ` Gene
2011-03-29 3:01 ` Randy Brukardt [this message]
2011-03-28 19:47 ` Gene
2011-03-28 10:15 ` Simon Wright
2011-03-28 21:31 ` Gene
2011-03-28 11:06 ` Martin
2011-03-28 22:26 ` Gene
2011-03-29 16:28 ` Martin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox