Content-Transfer-Encoding: |
8BIT |
Sender: |
|
Subject: |
|
From: |
|
Date: |
Sun, 15 Nov 1998 17:38:37 +0100 |
Content-Type: |
text/plain; charset=ISO-8859-1 |
MIME-Version: |
1.0 |
Reply-To: |
|
Parts/Attachments: |
|
|
[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
etc..
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
isolating?
My half cent...
Long time no see
Hao jiu bu jian
Christoph
|
|
|