Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  Index 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022 
<== Date ==> <== Thread ==>

Subject: Re: EPICS base V4: iocCore database
From: Benjamin Franksen <benjamin.franksen@bessy.de>
To: Marty Kraimer <mrk@aps.anl.gov>
Cc: Andrew Johnson <anj@aps.anl.gov>
Date: Mon, 21 Feb 2005 21:55:37 +0100
On Monday 21 February 2005 17:56, Marty Kraimer wrote:
> Benjamin Franksen wrote:
> > What I want to point out is that there is one very useful
> > thing missing from the data model, namely algebraic data types, a.k.a.
> > tagged unions. A syntax could look like this
> >
> >union(name) {
> >	choice(choice_name,"choice_value",choice_data)
> >}
> >
> >where 'choice_data' can be any valid data type, including struct or
> > another union. Thus, menu would be the special case where the
> > 'choice_data' is void (or null; another basic data type to be added).
>
> Andrew also suggested a union.
>
> JAVA does not have a union. Will this cause us any problems?

Well, neither does the C union fit exactly. You have to combine it with a tag 
to discriminate cases; and the type system does not enforce any match between 
tag and data content, so in the end we'll have to implement it as an ADT.

In Java, we would have to cast the data to an 'Object' and back, according to 
the tag value. I think the implementation is in fact easier in Java than in 
C.

Ben



References:
Re: EPICS base V4: iocCore database Marty Kraimer

Navigate by Date:
Prev: Re: EPICS base V4: iocCore database Benjamin Franksen
Next: Re: EPICS base V4: iocCore database Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022 
Navigate by Thread:
Prev: Re: EPICS base V4: iocCore database Marty Kraimer
Next: Re: EPICS base V4: iocCore database Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·