wolfendale / scala-nunjucks

5 stars 1 forks source link

Add a toString for Number class #18

Closed daniel-manning closed 4 years ago

daniel-manning commented 4 years ago

Hardly seems worth it but at the stage where you want to enforce a real string we will have evaluated all the Str classes. Any other way you'ld have to reimplement mkString for Arr.

wolfendale commented 4 years ago

I'm not sure that I'd want to override the toString method itself on these as that has other uses. For example it can be useful to print out the AST of an expression while debugging issues.

If this is to fix #5 maybe just map _.toStr.value over the elements in the array before the call to .mkString?