Skip to content

Commit 299af9b

Browse files
committed
fix Github -> GitHub
1 parent 01e2838 commit 299af9b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ja/overviews/macros/typemacros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def マクロがコンパイラが特定をメソッドの呼び出しを見つ
2626
Db.Coffees.update(brazilian.copy(price = 10))
2727
println(Db.Coffees.all)
2828

29-
`H2Db` マクロの完全なソースコードは [Github にて](https://github.com/xeno-by/typemacros-h2db)提供して、本稿では重要な点だけをかいつまんで説明する。まず、マクロは、コンパイル時にデータベースに接続することで静的に型付けされたデータベースのラッパーを生成する。(構文木の生成に関しては[リフレクションの概要](http://docs.scala-lang.org/ja/overviews/reflection/overview.html)にて説明する) 次に、<span class="label success">NEW</span> `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)) を用いて生成されたラッパーをコンパイラによって管理されているトップレベル定義のリストに挿入する。最後に、マクロは生成されたクラスのスーパーコンストラクタを呼び出す `Apply` ノードを返す。<span class="label warning">注意</span> `c.Expr[T]` に展開される def マクロとちがって型マクロは `c.Tree` に展開されることに注意してほしい。これは、`Expr` が値を表すのに対して、型マクロは型に展開することによる。
29+
`H2Db` マクロの完全なソースコードは [GitHub にて](https://github.com/xeno-by/typemacros-h2db)提供して、本稿では重要な点だけをかいつまんで説明する。まず、マクロは、コンパイル時にデータベースに接続することで静的に型付けされたデータベースのラッパーを生成する。(構文木の生成に関しては[リフレクションの概要](http://docs.scala-lang.org/ja/overviews/reflection/overview.html)にて説明する) 次に、<span class="label success">NEW</span> `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)) を用いて生成されたラッパーをコンパイラによって管理されているトップレベル定義のリストに挿入する。最後に、マクロは生成されたクラスのスーパーコンストラクタを呼び出す `Apply` ノードを返す。<span class="label warning">注意</span> `c.Expr[T]` に展開される def マクロとちがって型マクロは `c.Tree` に展開されることに注意してほしい。これは、`Expr` が値を表すのに対して、型マクロは型に展開することによる。
3030

3131
type H2Db(url: String) = macro impl
3232

@@ -41,7 +41,7 @@ def マクロがコンパイラが特定をメソッドの呼び出しを見つ
4141
object Db extends H2Db("coffees")
4242
// equivalent to: object Db extends Db$1("coffees")
4343

44-
合成クラスを生成してその参照へと展開するかわりに、型マクロは `Template` 構文木を返すことでそのホストを変換することもできる。scalac 内部ではクラス定義とオブジェクト定義の両方とも `Template` 構文木の簡単なラッパーとして表現されているため、テンプレートへと展開することで型マクロはクラスやオブジェクトの本文全体を書き換えることができるようになる。このテクニックを活用した例も [Github](https://github.com/xeno-by/typemacros-lifter)みることができる。
44+
合成クラスを生成してその参照へと展開するかわりに、型マクロは `Template` 構文木を返すことでそのホストを変換することもできる。scalac 内部ではクラス定義とオブジェクト定義の両方とも `Template` 構文木の簡単なラッパーとして表現されているため、テンプレートへと展開することで型マクロはクラスやオブジェクトの本文全体を書き換えることができるようになる。このテクニックを活用した例も [GitHub](https://github.com/xeno-by/typemacros-lifter)みることができる。
4545

4646
type H2Db(url: String) = macro impl
4747

@@ -58,7 +58,7 @@ def マクロがコンパイラが特定をメソッドの呼び出しを見つ
5858

5959
## 詳細
6060

61-
型マクロは def マクロと型メンバのハイブリッドを表す。ある一面では、型マクロはメソッドのように定義される (例えば、値の引数を取ったり、context bound な型パラメータを受け取ったりできる)。一方で、型マクロは型と同じ名前空間に属し、そのため型が期待される位置においてのみ使うことができるため、型や型マクロなどのみをオーバーライドすることができる。(より網羅的な例は [Github](https://github.com/scalamacros/kepler/blob/paradise/macros211/test/files/run/macro-typemacros-used-in-funny-places-a/Test_2.scala) を参照してほしい)
61+
型マクロは def マクロと型メンバのハイブリッドを表す。ある一面では、型マクロはメソッドのように定義される (例えば、値の引数を取ったり、context bound な型パラメータを受け取ったりできる)。一方で、型マクロは型と同じ名前空間に属し、そのため型が期待される位置においてのみ使うことができるため、型や型マクロなどのみをオーバーライドすることができる。(より網羅的な例は [GitHub](https://github.com/scalamacros/kepler/blob/paradise/macros211/test/files/run/macro-typemacros-used-in-funny-places-a/Test_2.scala) を参照してほしい)
6262

6363
<table>
6464
<thead>

overviews/macros/typemacros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Just as def macros make the compiler execute custom functions when it sees invoc
2626
Db.Coffees.update(brazilian.copy(price = 10))
2727
println(Db.Coffees.all)
2828

29-
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 <span class="label success">NEW</span> `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. <span class="label warning">NOTE</span> 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.
29+
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 <span class="label success">NEW</span> `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. <span class="label warning">NOTE</span> 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.
3030

3131
type H2Db(url: String) = macro impl
3232

@@ -41,7 +41,7 @@ The full source code of the `H2Db` type macro is provided [at Github](https://gi
4141
object Db extends H2Db("coffees")
4242
// equivalent to: object Db extends Db$1("coffees")
4343

44-
Instead of generating a synthetic class and expanding into a reference to it, a type macro can transform its host instead by returning a `Template` tree. Inside scalac both class and object definitions are internally represented as thin wrappers over `Template` trees, so by expanding into a template, type macro has a possibility to rewrite the entire body of the affected class or object. You can see a full-fledged example of this technique [at Github](https://github.com/xeno-by/typemacros-lifter).
44+
Instead of generating a synthetic class and expanding into a reference to it, a type macro can transform its host instead by returning a `Template` tree. Inside scalac both class and object definitions are internally represented as thin wrappers over `Template` trees, so by expanding into a template, type macro has a possibility to rewrite the entire body of the affected class or object. You can see a full-fledged example of this technique [at GitHub](https://github.com/xeno-by/typemacros-lifter).
4545

4646
type H2Db(url: String) = macro impl
4747

@@ -58,7 +58,7 @@ Instead of generating a synthetic class and expanding into a reference to it, a
5858

5959
## Details
6060

61-
Type macros represent a hybrid between def macros and type members. On the one hand, they are defined like methods (e.g. they can have value arguments, type parameters with context bounds, etc). On the other hand, they belong to the namespace of types and, as such, they can only be used where types are expected (see an exhaustive example [at Github](https://github.com/scalamacros/kepler/blob/paradise/macros211/test/files/run/macro-typemacros-used-in-funny-places-a/Test_2.scala)), they can only override types or other type macros, etc.
61+
Type macros represent a hybrid between def macros and type members. On the one hand, they are defined like methods (e.g. they can have value arguments, type parameters with context bounds, etc). On the other hand, they belong to the namespace of types and, as such, they can only be used where types are expected (see an exhaustive example [at GitHub](https://github.com/scalamacros/kepler/blob/paradise/macros211/test/files/run/macro-typemacros-used-in-funny-places-a/Test_2.scala)), they can only override types or other type macros, etc.
6262

6363
| Feature | Def macros | Type macros | Type members |
6464
|--------------------------------|------------|-------------|--------------|

sips/pending/_posts/2013-06-30-async.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ simplifications).
291291

292292
1. [The Scala Futures API][1]
293293
2. [The Play! Framework][2]
294-
3. [Scala Async on Github][3]
294+
3. [Scala Async on GitHub][3]
295295

296296
[1]: http://docs.scala-lang.org/overviews/core/futures.html "ScalaFutures"
297297
[2]: http://www.playframework.com/ "Play"

sips/sip-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ process anyway so it's better to get them out up front.
110110
4. [Alternative Libraries/Implementations][4]
111111
5. [Discussion forum/post/gitter/IRC][5]
112112

113-
[1]: http://github.com "Github"
113+
[1]: http://github.com "GitHub"
114114
[2]: http://www.scala-lang.org/api/ "Scaladoc"
115115
[3]: http://en.wikipedia.org/wiki/Academic_publishing "Academic/Research"
116116
[4]: https://github.com/dogescript/dogescript "Alternatives"

0 commit comments

Comments
 (0)