comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: AdaYY wish list from current projects
Date: 23 Feb 2001 14:54:32 +0100
Date: 2001-02-23T14:54:32+01:00	[thread overview]
Message-ID: <87lmqx1p47.fsf@deneb.enyo.de> (raw)
In-Reply-To: slrn99cdnh.ju.lutz@taranis.iks-jena.de

lutz@iks-jena.de (Lutz Donnerhacke) writes:

> >You need the conversion package anyway, at least that's my experience.
> >Otherwise, your code is quite unportable, as you're passing around
> >invalid values.
> 
> If my suggestion is part of the AdaYY specification, it would be perfectly
> portable.

I think you've missed the point.  If you use enumeration
representation clauses which are sparse (i.e. not every representation
has a corresponding enumeration literal), you're dealing with invalid
representations.  If you never, ever copy any such values and always
check using the Valid attribute that the representation is not invalid
before using it in computations, you might actually have portable
code.  If you do not follow these rules, you end up with code which
depends heavily on the Ada implementation (even on the compiler flags
used), and which is probably less robust than it could be.

So I still claim that little endian/big endian integers are sufficient
for most (almost all?) applications and it's not necessary to an
endian property to enumeration types, or to add even more complexity
to representation clauses.

> >> Even better: Try to write a program, which derivates the type from a pointer.
> >
> >Sorry, what do you want to do?

Sorry, I still do not understand what you mean by 'derivates the type
from a pointer'.

> The problem escaped from a 'multiprotocol router'. Please try to map a IPv4
> header incl. payload and IP-header options.

Ah.  Well, obviously, you can't use a single record in this case.



  reply	other threads:[~2001-02-23 13:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20 20:50 AdaYY wish list from current projects Lutz Donnerhacke
2001-02-22 11:08 ` Florian Weimer
2001-02-22 13:02   ` Lutz Donnerhacke
2001-02-23  9:30     ` Florian Weimer
2001-02-23 10:12       ` Lutz Donnerhacke
2001-02-23 13:54         ` Florian Weimer [this message]
2001-02-23 14:16           ` Lutz Donnerhacke
2001-02-23 15:04             ` Florian Weimer
2001-02-23 15:15               ` Lutz Donnerhacke
2001-02-23 16:21                 ` Florian Weimer
2001-02-23 16:31                   ` Lutz Donnerhacke
2001-02-23 17:25                     ` Florian Weimer
2001-02-26 11:22                       ` Lutz Donnerhacke
2001-02-23 19:06             ` tmoran
2001-02-26 11:20               ` Lutz Donnerhacke
2001-02-23 19:06         ` tmoran
2001-02-26 11:21           ` Lutz Donnerhacke
replies disabled

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