[TUHS] On computerese

Russ Cox rsc at swtch.com
Mon Sep 30 11:01:28 AEST 2024


On Tue, Sep 17, 2024 at 1:55 AM <arnold at skeeve.com> wrote:

> I think it was only Plan 9. The change was motivated by the
> rc shell, which treated x=y anywhere on the command line (not just
> at the beginning of a command) as a variable assignment.
>

I'm a little late to the thread, but this is not quite true.
rc's lexer and grammar treated = as a special
symbol - just like ( or | or & or ; - and so it couldn't
be used as a literal except when quoted.
That is, "foo x=y" was a syntax error, not an equivalent to "x=y foo".

One of the tidyings I did during covid lockdown was to rewrite
rc's parser not to use yacc anymore [1], specifically to make
it easy to allow "foo x=y". As I wrote in the commit message,
dd fans rejoice! (Also fans of -foo=bar flag syntax.)

Best,
Russ

[1] https://groups.google.com/g/plan9port-dev/c/AS8acHti7eo/m/0tZF7h7FBQAJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20240929/cecd3972/attachment.htm>


More information about the TUHS mailing list