-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicit typing for variables #370
Comments
Wouldn't it be possible to simply consider as declaration any left member where a variable name appears for the first time? |
@Silmathoron I have to note again: |
@PTraeder |
|
First a question to ensure that I understand everything correctly:
Is this correct? Then, I think, it would make sense to use Concerning units, the question is what to do if units in an expression either do not match perfectly or are combined multiplicatively forming new units. Some examples:
I assume that people elsewhere have worked on inference of units, but I don't know that literature. |
I agree with @heplesser's assessment that the Regarding the question of units, I think this should be possible by always using the natural neuroscientific unit (ms, mV, nS, pA, GOhm) if things become unclear with respect to the magnitude. |
We decided to postpone the support of this due to more complex implementation of the language background. The effort for implementing it is currently not justified (since we are moving to PyNESTML) |
I am currently working on a change that would make function declarations not require a type.
E.g. something like
would assume (and install) the type of mS for the (alias) function foo.
Here is where I need your input:
Since these function declarations are grammatically the same as regular variable declarations (i.e. defined by the same rule) it would be rather straightforward to install the same changes for regular variables.
However, at that point it becomes no longer possible to discern between a declaration and an assignment in the update block where both can occur:
One easy solution for this would be to change the syntax for declarations to expect
:=
instead of a simple=
Since @heplesser has in the past inquired about making types optional for varialbes, I judged this to be a good time to get everyones feedback on this.
@DimitriPlotnikov @jougs @Silmathoron
The text was updated successfully, but these errors were encountered: