Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Remove function declaration style ambiguities #9

Open
WilliamRagstad opened this issue Jan 30, 2022 · 0 comments
Open

Remove function declaration style ambiguities #9

WilliamRagstad opened this issue Jan 30, 2022 · 0 comments
Labels
↻ breaking Suggestions or fixes that are breaking changes in some way. • enhancement New feature or request ♥︎ good first issue Good for newcomers

Comments

@WilliamRagstad
Copy link
Member

WilliamRagstad commented Jan 30, 2022

So we need to determine a standard way for function vs variable declarations.
Easiest is to enfoce parenthesis around the parameter vector after the function name in declarations.

f(float x, int m) = 2*x + m #inferred return type
PI = 3.1415 # inferred value type

This makes it easy to differentiate between a variable and a parameterless function.
Both variable and function declarations can thereforce ommit return/value types and let those be inferred.

double f(float x, int m) = 2*x + m
Real PI = 3.1415
@WilliamRagstad WilliamRagstad added • enhancement New feature or request ↻ breaking Suggestions or fixes that are breaking changes in some way. ♥︎ good first issue Good for newcomers labels Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
↻ breaking Suggestions or fixes that are breaking changes in some way. • enhancement New feature or request ♥︎ good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant