RE: [sv-ec] Section 11 - Classes


Subject: RE: [sv-ec] Section 11 - Classes
From: Faisal Haque (fhaque@cisco.com)
Date: Thu Feb 06 2003 - 17:12:28 PST


Kevin,
The feature you are mentioning is very interesting. But I don't know how
often I would need to reference more than one level up in the hierarchy.
Plus the "super" keyword is very intuitive. So I would counsel against
changing that.

-Faisal

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org]On Behalf Of Kevin
Cameron x3251
Sent: Thursday, February 06, 2003 4:58 PM
To: sv-ec@eda.org; stefen@boyd.com
Subject: Re: [sv-ec] Section 11 - Classes

> From: "Stefen Boyd" <stefen@boyd.com>
> Subject: [sv-ec] Section 11 - Classes
>
> Stu editorially noted that he didn't want global
> keywords new, this or super. I would agree that
> having these be new global keywords is a problem.
> But in this case, unless the language experts can
> provide a slick syntax that isn't confusing, I'm
> inclined to want these keywords... so it seems
> that we need to consider Stu's `compatibility
> proposal if there isn't a friendly syntactical
> way around this. I definitely don't want to go into
> contortions.
>
> Stefen

Is "super" from Java? - C++ doesn't have it, you just
use the base class name with "::" e.g.:

  class foo {
  public:
    int data;
  };

  class bar : public foo {
  public:
    int data; // masks foo
    int foo_data() {return foo::data;}; // Gets foo value
  };

It has the advantage over "super" that it will refer
to any inherited class - not just the immediate parent -
and it only introduces the operator "::" instead of a
keyword.

If we use "::" instead of "super", but someone is desperate
for the exact functionality of "super" we could use:

  ^::

Kev.



This archive was generated by hypermail 2b28 : Thu Feb 06 2003 - 17:13:34 PST