Re: [sv-bc] 12.4.5 Optional argument list - question

From: R.S.Nikhil <nikhil_at_.....>
Date: Mon Apr 17 2006 - 09:45:44 PDT
Mike,

I agree fully with the sentiment, but I thought
that this "feature" of optional parentheses was for backward
compatibility with Verilog.

Also, some people have argued that when b and c are object
members (i.e., m.b+m.c) they want to hide the fact whether
b and c are actually variables or functions. (Personally
I'm not sympathetic to that argument).

Nikhil

Michael (Mac) McNamara wrote:
> Hmm, would we want:
>  
> a = b + c;
>  
> to possibly mean call function b and function c, get their return 
> values, and assign the sum of those to a?
>  
> If we allow the omission of parentheses in non void function calls, then 
> the above, when there are available function definitions in scope,
> would have that meaning. 
>  
> Larry Wall would feel right at home :-)
>  
> I, for one, would rather that we require the visual cue of an () after b 
> and c to indicate a function is to be called.  This is even more 
> important, IMHO, given importation of packages and such that may define 
> a number of functions though the definition is not conveniently visible 
> to the
> casual reader.
>  
> 
> Michael McNamara
> 
> mcnamara@cadence.com
> 
> 408-914-6808 work
> 
> 408-348-7025 cell
> 
>  
> 
>  
> 
>     ------------------------------------------------------------------------
>     *From:* owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] *On Behalf
>     Of *Bresticker, Shalom
>     *Sent:* Monday, April 17, 2006 1:42 AM
>     *To:* sv-bc@eda.org
>     *Subject:* [sv-bc] 12.4.5 Optional argument list - question
> 
>     12.4.5 says,
> 
>     "When a void function or class function method specifies no
>     arguments, the empty parenthesis, (), following the subroutine name
>     shall be optional. This is also true for tasks, void functions, and
>     class methods that require arguments, when all arguments have
>     defaults specified. It shall be illegal to omit the parenthesis in a
>     directly recursive nonvoid function method call that is not
>     hierarchically qualified."
> 
>     This is unclear about nonvoid functions.
> 
>     The first two sentences specify when parentheses (not 'parenthesis')
>     may be omitted. Both apply to void functions only. This implies that
>     nonvoid function calls may never omit the parentheses.
> 
>     The last sentence says that parentheses may not be omitted in a
>     nonvoid function call in a corner case. This implies that they may
>     be omitted in all other cases.
> 
>     What is correct?
> 
>     Thanks,
> 
>     Shalom
> 
>     Shalom Bresticker
> 
>     Intel Jerusalem LAD DA
> 
>     +972 2 589-6852
> 
>     +972 54 721-1033
> 
>     I don't represent Intel 
> 
Received on Mon Apr 17 09:45:55 2006

This archive was generated by hypermail 2.1.8 : Mon Apr 17 2006 - 09:46:09 PDT