I am designing a language, and wondering which character (or string) to use to represent that something is an attribute of something else.
In all languages I have used, this is done with a dot -
However, in this language, I want to have what would usually be methods as syntactic sugar for normal functions, like so:
x.f(y, z).g(a, b).h(p, q)
is the same thing as
x = f(x, y, z) x = g(x, a, b) x = h(x, p, q)
However, if I also use
. to show that an attribute belongs to a class I think that will get confusing, so I'm looking for another symbol for that purpose (or another solution).
Currently I am thinking that I should use either the apostrophe -
instance'attribute - which shows ownership in a clear way, but means it can't be used for strings, the backtick -
instance`attribute - kind of looks like an apostrophe, which is good in the sense it shows ownership, but bad in the sense it could be mistaken for one, and is less commonly typed, and therefore likely to be slower to be typed (and missing from some keyboards).
Alternatively, are there any symbols I could replace the dot used for the syntatic sugar inplace function calling thing with?