Why is dot (".") not considered an operator?

In the Operator Precedence page, the single dot (".") is not listed.
In other parts of the documentation, "dot" is explicitly not called an operator, and referred to as a character. It can be used as part of other legal operators (i.e. ".*").
For dot access in structs, what would you call the dot character if not an "operator" ?
Also, in the following error message, it is called an operator :
. =123
. =123
Invalid use of operator.

1 件のコメント

Walter Roberson
Walter Roberson 2023 年 11 月 28 日
none of the indexing operations are listed there

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2023 年 11 月 28 日

1 投票

This documentation page lists it in the "Special Characters" section. [To be fair it also lists the colon operator in that table.]
I'm curious as to the reason for your question. Is there some functionality you expected the dot character to have (because it "felt like" an operator) that it didn't (or vice versa)?

2 件のコメント

ES
ES 2023 年 11 月 28 日
Thank you. That link is helpful. Mostly, it was a curiosity question. There is no functionality/behaviour I am expecting that isn't there. I am just trying to understand the roots of the language. It just seems peculiar to me that it wouldnt formally be considered an "operator"
Walter Roberson
Walter Roberson 2023 年 11 月 28 日
Except for the () listed there, all of the operations listed are primarily numeric transformations. The page does not show any of the syntax for creating or accessing arrays or composite data types. For example not even () indexing is shown there, and not [] or {} construction or indexing either.
I don't know why they made that choice.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

ES
2023 年 11 月 28 日

コメント済み:

2023 年 11 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by