Re: [sv-ec] class datatype

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Fri May 09 2008 - 11:27:04 PDT
Francoise Martinolle wrote:
> I am wondering if the following is legal:
>  
> class base #(parameter i = 0, j = base::i);
> endclass

First, I do think that:
    class base #(parameter i = 0, j = i);
    endclass
is fine; I assume that there is no question on that.


However, in your example, there is an assumption that I think you
are making with which I disagree.  The  assumption is that in
this  context the name "base" is the name of the scope and
not the name of the default specialization.

As of the current Draft 5 LRM language, it is pretty clear that
the only time in which a parameterized class name does NOT
refer to the default specialization is when one is defining
the return type (or the name) of an extern method.

So in this case, I would consider "base::i" to mean
"the parameter value or 'i' in the default specialization".


In that narrow situation (when talking about only the base),
I think you do have an issue related to the one that you
are talking about -- a more explicit but equivalent
question is when the base type of "base#()::i" comes into existence
with respect to an in-progress specialization of the the default type.

That is indeed touchy and there are some interesting (and much worse)
type problems lurking behind the question.

My opinion at this point is that the default **type** doesn't
actually come into existence early enough to refer to itself
in the parameter list.  At some point we should discuss the issues
related to that but for now, I'd consider it illegal to refer
to "base" within the defaults of its parameters.

Gord.


>  
> or
>  
> class base #(parameter i = base::j, j = 1);
>  
> When is the class datatype "base" defined? immediately after the name 
> base or when the
> semi colon of the class declaration is reached.
> I assume the latter but is there any language in the LRM to specify this?
>  
> Francoise
>        '
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri May 9 11:27:30 2008

This archive was generated by hypermail 2.1.8 : Fri May 09 2008 - 11:28:03 PDT