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,ad988eb0a9545c86 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-22 19:45:48 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!iad-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Problem trying to implement generics. In-Reply-To: Message-ID: References: <9b7tce$laf$2@taliesin.netcom.net.uk> <3ADC4320.7ACA3DEC@averstar.com> <9bhoup$h9k$1@taliesin.netcom.net.uk> <3ADC7A79.8E853905@mindspring.com> <9bi7vb$9j7$1@taliesin.netcom.net.uk> <9bpacv$86n$2@a1-hrz.uni-duisburg.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 23 Apr 2001 02:45:40 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 987993940 206.184.139.136 (Mon, 23 Apr 2001 02:45:40 GMT) NNTP-Posting-Date: Mon, 23 Apr 2001 02:45:40 GMT Organization: Verio Xref: newsfeed.google.com comp.lang.ada:6843 Date: 2001-04-23T02:45:40+00:00 List-Id: On Fri, 20 Apr 2001, Robert A Duff wrote: > One thing I've considered is having two alternate syntaxes for the > various control structures. For example, you could say: > > if Condition then > ... > end if; > > or > > if Condition { ... }; > > or something like that. The former would be used when "..." is long; > the latter when "..." is short (eg three lines or less?) -- so short > that the "}" is close to the "if", so it's obvious what it belongs to, > so "end if" is merely clutter in that case. How about just using the {} and having an optional } if; syntax? > And probably the {...} syntax couldn't have other control structures > nested inside it -- it's only allowed for the innermost thing. > > Good idea? I don't like it. > Oh, and I'd like my editor to automatically convert from one to the > other as "..." grows or shrinks. At this point, I say adopt indentation for block structure. > > I'd really like to use the {} for something else, and there are only a few > > symmetric bracket pairs to choose from. > > What did you have in mind? Literals of type "set"? Actually, I was thinking of a more lightweight genericity than what Ada has now and actually using the {} like C++ uses <> and Eiffel uses []. > Note that you can invent new bracket-y pairs using some slightly ugly > syntax like: > > (. .) > (: :) Ever seen BETA? It does that kind of stuff, and uses (for for), (if if) kinds of bracketing pairs. > (* *) -- Pascal uses this one. It's the source of a syntax bug in OCaml, let (*) x y = mult x y fails :-). > << >> -- Ada uses this one. > `` '' -- The TeX "programming" language uses this. ;-) Funny you mentioned that, I've started using LaTeX again. Sometimes the old ways are better :-). > BTW, I wish ASCII had left and right double-quote characters. That > would be much more civilized. Oh well. Maybe the decision to restrict a language to ASCII will be viewed in the future like Ada's current restrictions. There are certainly glyphs that I'd use if I could but I think ASCII is a fair restriction for the lexemes of the surface syntax of a language. -- Brian