From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,79bbf7e359159d0d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-10 11:22:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!dispose.news.demon.net!demon!grolier!club-internet!not-for-mail From: Laurent Guerby Newsgroups: comp.lang.ada Subject: Re: newbie can't get exceptions to work! Date: 10 Apr 2001 20:21:47 +0200 Organization: Club-Internet (France) Message-ID: <86wv8sfwec.fsf@acm.org> References: <9ao1if$cq9$1@taliesin.netcom.net.uk> <3ACFC902.115624A1@mindspring.com> <86u23yszjo.fsf@acm.org> NNTP-Posting-Host: nas22-26.vlt.club-internet.fr X-Trace: front4m.grolier.fr 986926508 2027 195.36.172.26 (10 Apr 2001 18:15:08 GMT) NNTP-Posting-Date: 10 Apr 2001 18:15:08 GMT X-Newsreader: Gnus v5.7/Emacs 20.5 Xref: supernews.google.com comp.lang.ada:6721 Date: 2001-04-10T18:15:08+00:00 List-Id: Brian Rogoff writes: > On 9 Apr 2001, Laurent Guerby wrote: > > broken case statements, > > Broken semantically. Using the name switch wouldn't make a difference. > Besides, I much prefer ML or Haskell pattern matching to Ada's case > statement. More readable, more powerful, terser, better. Well, that's no longer syntax ;-). The horror I was refering too was the optional break as you might have guessed. Also I find the mandatory enumerate all rule in alternatives of Ada is quite useful. I agree that pattern matching is something very nice to have anyway. > > named and order free arguments and agregates, > > Would be nice. There is some discussion about adding this to Ocaml now > too. You can use labelled params, but commuting arguments are still up in > the air. I must admit I don't understand why every language doesn't have this feature, especially all those conceived after Ada like OCaml. I suspect we should mandate Ada history and design rationale lectures to all language creators, a lot of engineering went into Ada, and we've had a lot of time to judge the work done. My favourite citation here is from Steve McConnell in "code Complete": Finally, the goto was incorporated into the Ada language, the most carefully engineered programming language in history. > > and operator character choice, > > True, but I must say that the += and friends are nice. Of course an Ada > version would be +:= and still nice. That's a possibility. Another is to have a way to generate tersely procedural versions of operators, may be (ok ugly ;-) procedure Inc is procedural "+"; -- Inc (X : in out T; Y : in T) is begin X := X + Y; end Inc; Not really functional BTW ;-). > And while I don't like the syntax, the ? : of C is also nice, but, > as you know, I'm a functional kind of guy now. This is not just syntax here, Ada doesn't have a way to do the same as C here because of strictness in argument evaluation. I recently designed a small language with an Ada-style syntax and I added "if" expressions : X : constant T := if C1 then V1 elsif C2 then V2 else V3; This is something I think people miss in Ada, may be someone should wrote an extension proposal ;-). > > And I would absolute religious belief in keeping those > > historical mistakes around (see Java). > > I can't parse that. Let me guess, "And I would add, an absolute ..."? You have a powerful syntax recovery parser in your brain ;-). > > If {} vs begin/end is issue for a new language, allow both and end of > > the story. > > That would be a mistake. Personally, I can go either way, begin-end or {}. > I'm just annoyed at the bizarre thinking that puts one of these as greatly > superior to the other. I really find () to be a bummer about Ada syntax > and I don't agree that wordier is always better. As other people pointed out, another advantage of end syntax is the "end thing" which is quite nice. I think that if you allow declarations to float around, the argument about terseness of {} becomes moot, eg: procedure P is variable X : T := Initial; while Cond (X) loop constant Tmp : T := G (X); if Cond (Tmp) then Do_Thing (Tmp, X); end if; Next (X); end loop; end P; would not gain much from {}. And I of course forgot the mandatory () for function calls without args silliness ;-). > > PS: also, on a french keyboard, {} [] are a major pain to type ;-). > > Hey man, get an American keyboard! No, I just program in Ada at home and work ;-) ;-). -- Laurent Guerby