comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: About String
Date: Sun, 08 Jun 2008 17:19:11 -0400
Date: 2008-06-08T17:19:11-04:00	[thread overview]
Message-ID: <wccprqrfwvk.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: aca3f318-8a9f-4f87-a315-dded8422f2f0@m36g2000hse.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> writes:

> You did not state it explicitly, but I presume that you allow mixing
> declarations with executable code ("as in Java and other languages")?

Yes, if I ran the circus, I would allow that.  I really find it annoying
that I have to add 3 useless lines of code (declare/begin/end) and an
extra level of indentation, when all I wanted to do was declare
a very-local object.

I also find it annoying that I can't add a statement at the beginning of
a procedure, without moving everything into a local block.  E.g. I have:

    procedure P (X : Integer) is
        Local : constant String := ...;
    begin
        ...

and I want add:

    if X = 0 then
        raise Blah;
    end if;

and I want that to come first.

> After all, with the possibility to initialize the new variable with
> arbitrarily complex expression (including function call), this is
> already the case and the whole declare-begin-end block is just
> reflecting some artificial separation.

I agree.  I suppose it comes from Pascal, where declarations and
executable code are completely separated.  It makes no sense in
Ada, where declarations are just as executable as statements.

- Bob



  reply	other threads:[~2008-06-08 21:19 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 17:29 About String Sébastien Morand
2008-06-07 16:18 ` Simon Wright
2008-06-07 17:01   ` Pascal Obry
2008-06-07 22:13     ` Chris Moore
2008-06-08  6:47       ` Niklas Holsti
2008-06-08  7:35         ` Dmitry A. Kazakov
2008-06-08 10:29           ` Sebastien Morand
2008-06-08 10:53             ` Dmitry A. Kazakov
2008-06-08 11:14           ` Niklas Holsti
2008-06-08 13:16             ` Dmitry A. Kazakov
2008-06-08 17:17               ` Niklas Holsti
2008-06-09  7:26                 ` Dmitry A. Kazakov
2008-06-08 11:48           ` Martin
2008-06-08 13:17             ` Conditional declarations (was: About String) Dmitry A. Kazakov
2008-06-08 18:26           ` About String Chris Moore
2008-06-08 18:32         ` Robert A Duff
2008-06-08 20:51           ` Maciej Sobczak
2008-06-08 21:19             ` Robert A Duff [this message]
2008-06-09  7:14               ` Dmitry A. Kazakov
2008-06-09  9:43                 ` Georg Bauhaus
2008-06-09 10:25                   ` Dmitry A. Kazakov
2008-06-09 10:42                     ` Sébastien Morand
2008-06-09 11:43                     ` Georg Bauhaus
2008-06-09 12:03                       ` Dmitry A. Kazakov
2008-06-15 19:38                 ` Robert A Duff
2008-06-15 20:52                   ` Dmitry A. Kazakov
2008-06-15 22:06                     ` Robert A Duff
2008-06-16  8:31                       ` Dmitry A. Kazakov
2008-06-16 19:17                         ` Robert A Duff
2008-06-16 20:30                           ` Dmitry A. Kazakov
2008-06-16 22:02                           ` Georg Bauhaus
2008-06-16 23:04                             ` Robert A Duff
2008-06-09 11:00               ` Georg Bauhaus
2008-06-09 14:27                 ` Britt Snodgrass
2008-06-15 19:50                   ` Robert A Duff
2008-06-15 19:48                 ` Robert A Duff
2008-06-08 11:13     ` Simon Wright
2008-06-08 19:03       ` Sebastien Morand
replies disabled

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