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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3a7c1845ec5caf9 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Equality operator overloading in ADA 83 Date: 1997/04/27 Message-ID: #1/1 X-Deja-AN: 237745251 References: <01bc4e9b$ac0e7fa0$72041dc2@lightning> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-04-27T00:00:00+00:00 List-Id: In article , Matthew Heaney wrote: >But people need to be taught that there are >o static strings - whose length is fixed, and determined statically (eg Pascal) >o dynamic strings - the length of string objects are fixed, but are >determined dynamically (eg Ada) >o flexible strings - the length of string objects can change (Algol 68) I always thought "dynamic" meant what you call "flexible". Too bad the software industry doesn't agree on terminology very well. >I have had a similar experience. I always have to remind programmers to >declare constants instead of variables. IMHO, a better language design would be to make objects constant by default, and stick in an extra keyword when you want variable. Ada does it the other way 'round. How about a compiler warning for variables that could have been constants? >This declares a constant object, using assignment. But why? Couldn't one >bind O to a value, w/o using assignment, similar to a LISP let expression? Yeah, I've done some thinking about that, and I suspect something along these lines would make a lot of sense. > The_Iterator : Stack_Iterator'Class (Stack'Access) := > Iterator (Stack); -- not legal Ada I'm not sure why you want to mention Stack twice. Why not have the initialization code for your iterator type do the necessary stuff (and not use a class-wide iterator)? Would that work? Note also that Ada 95 allows: X: T renames F(...); even if T is a limited type. X is constant here, though. - Bob