3 ms·
One thing I had to hunt for was what the backslash means in the first examples. Especially as it seems to be used for both string interpolation and function def
by jampekka 3y ago
One thing I had to hunt for was what the backslash means in the first examples. Especially as it seems to be used for both string interpolation and function definition.
But other than that great to have a quite good idea of the language in just a few seconds.
- itishappy 3y agoIt's both string interpolation and (anonymous) function definition. # Function Definition: addAndStringify = \num1, num2 -> Num.toStr (num1 + num2) # String Interpolation: "\(greeting) there, \(audience)!" # desugars to Str.concat greeting (Str.concat " there, " (Str.concat audience "!")) https://www.roc-lang.org/tutorial https://www.roc-lang.org/tutorial