TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Christoph & Ursula Grein <[log in to unmask]>
Sun, 15 Nov 1998 17:38:37 +0100
text/plain (56 lines)
[log in to unmask] schrieb:
> package bank_accounts
>   class account begin
>         money_type amount;
>         function   money_type withdraw;
          static x y;                      <--
>   end class account;
>   class saving_account is new accounts
>         etc..
>   end class saving_account;
> end package bank_accounts;
> (the above is not legal Ada :)

What is the advantage of the above syntax over the Ada one?

package Bank_Accounts is

  type Account is tagged record
    Amount: Money_Type;
  end record;

  function Withdraw return Money_Type;

  Y: X;     <-- Java's static.

  type Saving_Account is new Account with

end Bank_Accounts;

IMHO, discussions about syntax are absolutely useless.
In Java, you need an extra keyword "static" to discriminate between (what's
the word?).
So what? Java has one way to say something, Ada another one. Which one is
better is a pure matter of taste.

I changed language several times, and each time I found some feature - say -
annoying because is was different from the one I was used to. After some
time, I got used to it and that's that.

Why should all languages use similar syntaxes?

Chinese is very different from English. Why should anyone say because Indo-
European languages are flective, Chinese is worse or wrong because it's

My half cent...

Long time no see
Hao  jiu  bu jian