Skip to content

Improvements in Method Call-Expression Reference #1870

Open
@iampi31415

Description

@iampi31415

Method Call Expressions (nightly version)

(...) and a parenthesized expression-list.

I think the definition in call expression is much more clear

(...) a parenthesized comma-separated list of expression, called the argument operands.

I think "parenthesized expression-list" can be with "parenthesized comma-separated list of expression, called the argument operands."

I'd remove the last " operands" as well, which doesn't add much and it's not in the original definition i.e the first quote above. So it is a combination of both quotes.

Plus, having the same-ish text for that part seems worthwhile.

Second Issue

Then the second paragraph says:

Method calls are resolved to associated methods on specific traits, either statically dispatching to a method if the exact self-type of the left-hand-side is known, or dynamically dispatching if the left-hand-side expression is an indirect trait object.

And from what I understand in that document the "Method calls are resolved to associated methods on specific traits, (...)" isn't correct.

A method could be not "on specific traits" but simply in the direct implementation of the type. So I would say something alike: "Method calls are resolved to associated methods either inherent or from implemented traits, (...)"

Note that "inherent" is later used in the items 1. and 2. in the list that is just a bit below.

Third issue

The next paragraph says:

When looking up a method call, the receiver may be automatically dereferenced or borrowed in order to call a method. This requires a more complex lookup process than for other functions, since there may be a number of possible methods to call. The following procedure is used:

And it seems "for other functions" is not precise. It means here "for other non-methods" I think.

Maybe I'm reading too narrowly, but since the reference is one of the best resources, it'd be good to make some of these changes, if they apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions