quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
150 stars 23 forks source link

Math infixes shouldn't use regular function names #3061

Open OAGr opened 7 months ago

OAGr commented 7 months ago

This shouldn't break things:

multiply(a,b,c) = a

3 * 5

We could instead map the infixes to alternate versions of these names, like, operationMultiply, or something less used. We might well want to make these special key words that can't be shadowed.

berekuk commented 5 months ago

Renaming is easy, but we also should keep old names as aliases. E.g., reduce(arr, 1, multiply) is convenient.

So we'll have to duplicate code (ugh), or support aliases: ... in FRFunction (preferable).

On naming, I suggest we go either with operator names, internally, or with #add.

berekuk commented 5 months ago

On naming, I suggest we go either with operator names, internally, or with #add.

Operator names are nice in that we won't have to invent new names, but #add tokens are more greppable, so I'm leaning towards latter.