-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c54281e
commit b63a60f
Showing
7 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package austronesian | ||
|
||
import language.dynamics | ||
|
||
import anticipation.* | ||
import hellenism.* | ||
|
||
class Proxy(name: Text, singleton: Boolean) extends Dynamic: | ||
transparent inline def applyDynamic(method: String)(inline arguments: Any*) | ||
(using classloader: Classloader) | ||
: Any = | ||
${Austronesian2.proxy('name, 'method, 'arguments, 'classloader, 'singleton)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package austronesian | ||
|
||
import scala.quoted.* | ||
|
||
import anticipation.* | ||
import hellenism.* | ||
import wisteria.* | ||
|
||
object Restorable extends ProductDerivation[[Type] =>> Type is Restorable]: | ||
given Text is Restorable: | ||
def restore(value: Expr[Stdlib])(using Quotes, Classloader): Expr[Text] = | ||
'{ if $value.isInstanceOf[String] then $value.asInstanceOf[Text] | ||
else throw new RuntimeException() } | ||
|
||
given Int is Restorable: | ||
def restore(value: Expr[Stdlib])(using Quotes, Classloader): Expr[Int] = | ||
'{ if $value.isInstanceOf[Int] then $value.asInstanceOf[Int] | ||
else throw new RuntimeException() } | ||
|
||
inline def join[DerivationType <: Product: ProductReflection]: DerivationType is Restorable = | ||
new Restorable: | ||
type Self = DerivationType | ||
|
||
def restore(value: Expr[Stdlib])(using quotes: Quotes, classloader: Classloader) | ||
: Expr[Self] = | ||
|
||
import quotes.reflect.* | ||
given Type[DerivationType] = compiletime.summonInline[Type[DerivationType]] | ||
|
||
val x: Symbol = TypeRepr.of[DerivationType].typeSymbol.primaryConstructor | ||
|
||
println(x) | ||
??? | ||
|
||
|
||
trait Restorable: | ||
type Self | ||
|
||
def restore(value: Expr[Stdlib])(using Quotes, Classloader): Expr[Self] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package austronesian | ||
|
||
|
||
object Example: | ||
def run(name: Any): Unit = | ||
println(s"Hello, $name!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters