Skip to content

Add syntax for implicit coefficients #707

@evhub

Description

@evhub

Should compile

5 x**2 + 2 x

to

5 * x**2 + 2 * x

The biggest problem, unfortunately, is that this would have a different precedence than implicit function application f x currently has, since

a x**2 + b x

is currently valid and compiles to

a(x)**2 + b(x)

Probably, the best way to do this is to change the precedence of implicit function application to be just tighter than */@ and have implicit function application check if the function is an int/float/numpy dtype and in that case use multiplication rather than function application. However, this would be a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions