eclipse / epsilon

Epsilon is a family of Java-based scripting languages for automating common model-based software engineering tasks, such as code generation, model-to-model transformation and model validation, that work out of the box with EMF (including Xtext and Sirius), UML (including Cameo/MagicDraw), Simulink, XML and other types of models.
https://eclipse.org/epsilon
Eclipse Public License 2.0
55 stars 11 forks source link

EOL: Add collection operation `join` as alias for `concat` #18

Closed Arkaedan closed 1 year ago

Arkaedan commented 1 year ago

This is for consistency with other languages including Java, JavaScript, C#, Python, Rust, and PHP

arcanefoam commented 1 year ago

Personally, I am against these aliases (e.g. we could add an alias 'map' for 'collect' - as in other languages) as IMHO, having multiple ways to do the same operation confuses users and adds to the complexity of the language.

kolovos commented 1 year ago

Thanks for the PR! I appreciate the cognitive benefits of consistency with other languages but I'm inclined to agree with @arcanefoam on this one.

Arkaedan commented 1 year ago

In general, I agree that it's better to have just one way to do things. However, this specific case is something that I've seen almost every developer learning Epsilon (that I've worked with) get tripped up by.

Additionally, EOL has plenty of precendence for having multiple ways of doing the same thing. For example:

That being said, maybe the best option is to just update the documentation for concat to mention that is is equivalent to the join method in many other languages. I'd be happy to submit a PR for that if you can point me in the right direction.

arcanefoam commented 1 year ago

@Arkaedan I agree that EOL has other constructs that have alternative names/syntax. However, the motivation for this syntactic sugar is no longer valid and we are now trying to reduce them, as it not only makes the language harder to learn, but also places additional complexity in the execution engines.

That said, the Epsilon's website is also hosted in github: https://github.com/eclipse/epsilon-website. The website is built using mkdocs. So to modify a page, you need to modify the related MD file inside the mkdocs folder. For EOL, the specific file you want to change is <path-to-repo>/mkdocs/docs/doc/eol.md.

After you done the changes, you can build using the publish.sh script in the mkdocs folder and crate a PR.

Will close this PR, but feel free to open it again if you feel there is the need for further discussion.

kolovos commented 1 year ago

This article should also be useful: https://www.eclipse.org/epsilon/doc/articles/manage-the-epsilon-website-locally/