diff --git a/_includes/books.html b/_includes/books.html index bbf2448be6..43c1645053 100644 --- a/_includes/books.html +++ b/_includes/books.html @@ -5,7 +5,7 @@
trait T { ... }
class C extends T { ... }
class C extends D with T { ... }
trait T1; trait T2
class C extends T1 with T2
class C extends D with T1 with T2
c.abort
call or an expansion typecheck error) will produce a compilation error. An error in an expansion of a whitebox implicit macro will just remove the macro from the list of implicit candidates in the current implicit search, without ever reporting an actual error to the user. This creates a trade-off: blackbox implicit macros feature better error reporting, while whitebox implicit macros are more flexible, being able to dynamically turn themselves off when necessary.
diff --git a/_overviews/macros/overview.md b/_overviews/macros/overview.md
index f099131408..8d275f1dad 100644
--- a/_overviews/macros/overview.md
+++ b/_overviews/macros/overview.md
@@ -22,7 +22,7 @@ A subset of def macros, pending a thorough specification, is tentatively schedul
UPDATE This guide has been written for Scala 2.10.0, and now we're well into the Scala 2.11.x release cycle,
so naturally the contents of the document are outdated. Nevertheless, this guide is not obsolete -
everything written here will still work in both Scala 2.10.x and Scala 2.11.x, so it will be helpful to read it through.
-After reading the guide, take a look at the docs on [quasiquotes](/overviews/quasiquotes/intro.html)
+After reading the guide, take a look at the docs on [quasiquotes]({{ site.baseurl }}/overviews/quasiquotes/intro.html)
and [macro bundles](bundles.html) to familiarize yourself with latest developments
that dramatically simplify writing macros. Then it might be a good idea to follow
[our macro workshop](https://github.com/scalamacros/macrology201) for more in-depth examples.
@@ -136,7 +136,7 @@ This also means that the code below won't work for `printf(get_format(), ...)`,
val Literal(Constant(s_format: String)) = format.tree
Typical macros (and this macro is not an exception) need to create ASTs (abstract syntax trees) which represent Scala code.
-To learn more about generation of Scala code, take a look at [the overview of reflection](http://docs.scala-lang.org/overviews/reflection/overview.html). Along with creating ASTs the code provided below also manipulates types.
+To learn more about generation of Scala code, take a look at [the overview of reflection]({{ site.baseurl }}/overviews/reflection/overview.html). Along with creating ASTs the code provided below also manipulates types.
Note how we get a hold of Scala types that correspond to `Int` and `String`.
Reflection overview linked above covers type manipulations in detail.
The final step of code generation combines all the generated code into a `Block`.
diff --git a/_overviews/macros/paradise.md b/_overviews/macros/paradise.md
index 775b3ebc75..b32a293aa4 100644
--- a/_overviews/macros/paradise.md
+++ b/_overviews/macros/paradise.md
@@ -22,7 +22,7 @@ permalink: /overviews/macros/:title.html
Macro paradise is a plugin for several versions of Scala compilers.
It is designed to reliably work with production releases of scalac
,
making latest macro developments available way before they end up in future versions Scala.
-Refer to the roadmap for [the list of supported features and versions](/overviews/macros/roadmap.html)
+Refer to the roadmap for [the list of supported features and versions](roadmap.html)
and visit [the paradise announcement](http://scalamacros.org/news/2013/08/07/roadmap-for-macro-paradise.html)
to learn more about our support guarantees.
@@ -38,11 +38,11 @@ to learn more about our support guarantees.
Some features in macro paradise bring a compile-time dependency on the macro paradise plugin,
some features do not, however none of those features need macro paradise at runtime.
-Proceed to the [the feature list](/overviews/macros/roadmap.html) document for more information.
+Proceed to the [the feature list](roadmap.html) document for more information.
Consult [https://github.com/scalamacros/sbt-example-paradise](https://github.com/scalamacros/sbt-example-paradise)
for an end-to-end example, but in a nutshell working with macro paradise is as easy as adding the following two lines
-to your build (granted you’ve already [set up sbt](/overviews/macros/overview.html#using-macros-with-maven-or-sbt)
+to your build (granted you’ve already [set up sbt](overview.html#using-macros-with-maven-or-sbt)
to use macros).
resolvers += Resolver.sonatypeRepo("releases")
diff --git a/_overviews/macros/roadmap.md b/_overviews/macros/roadmap.md
index 6c24216c8f..5b5e5c5fae 100644
--- a/_overviews/macros/roadmap.md
+++ b/_overviews/macros/roadmap.md
@@ -26,18 +26,18 @@ the new foundation for metaprogramming Scala, which is simpler, more robust and
than the current system based on scala.reflect. We hope that one day scala.meta will supersede scala.reflect
and become the new standard way of doing metaprogramming in Scala.
-| Feature | Scala 2.10 | [Paradise 2.10](/overviews/macros/paradise.html) | Scala 2.11 | [Paradise 2.11](/overviews/macros/paradise.html) | Scala 2.12 | [Paradise 2.12](/overviews/macros/paradise.html) |
+| Feature | Scala 2.10 | [Paradise 2.10](paradise.html) | Scala 2.11 | [Paradise 2.11](paradise.html) | Scala 2.12 | [Paradise 2.12](paradise.html) |
|-----------------------------------------------------------------------------------|---------------------------------|--------------------------------------------------|----------------------------|--------------------------------------------------|-----------------------------|--------------------------------------------------|
-| [Blackbox/whitebox separation](/overviews/macros/blackbox-whitebox.html) | No | No 1 | Yes | Yes 1 | Yes | Yes 1 |
-| [Def macros](/overviews/macros/overview.html) | Yes | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
-| [Macro bundles](/overviews/macros/bundles.html) | No | No 1 | Yes | Yes 1 | Yes | Yes 1 |
-| [Implicit macros](/overviews/macros/implicits.html) | Yes (since 2.10.2) | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
-| [Fundep materialization](/overviews/macros/implicits.html#fundep-materialization) | Yes (since 2.10.5) 3 | Yes 2 | Yes | Yes 1 | Yes | Yes 1 |
-| [Type providers](/overviews/macros/typeproviders.html) | Partial support (see docs) | Yes 2 | Partial support (see docs) | Yes 2 | Partial support (see docs) | Yes 2 |
-| [Quasiquotes](/overviews/quasiquotes/intro.html) | No | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
-| [Type macros](/overviews/macros/typemacros.html) | No | No | No | No | No | No |
-| [Untyped macros](/overviews/macros/untypedmacros.html) | No | No | No | No | No | No |
-| [Macro annotations](/overviews/macros/annotations.html) | No | Yes 2 | No | Yes 2 | No | Yes 2 |
+| [Blackbox/whitebox separation](blackbox-whitebox.html) | No | No 1 | Yes | Yes 1 | Yes | Yes 1 |
+| [Def macros](overview.html) | Yes | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
+| [Macro bundles](bundles.html) | No | No 1 | Yes | Yes 1 | Yes | Yes 1 |
+| [Implicit macros](implicits.html) | Yes (since 2.10.2) | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
+| [Fundep materialization](implicits.html#fundep-materialization) | Yes (since 2.10.5) 3 | Yes 2 | Yes | Yes 1 | Yes | Yes 1 |
+| [Type providers](typeproviders.html) | Partial support (see docs) | Yes 2 | Partial support (see docs) | Yes 2 | Partial support (see docs) | Yes 2 |
+| [Quasiquotes]({{ site.baseurl }}/overviews/quasiquotes/intro.html) | No | Yes 1 | Yes | Yes 1 | Yes | Yes 1 |
+| [Type macros](typemacros.html) | No | No | No | No | No | No |
+| [Untyped macros](untypedmacros.html) | No | No | No | No | No | No |
+| [Macro annotations](annotations.html) | No | Yes 2 | No | Yes 2 | No | Yes 2 |
1 This feature doesn't bring a compile-time or a runtime dependency on macro paradise. This means that neither compiling against your bytecode that uses this feature, nor running this bytecode requires the macro paradise plugin to be present on classpath.
2 This feature brings a compile-time, but not a runtime dependency on macro paradise. This means that compiling against your bytecode that uses this feature will need the plugin to be added to your users' builds, however running this bytecode or results of macro expansions produced by this bytecode doesn't need additional classpath entries.
diff --git a/_overviews/macros/typemacros.md b/_overviews/macros/typemacros.md index f638aebf74..15ed40ae44 100644 --- a/_overviews/macros/typemacros.md +++ b/_overviews/macros/typemacros.md @@ -13,7 +13,7 @@ permalink: /overviews/macros/:title.html **Eugene Burmako** -Type macros used to be available in previous versions of ["Macro Paradise"](/overviews/macros/paradise.html), +Type macros used to be available in previous versions of ["Macro Paradise"](paradise.html), but are not supported anymore in macro paradise 2.0. Visit [the paradise 2.0 announcement](http://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) for an explanation and suggested migration strategy. @@ -30,7 +30,7 @@ Just as def macros make the compiler execute custom functions when it sees invoc Db.Coffees.update(brazilian.copy(price = 10)) println(Db.Coffees.all) -The full source code of the `H2Db` type macro is provided [at GitHub](https://github.com/xeno-by/typemacros-h2db), and this guide covers its most important aspects. First the macro generates the statically typed database wrapper by connecting to a database at compile-time (tree generation is explained in [the reflection overview](http://docs.scala-lang.org/overviews/reflection/overview.html)). Then it uses the NEW `c.introduceTopLevel` API ([Scaladoc](https://scala-webapps.epfl.ch/jenkins/view/misc/job/macro-paradise211-nightly-main/ws/dists/latest/doc/scala-devel-docs/api/index.html#scala.reflect.macros.Synthetics)) to insert the generated wrapper into the list of top-level definitions maintained by the compiler. Finally, the macro returns an `Apply` node, which represents a super constructor call to the generated class. NOTE that type macros are supposed to expand into `c.Tree`, unlike def macros, which expand into `c.Expr[T]`. That's because `Expr`s represent terms, while type macros expand into types. +The full source code of the `H2Db` type macro is provided [at GitHub](https://github.com/xeno-by/typemacros-h2db), and this guide covers its most important aspects. First the macro generates the statically typed database wrapper by connecting to a database at compile-time (tree generation is explained in [the reflection overview]({{ site.baseurl }}/overviews/reflection/overview.html)). Then it uses the NEW `c.introduceTopLevel` API ([Scaladoc](https://scala-webapps.epfl.ch/jenkins/view/misc/job/macro-paradise211-nightly-main/ws/dists/latest/doc/scala-devel-docs/api/index.html#scala.reflect.macros.Synthetics)) to insert the generated wrapper into the list of top-level definitions maintained by the compiler. Finally, the macro returns an `Apply` node, which represents a super constructor call to the generated class. NOTE that type macros are supposed to expand into `c.Tree`, unlike def macros, which expand into `c.Expr[T]`. That's because `Expr`s represent terms, while type macros expand into types. type H2Db(url: String) = macro impl @@ -93,4 +93,4 @@ For example, a type macro used as `TM(2)(3)` in `class C extends TM(2)(3)` can e ### Generating classes and objects -With type macros you might increasingly find yourself in a zone where `reify` is not applicable, as explained [at StackOverflow](http://stackoverflow.com/questions/13795490/how-to-use-type-calculated-in-scala-macro-in-a-reify-clause). In that case consider using [quasiquotes](/overviews/quasiquotes/intro.html), another experimental feature from macro paradise, as an alternative to manual tree construction. +With type macros you might increasingly find yourself in a zone where `reify` is not applicable, as explained [at StackOverflow](http://stackoverflow.com/questions/13795490/how-to-use-type-calculated-in-scala-macro-in-a-reify-clause). In that case consider using [quasiquotes]({{ site.baseurl }}/overviews/quasiquotes/intro.html), another experimental feature from macro paradise, as an alternative to manual tree construction. diff --git a/_overviews/macros/typeproviders.md b/_overviews/macros/typeproviders.md index 99a67437aa..db886a9c4b 100644 --- a/_overviews/macros/typeproviders.md +++ b/_overviews/macros/typeproviders.md @@ -93,7 +93,7 @@ so I refer you to an amazing blog series by Travis Brown for details: [post 1](h ## Public type providers -With the help of [macro paradise](/overviews/macros/paradise.html) and its [macro annotations](/overviews/macros/annotations.html), it becomes +With the help of [macro paradise](paradise.html) and its [macro annotations](annotations.html), it becomes possible to easily generate publicly visible classes, without having to apply workarounds based on structural types. The annotation-based solution is very straightforward, so I won't be writing much about it here. @@ -140,5 +140,5 @@ than bytecode of a full-fledged class. This technique applies to both anonymous ## Blackbox vs whitebox -Both anonymous and public type providers must be [whitebox](/overviews/macros/blackbox-whitebox.html). -If you declare a type provider macro as [blackbox](/overviews/macros/blackbox-whitebox.html), it will not work. +Both anonymous and public type providers must be [whitebox](blackbox-whitebox.html). +If you declare a type provider macro as [blackbox](blackbox-whitebox.html), it will not work. diff --git a/_overviews/macros/untypedmacros.md b/_overviews/macros/untypedmacros.md index 5b1a57c0bd..d03a4f3109 100644 --- a/_overviews/macros/untypedmacros.md +++ b/_overviews/macros/untypedmacros.md @@ -13,7 +13,7 @@ permalink: /overviews/macros/:title.html **Eugene Burmako** -Untyped macros used to be available in previous versions of ["Macro Paradise"](/overviews/macros/paradise.html), +Untyped macros used to be available in previous versions of ["Macro Paradise"](paradise.html), but are not supported anymore in macro paradise 2.0. Visit [the paradise 2.0 announcement](http://scalamacros.org/news/2013/08/05/macro-paradise-2.0.0-snapshot.html) for an explanation and suggested migration strategy. diff --git a/_overviews/quasiquotes/definition-details.md b/_overviews/quasiquotes/definition-details.md index a74ec7e17b..d859b6d136 100644 --- a/_overviews/quasiquotes/definition-details.md +++ b/_overviews/quasiquotes/definition-details.md @@ -115,7 +115,7 @@ The template consists of: ## Val and Var Definitions -`val`s and `var`s allow you to define immutable values and mutable variables respectively. Additionally they can be used to represent [function](/overviews/quasiquotes/expression-details.html#function), [class](#class-definition) and [method](#method-definition) parameters. +`val`s and `var`s allow you to define immutable values and mutable variables respectively. Additionally they can be used to represent [function](expression-details.html#function), [class](#class-definition) and [method](#method-definition) parameters. Each `val` and `var` consistents of four components: modifiers, a name, a type tree and a right hand side: @@ -128,7 +128,7 @@ Each `val` and `var` consistents of four components: modifiers, a name, a type t tpt: universe.Tree =