3 ms·
It's not that PEDMAS was a new thing in 1971, if you look at the article about the timeline of Parsing (https://news.ycombinator.com/item?id=16856694 https://ne
by irishsultan 9y ago
It's not that PEDMAS was a new thing in 1971, if you look at the article about the timeline of Parsing (https://news.ycombinator.com/item?id=16856694 https://news.ycombinator.com/item?id=16856694) then you'll see that the earliest programming languages didn't have operator precedence, and that this annoyed users of those languages.
It's probably either because parsing operators with precedence wasn't really a solved problem in 1964 when Iverson first started working on APL, or because Iverson disagrees with the normal precedence rules. If you look at Notation of a tool of thought (also linked on HN in the recent past ), then there is this passage (when comparing APL with normal math notation):
> In
the
interpretation
of
composite
expressions
APL
agrees
in
the
use
of
parentheses,
but
differs
in
eschewing
hierarchy
so
as
to
treat
all
functions
(user-defined
as
well
as
primitive)
alike,
and
in
adopting
a
single
rule
for
the
application
of
both
monadic
and
dyadic
functions:
the
right
argument
of
a
function
is
the
value
of
the
entire
expression
to
its
right.
An
important
consequence
of
this
rule
is
that
any
portion
of
an
expression
which
is
free
of
parentheses
may
be
read
analytically
from
left
to
right
(since
the
leading
function
at
any
stage
is
the
"outer"
or
overall
function
to
be
applied
to
the
result
on
its
right),
and
constructively
from
right
to
left
(since
the
rule
is
easily
seen
to
be
equivalent
to
the
rule
that
execution
is
carried
out
from
right
to
left)