File tree Expand file tree Collapse file tree 1 file changed +13
-21
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,19 @@ From [lampepfl/dotty-staging.g8](https://github.com/lampepfl/dotty-staging.g8).
8181
8282It will create a project with the necessary dependencies and some examples.
8383
84+ In case you prefer to create the project on your own, make sure to define the following dependency in your build.sbt
85+
86+ ``` scala
87+ libraryDependencies += " ch.epfl.lamp" %% " dotty-staging" % scalaVersion.value
88+ ```
89+
90+ and in case you use ` dotc ` /` dotr ` directly, then use the ` -with-compiler ` flag for both:
91+ ``` shell
92+ dotc -with-compiler -d out Test.scala
93+ dotr -with-compiler -classpath out Test
94+ ```
95+
96+
8497## Example
8598
8699Now take exactly the same example as in [ Macros] ( ./macros.md ) . Assume that we
@@ -104,24 +117,3 @@ val f: Array[Int] => Int = run {
104117
105118f.apply(Array (1 , 2 , 3 )) // Returns 6
106119```
107-
108- Note that if we need to run the main (in an object called ` Test ` ) after
109- compilation we need to make available the compilation to the runtime:
110-
111- ``` shell
112- dotc -with-compiler -d out Test.scala
113- dotr -with-compiler -classpath out Test
114- ```
115-
116- Or, from SBT:
117-
118- ``` scala
119- libraryDependencies += " ch.epfl.lamp" %% " dotty-staging" % scalaVersion.value
120- ```
121-
122- ## Template project
123- Using sbt version ` 1.1.5+ ` , do:
124- ```
125- sbt new lampepfl/dotty-staging.g8
126- ```
127- in the folder where you want to clone the template.
You can’t perform that action at this time.
0 commit comments