aroberge / ideas

Easy creation of custom import hooks to experiment on alternatives to Python's syntax; see https://aroberge.github.io/ideas/docs/html/
Other
79 stars 4 forks source link

Implicit multiplication #6

Closed aroberge closed 4 years ago

aroberge commented 4 years ago

When writing equations on paper, one does not usually use a symbol to represent multiplication. For example, instead of writing

a = b * c + d * e

one might simply write

a = bc + de

However, without additional information, this cannot be parsed properly by a computer. One possible solution is to add spaces between quantities that are to be multiplied:

a = b c + d e

It might be interesting to see if an "implicit multiplication" mode could be written allowing something like this. Furthermore, by having a variable declaration, one could disambiguate between function calls and multiplication as in:

variables a, b, c, d

a = b( c + d)
a = f(c + d)

Refer to https://mail.python.org/archives/list/python-ideas@python.org/message/52DLME5DKNZYFEETCTRENRNKWJ2B4DD5/

aroberge commented 4 years ago

Done.