Does anyone know if it's possible to create a DSL ...
# getting-started
g
Does anyone know if it's possible to create a DSL like this:
Copy code
myDsl { 
    1,
    2,
    3,
}
and end up with like a list of
1, 2, 3
somewhere in the DSL's code
🚫 2
j
No, it would be extremely weird as well. what does a comma mean? Why not make a function with a vararg? What you could do is:
Copy code
myDsl {
    +1
    +2
    +3
}
The
+
(or unaryPlus) operator makes a lot more sense, it means we add something to something.