comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Easy question about Character manipulation
Date: Wed, 31 Jan 2007 18:01:09 -0500
Date: 2007-01-31T18:01:09-05:00	[thread overview]
Message-ID: <wcc8xfiztqi.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: C1E6B457.924F7%yaldnif.w@blueyonder.co.uk

"(see below)" <yaldnif.w@blueyonder.co.uk> writes:

> On 31/1/07 18:11, in article NZ4wh.374843$1i1.113582@attbi_s72, "Jeffrey R.
> Carter" <jrcarter@acm.org> wrote:
>
>> When I learned Pascal (not ISO), my understanding was that
>> 
>> type
>>     A = 1 .. 3;
>> 
>> was called a subrange, and defined A as what Ada calls a subtype of
>> Integer.

Well, the original Jensen&Wirth book defining Pascal was so vague that
you couldn't really tell what rule was intended about these things.
The ISO standard clarified all this stuff.

>... Since
>> 
>>     B = 1 .. 3;
>> 
>> was another subtype of the same type (in Ada terms), assignment between
>> them was no problem.
>
> That is the practical effect, but it is not what the formal semantics
> actually says. And, of course, there is more to type than assignment.

The important things are assignment statements, initialization (which
Pascal doesn't have in the Ada sense), parameter passing (with or
without 'var'), and function return.  From what you've explained, all
except 'var' parameters behave the way Jeff says above.

What's the rationale for treating 'var' specially?  As I recall, there's
also a special rule in Pascal that you can't pass a component of a
packed record or array to a 'var' parameter.  Isn't that enough?

- Bob



  reply	other threads:[~2007-01-31 23:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 20:01 Easy question about Character manipulation mark
2007-01-29 20:17 ` Dmitry A. Kazakov
2007-01-29 21:30   ` Georg Bauhaus
2007-01-30  0:51     ` (see below)
2007-01-30  1:43       ` Georg Bauhaus
2007-01-30  2:09         ` (see below)
2007-01-30 20:18           ` Robert A Duff
2007-01-30 21:07             ` (see below)
2007-01-30 22:05               ` Robert A Duff
2007-01-31  3:07                 ` (see below)
2007-01-31 18:11               ` Jeffrey R. Carter
2007-01-31 21:02                 ` (see below)
2007-01-31 23:01                   ` Robert A Duff [this message]
2007-01-31 23:23                     ` (see below)
2007-01-31 23:46                   ` Jeffrey R. Carter
2007-02-01  0:07                     ` (see below)
2007-01-30 21:08             ` Dmitry A. Kazakov
2007-01-31 16:54           ` Georg Bauhaus
2007-01-31 17:24             ` (see below)
2007-01-30 12:28 ` Martin Krischik
2007-01-30 17:50   ` Jeffrey R. Carter
2007-01-30 20:24     ` Robert A Duff
2007-01-30 21:12       ` Dmitry A. Kazakov
2007-01-30 21:39         ` Robert A Duff
2007-01-31 10:55           ` Dmitry A. Kazakov
2007-01-31 11:22           ` Martin Krischik
2007-01-31 18:14       ` Jeffrey R. Carter
replies disabled

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