Comments (7)
Wouldn't it be possible to simply consider as declaration any left member where a variable name appears for the first time?
Otherwise I have no particular problem with the use of :=
for declaration, but this would be a breaking change in user api, so I guess this would depend on the policy that @heplesser and @DimitriPlotnikov want to follow (and of the current number of users)
from nestml.
@Silmathoron
While I dont see how that would be impossible, it would mean rearranging the AST as provided by the parser, since this is a grammar problem. I do this on other occasions. In this case it would be during symbol table creation, and a bit overkillish compared to the simple grammar change I proposed.
(Unless there is some grammar magic to be worked here. But I have little knowledge about MC/Antlr)
I have to note again:
This would not be a problem if I would not extend the solution from function declarations to all variables. The function
keyword in the corresponding rule would be enough to distinguish bewteen declarations and assignments.
from nestml.
@PTraeder
Could you, please, write your short feedback, that we should do it and I'll close the issue?.
from nestml.
:=
would be fine.
from nestml.
First a question to ensure that I understand everything correctly:
function f = a + b
definesf
as an alias fora+b
, so that whereverf
appears, it would be replaced bya+b
and upon evaluation use the values ofa
andb
that a current at the moment of evaluationc = a + b
is permitted only in anupdate
section, in thisupdate
section---and only there---operations have a temporal order, and here the expression on the right hand side is evaluated and the resulting value assigned toc
. Later changes toa
andb
do not affect the value ofc
Is this correct? Then, I think, it would make sense to use :=
for the latter case independent of what we do about units. One might then even wonder if one needs the function
keyword.
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:
- Let
a pA
andb nA
: which of the two would be choose as unit off = a + b
? - Let
g nS
andV mV
: then neurosciencist would expect that the currentg * V
has unitspA
---can we infer this automatically?
I assume that people elsewhere have worked on inference of units, but I don't know that literature.
from nestml.
I agree with @heplesser's assessment that the function
keyword is actually not be needed if we use :=
for the assignment of what we earlier called an alias.
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.
from nestml.
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)
from nestml.
Related Issues (20)
- [Feature Request] Continuous input conductance in compartmental models HOT 1
- Error indexing a vector with a local variable
- [feature request] Integrate and Fire mechanism for compartmental models HOT 2
- Use grid cards for NESTML target platform docs HOT 1
- NESTML dependency astropy not happy with new numpy HOT 2
- Add non-default install path option to ``NESTCodeGeneratorUtils.generate_code_for()`` HOT 3
- TODO list compartmental models
- Take ODE-toolbox solver recommendation into account
- Revert to Python 3.8 compatibility for EBRAINS environment
- Add CI stage testing against apt installed NEST
- Emit warning for uninitialised state/parameter/internal variables
- Support priorities for onCondition blocks
- Check NEST initialization of state/parameters/internals HOT 1
- Add model transformer for non-dimensionalisation HOT 1
- Make integers and bools recordable HOT 1
- ``print()`` does not work for variables moved from synapse to neuron
- Rename ``resolution()`` to ``timestep()``
- Check for ANTLR runtime 4.10.1 but 4.13 is installed via requirements.txt HOT 1
- Issue with delta kernel convolution in inline expression HOT 1
- Implement continuous input in NESTML compartmental
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestml.