Scala had XML literals as part of the language!
Apparently Philip Wadler was the person who told them needed it, because the future was XML.
( Walder is big Haskell/PL person)
Apparently Philip Wadler was the person who told them needed it, because the future was XML.
( Walder is big Haskell/PL person)
Around that time it was pretty nice passing around XML, as I was forced to work with VB.Net which also had an XML literal syntax on the backend and Flash/AS3 on the UI.
I had built a POC with E4X that was VERY similar to React/Redux over a decade before React, but the other browser vendors didn't have it... At the time IE and Chrome were shifting towards JSON.
An XML literal in Scala would have been:
// XML literals (to be dropped)
val mails1 = for (from, to, heading, body) <- todoList yield
<message>
<from>{from}</from><to>{to}</to>
<heading>{heading}</heading><body>{body}</body>
</message>
println(mails1)
This was replaced with "XML string interpolation", which // XML string interpolation
val mails2 = for (from, to, heading, body) <- todoList yield xml"""
<message>
<from>${from}</from><to>${to}</to>
<heading>${heading}</heading><body>${body}</body>
</message>"""
println(mails2)