[RFC] Shorter alternative representation for `of'
Jose E. Marchesi
jemarch@gnu.org
Sun Jan 18 09:25:22 GMT 2026
> Quick question (and forgive my ignorance here):
>
> Is foo.biz a disallowed syntax ?
I _think_ it might be possible.
Algol 68 Genie supports this syntax for left-to-right selection:
foo(bar,baz) or foo[bar,baz] to dentoe baz of bar of foo
For some reason, however, this sort of field selection is a primary
rather than secondary. Also the use of brackets makes it ambiguous to
use this form to do multiple selection, so thats not allowed.
It is not clear to me why such a contrived syntax is necessary in the
case of a68g. Perhaps it is related to the fact Genie also supports
`..' as an alternative representation of `:' in trims (we don't) or
perhaps there is a more profound reason in the syntax... I haven't
looked at the issue in depth.
In any case, if it turns out it is syntactically possible and sane to
use . for left-to-righ selection, I agree with you foo.bar.baz would
complement foo'bar'baz nicely.
> On Sun, Jan 18, 2026 at 2:48 AM chris hermansen <clhermansen@gmail.com> wrote:
>>
>> Hello again,
>>
>> On Sat, Jan 17, 2026 at 5:38 PM Mohammad-Reza Nabipoor <mnabipoor@gnu.org> wrote:
>>>
>>> On Sun, Jan 18, 2026 at 02:34:07AM +0100, Mohammad-Reza Nabipoor wrote:
>>> > or even better:
>>> >
>>> > foo of bar of baz foo./bar./baz
>>> > baz fo bar fo foo baz\.bar\.foo
>>> >
>>>
>>>
>>> Or even:
>>>
>>> foo of bar of baz foo./bar./baz
>>> baz fo bar fo foo baz/.bar/.foo
>>>
>>> Because if `./' is similar to `of', `/.' is similar to `fo'!
>>
>>
>> While I like of and fo (having suggested fo myself) I really don't
>> like ./ and /. - I guess I could live with .\ and /. or \. and ./
>> but why not just .?
>>
>> By the way and for what it's worth, in Groovy we have the ? usable
>> for a short-circuit to deal with nulls, that is:
>>
>> a?.b?.c?.d will never fail - if a is null, then it returns null,
>> otherwise it looks at a.b; if that's null, it returns null,
>> otherwise it looks at a.b.c and so on.
>>
>> I use this all the time when I'm doing Groovy.
>>
>>
>> --
>> Chris Hermansen · clhermansen "at" gmail "dot" com
>>
>> C'est ma façon de parler.
More information about the Algol68
mailing list