Comments (5)
Steph, that's a great idea. However, should capacity definition allow default values?
For agent or behavior actions, it would be clear.
from sarl.
Yes, I guess.
It may be very helpful for the capacity caller to have default values.
We may discuss on the default parameters in Skills.
I have in my mind the default value in the C++.
Let the Capacity is analog to the declaration in the header, and the Skill is analog to the definition in the code file. It is common to define the default values in the header file and not in the code file.
Consequently, the best practice is to define the default values in the Capacity, and not in the Skill.
Is it possible to generate a compilation error when a default value is written in the Skill?
from sarl.
I propose the following syntax:
def myAction1(a : String, b : int = 35) { CODE1 }
def myAction2(a : String, b : int = 35, c : char) { CODE2 }
The generated Java functions will be:
public void myAction1(String a, int b) { CODE1 }
public void myAction1(String a) { myAction1(a, 35); }
public void myAction2(String a, int b, char c) { CODE2 }
public void myAction2(String a, char c) { myAction2(a, 35, c); }
from sarl.
Let the following code with ambiguity:
def myAction(a : char, b : int = 1, c : int = 2, d : char) { }
The generated Java code may be:
public void myAction(char a, int b, int c, char d) { }
public void myAction(char a, int b, char d) { myAction(a,b,2,d); }
public void myAction(char a, char d) { myAction(a,1,2,d); }
from sarl.
Since we are using Xtext 2.6, (issue #93), the jvm inferrer and the validator are not working any more.
from sarl.
Related Issues (20)
- Add SRE when exporting a runnable Jar. HOT 1
- Integration tests written in SARL are not generated in the correct Java source folder.
- JVM shared library does not contain JNI_Create JavaVM symbol HOT 3
- Eclipse error on the editor state. HOT 1
- Use MutabilityDetector for implementing the SARL function purity detector.
- Stack overflow in Eclipse IDE.
- Generate a product for MacOS ARM
- Invalid build date in the Bundle property messages.
- Upgrade to Eclipse 2023-09
- Include BDI engine is SARL.
- Fix CodeQL configuration to compile SARL on the CI server.
- Typo error in sarl-maven-plugin
- Invalid function call resolution.
- Link to demos are not working from the website HOT 1
- Kernel logs are not displayed anymore HOT 2
- Create a sample project from welcome page does not work anymore HOT 1
- Invalid markdown rendering in FAQ.
- Damaged product for macOS HOT 3
- Specification and implementation of communication protocols
- ExecutorService vs Thread with task buffer.
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 sarl.