Skip to content

Minor changes to GSOC'14 proposal regarding XML Interpolator #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions gsoc/2014.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,29 @@ Scala features XML literals which desugar to calls of the XML
library. The support for XML literals is part of the parser and the
compiler, and are bound to a single desugared API. Scala 2.10 added
support for generic, customizable string interpolators. Standard ones
are `s"foo = $foo"` or `f"bar = $bar%.2f"`. Quasiquotes, added in
Scala 2.11, show that these interpolators can be implemented by
are `s"foo = $foo"` or `f"bar = $bar%.2f"`.
[Quasi-quotes](http://docs.scala-lang.org/overviews/macros/quasiquotes.html),
added in Scala 2.11, show that these interpolators can be implemented by
macros to support compile-time checking of the syntax inside an
interpolator.

The goal of this project is to design and implement a macro-based
generic XML string interpolator. It should be primarily designed as a
replacement for the XML literal syntax of Scala, and hence would
provide at least all the features of that syntax. For example, the XML
literal
literals

val name = "John"
val span = <span>{ name }</span>
val node = <div>{ span }</div>
node match { case <div><span>{ inner }</span></div> => inner }

could be rewritten as

val name = "John"
val span = xml"<span>$name</span>"
val node = xml"<div>$span</div>"
node match { case xml"<div><span>$inner</span></div>" => inner }

As an additional requirement, this interpolator should be generic with
respect to the actual API that is called by the generated code, called
Expand All @@ -264,8 +267,8 @@ the code.

Required skills:
* Good working knowledge of Scala
* Basic knowledge of def macros and quasiquotes in Scala 2.11
* Good knowledge of XML
* Basic knowledge of [def macros](http://docs.scala-lang.org/overviews/macros/overview.html)

Mentored by
[Sébastien Doeraene](http://people.epfl.ch/sebastien.doeraene)
Expand Down