Skip to content

How do you rewrite your Xtend code? #1264

Answered by msujew
Guite asked this question in Q&A
Discussion options

You must be logged in to vote

@sailingKieler Can we get some input from you? I believe you migrated a fairly sizable Xtext/Xtend code base recently.

Aside from that, we do actually have a few replacements for the things you mentioned in your post @Guite:

polymorphic dispatching

We generate special is<type> methods for each type in your grammar that has a special type indicator return type. It can be used to write code that is very similar to the polymorphic dispatching from Xtend (but not quite as concise). See here for an example.

functional expressions for working with collections

Langium exposes a Stream interface (and an associated stream method to convert any iterable into a stream) that acts as a direct repl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Guite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants