Skip to content

Base Language and Extensions

Base Language

Language: jetbrains.mps.baselanguage

For a full list of baselanguage bugs and feature request, have a look at this ticket search.

Paste as Java class doesn't work.

Not all newer Java features can be pasted such as the double colon operator(::) and static imports. Loops with more than one variable also don't work.

Set 'Export' flag at the moduleX import

You are using a class that extends another class that is situated in another solution. That means that the export flag for the other solutions should be set in the current module, so that there is automatically a dependency to this module. A better explanation can be found here.

What Java language features are not supported in Base Language?

The following features are not supported (yet):

I have written a function with base language code but doesn't return anything when called

Base Language allows implicit returns that means that the last statement is automatically returned. There are some places where implicit returns are not support such as when return a new ListScope class. Make sure to add a return statement in such places.

Var Variable

Language: jetbrains.mps.baselanguage.varVariable

TextGen not found for concept of X language.

Bug (can't find ticket). Wrong generator order of languages. The generators of language x are executed first and then the generator of the var variable. It should be the other way around. You can specify a custom generation plan to fix this issue.

Closures

Language: jetbrains.mps.baselanguage.closures

Exception when passing closure literal as a parameter in a behaviour method call

Closures can't be used for functional interface types such as java.util.Runnable in behaviour methods (see this ticket)

Collections

How do I create a sequence with one element?

Use the singleton constructor: new singleton<string>("single")

How do convert from a Java ArrayList to a Base Language list?

Use the copy constructor: new arraylist<string>(copy: yourArrayList)

How do I convert base language collections to a Java Stream?

First convert your collection to a list that you downcast to a Java List. Then you can convert it into a stream StreamSupport.stream(list/.spliterator(), false)


Last update: January 28, 2022

Comments

Back to top