Hi Artyom, I believe what is happening is that current Scala actually has literals defined as part of the language. It also relies on a library called scala-xml to actually model and work with the parsed xml literals; the monadic-html project uses a stripped down version of scala-xml that is included in the project.
However, I've heard that nextgen Scala (dotty) will use XML interpolation like: val myXml = xml"<someXml></someXml>" So maybe not quite as nice, but it saves complexity in the compiler in a "post-XML era"; I don't think this has been implemented in dotty as yet: When I try I get the following error: |value `xml` is not a member of StringContext - did you mean `StringContext.s`? This implies that it will indeed be done as a library, when can presumably be overridden by using Scala Implicit classes to perhaps supply your own StringContext, but it sounds like there are a few competing solutions that are yet to be fleshed out. On Wednesday, March 28, 2018 at 3:25:10 AM UTC-4, Artyom Shalkhakov wrote: > > Hi Brandon, > > On Saturday, March 10, 2018 at 3:50:19 AM UTC+6, Brandon Barker wrote: >> >> There is a small part of a project >> <https://github.com/OlivierBlanvillain/monadic-html> I'd like to convert >> to ATS where linear types could be helpful in tracking cancellation of >> running tasks (and other things I'm probably forgetting just now, but are >> on the issue tracker). The part >> <https://github.com/OlivierBlanvillain/monadic-html/blob/master/monadic-rx/shared/src/main/scala/mhtml/rx.scala> >> >> I'm interested in tackling here implements referentially transparent >> methods on reactive variables. I'm sure I can find a way to do this without >> traits (mixins) but want to maintain as direct a port as possible. I have a >> feeling the answer may involve templates. >> >> The other part of the project would be cool too, but it kind of depends >> on xml literals being a thing (or later, XML interpolation): using scala.js >> to write web pages that depend on these reactive variables. It is quite a >> fun little framework. >> > > Seems like a lot of fun! How does it work? I was at some point thinking of > faking HTML/XML literals in ATS using a preprocessor > <https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/ashalkhakov/html2pats> > ... > -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/19f154fa-9fb5-415f-a2af-bd591b921ccb%40googlegroups.com.
