comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: generic function and overloading
Date: Thu, 18 Oct 2007 15:30:41 -0700
Date: 2007-10-18T15:30:41-07:00	[thread overview]
Message-ID: <1192746641.719517.25740@t8g2000prg.googlegroups.com> (raw)
In-Reply-To: <pan.2007.10.18.19.00.34.353900@linuxchip.demon.co.uk.uk.uk>

On Oct 18, 11:58 am, "Dr. Adrian Wrigley"
<a...@linuxchip.demon.co.uk.uk.uk> wrote:
> On Thu, 18 Oct 2007 00:28:38 -0700, eliben wrote:
> > Hello,
>
> > I have a few "hardware" types, for example uint16 and uint32. And I
> > want to write a functions that will set or clear bits of such types.
> > For example:
>
> > function Bit_Set(word: uint16; bitn: natural) return uint16;
>
> > function Bit_Set(word: uint16; bitn: natural) return uint16 is
> >   mask: uint16 := 2**bitn;
> > begin
> >   return word or mask;
> > end Bit_Set;
>
> Have you checked that packed arrays of booleans aren't
> suitable?  usually you need type like this for interfacing
> with other languages (eg C) - but then you use the types
> in the appropriate Interfaces packages.  And you might
> use such a type when writing directly to a hardware
> register on a particular peripheral or bus.

Maybe that's the reason the original poster referred to them as
"hardware" types?????

                      -- Adam




      reply	other threads:[~2007-10-18 22:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18  7:28 generic function and overloading eliben
2007-10-18  8:18 ` Jean-Pierre Rosen
2007-10-18  9:31 ` Dmitry A. Kazakov
2007-10-18  9:33   ` Dmitry A. Kazakov
2007-10-18 10:32 ` Georg Bauhaus
2007-10-18 11:07 ` Stephen Leake
2007-10-18 11:30 ` Stefan Lucks
2007-10-18 15:58 ` Robert A Duff
2007-10-18 20:20   ` Simon Wright
2007-10-18 21:23     ` Robert A Duff
2007-10-19  5:19       ` Simon Wright
2007-10-19 13:59         ` Robert A Duff
2007-10-18 18:58 ` Dr. Adrian Wrigley
2007-10-18 22:30   ` Adam Beneschan [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox