Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Is there a term for "signature plus return type"?

Reply
Thread Tools

Is there a term for "signature plus return type"?

 
 
Lew
Guest
Posts: n/a
 
      12-01-2010
Joshua Cranmer wrote, quoted or indirectly quoted someone who said :
>> I think I would call it the "full signature" of the method, but I don't
>> think the JLS ever refers to it as such.


Roedy Green wrote:
> If you start making the distinction consistently in your docs others
> will almost subliminally understand. Further, if an official term
> does come into being,


JLS § 8.2 defines,
>>> We use the phrase /the type of a member/ to denote:
>>> - For a field, its type.
>>> - For a method, an ordered 3-tuple consisting of:
>>> o *argument types*: a list of the types of the arguments to the method member[;]
>>> o *return type*: the return type of the method member[;] and the
>>> o *throws clause*: exception types declared in the throws clause of the method member.


> you can update all your docs with a global regex string Search and replace.
> see http://mindprod.com/jgloss/searchreplace.html

[snip]
> When I work on my own, I keep renaming things to use ever more precise
> terminology. Keep it consistent!


--
Lew
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      12-01-2010
On Tue, 30 Nov 2010 08:53:14 -0500, Joshua Cranmer
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>I think I would call it the "full signature" of the method, but I don't
>think the JLS ever refers to it as such.


If you start making the distinction consistently in your docs others
will almost subliminally understand. Further, if an official term
does come into being, you can update all your docs with a global regex
string Search and replace.
see http://mindprod.com/jgloss/searchreplace.html

Any project needs a project dictionary with precise definitions. You
need to take generic English language and nail it down with project
specific definitions. If you don't, your docs will use a hodge podge
of conflicting terms. This vocabulary and accurate docs using it make
updating code a piece of cake. Without it, you will make all manner of
incorrect assumptions.

When I work on my own, I keep renaming things to use ever more precise
terminology. Keep it consistent!


--
Roedy Green Canadian Mind Products
http://mindprod.com

In programming, and documenting programs, keep vocabulary consistent and precisely defined! Variation in vocabulary to relieve the tedium is for novels.
 
Reply With Quote
 
 
 
 
Tom McGlynn
Guest
Posts: n/a
 
      12-01-2010
On Nov 30, 11:18*pm, Lew <(E-Mail Removed)> wrote:
> Arne Vajhøj wrote:
> >>> I think we should agree here on cljp that this is the correct term
> >>> and push it to the rest of the world!

>
> >>>

> Lew wrote:
> >> Or we could agree to use the term already defined in the JLS.

>
> On 11/30/2010 07:25 PM (US Eastern), Arne Vajhøj wrote:
>
> > And that was?

>
> On 11/30/2010 02:27 PM (US Eastern), Lew wrote:
>
>
>
> >> JLS § 8.2 defines,
> >>> We use the phrase /the type of a member/ to denote:
> >>> - For a field, its type.
> >>> - For a method, an ordered 3-tuple consisting of:
> >>> * *o *argument types*: a list of the types of the arguments to the method member[;]
> >>> * *o *return type*: the return type of the method member[;] and the
> >>> * *o *throws clause*: exception types declared in the throws clause of the method member.

>
> >> Additional information:

>
> >> § 13.1 of the JLS calls the whole shebang, "the erasure ... of the
> >> qualifying type of the [method] invocation, plus the erasure of the
> >> signature of the method." *This applies to method invocations.

>
> >> § 15.12.3 tells us, "If the compile-time declaration for the method
> >> invocation is not void, then the type of the method invocation
> >> expression is the result type specified in the compile-time
> >> declaration."

>
> It was and still is.
>


If I understand Lew, he is noting that the the JLS uses the term
"type" for return type plus signature and recommending this. I don't
think this usage would be helpful in more generally.

His examples suggest that even in the JLS it's a bit iffy and
unclear. In the second example, we get that a
'type' [of method invocation] is a 'result type'
but that's clearly wrong if the first type is a type in this more
general
sense. An ordered tuple is not the same thing as one element of that
tuple.

Do method invocations not have 'type's in the more general sense? Or
given that this is a type of a method invocation expression -- rather
than of the method itself -- maybe the JLS should have said 'result
type' in both places, though the use of type for an invocation in the
first example suggests that invocations have such a "full" type as
well as methods themselves.


To me the JLS's use of "type" is very easy to confuse with "return
type". I would expect that the phrase
"the type of the method" or "the method type"
would be interpreted by the vast majority of readers as the return
type of the method unless the phrase "type" is defined near where it
is used. By contrast, I'd be far less likely to misapprehend the
phrase "full signature" though I might have to look it up. The phrase
"full type" might be a compromise, though in I suspect most Java
users would think it has something to do with generics.

Since this is a concept that goes well beyond Java, I don't think the
JLS's usage need be the last word, though it should certainly be
considered.

Regards,
Tom McGlynn
 
Reply With Quote
 
Stefan Ram
Guest
Posts: n/a
 
      05-07-2013
http://www.velocityreviews.com/forums/(E-Mail Removed)-berlin.de (Stefan Ram) writes:
>Does the JLS also has a term for »int f( int )«, that is,
>»signature plus return type«? (A term that is shorter than
>»signature plus return type«, of course.)


I am not sure whether the above post (dated 2010-11-30)
was already answered, but in the meantime I found an answer!

(I hope that I do not have missed someone already saying so.)

JLS7 15.12.2p2 calls this a

»descriptor (signature plus return type)«.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c plus plus code comparator furqan shaikh C++ 6 11-12-2008 06:14 AM
Invoking c function in a c plus plus function... Rahul C++ 9 03-25-2008 05:24 PM
C plus plus vs C Sharp The LoxFather C Programming 23 08-14-2003 03:51 AM
C plus plus vs C Sharp The LoxFather C++ 23 08-14-2003 03:51 AM



Advertisments