Skip to content

Commit

Permalink
Also stub Chez monadic and callcc
Browse files Browse the repository at this point in the history
  • Loading branch information
b-studios committed Dec 12, 2023
1 parent d241d4f commit bd24a6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions effekt/jvm/src/test/scala/effekt/ChezSchemeTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ abstract class ChezSchemeTests extends EffektTests {
examplesDir / "pos" / "issue319.effekt",
examplesDir / "pos" / "maps.effekt",

// splices not yet supported in Chez backends
examplesDir / "pos" / "capture" / "resources.effekt" ,
examplesDir / "pos" / "capture" / "ffi_blocks.effekt",

// bidirectional effects are not yet supported in our Chez backend
examplesDir / "pos" / "bidirectional",

Expand Down Expand Up @@ -73,9 +77,6 @@ class ChezSchemeLiftTests extends ChezSchemeTests {

override def ignored: List[File] = super.ignored ++ List(

// splices not yet supported
examplesDir / "pos" / "capture" / "resources.effekt" ,

// regions are not yet supported
examplesDir / "benchmarks" / "generator.effekt",
examplesDir / "pos" / "capture" / "regions.effekt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,17 @@ trait Transformer {
case Extern.Def(id, tpe, cps, vps, bps, ret, capt, body) =>
chez.Constant(nameDef(id),
chez.Lambda((vps ++ bps) map { p => ChezName(p.id.name.name) },
chez.RawExpr(???)))
toChez(body)))

case Extern.Include(contents) =>
RawDef(contents)
}

def toChez(t: Template[core.Expr]): chez.Expr = t match {
case Template(List(string), Nil) => chez.RawExpr(string)
case _ => sys error "Splices not yet supported in the Chez backend"
}

def toChez(defn: Definition): Either[chez.Def, Option[chez.Expr]] = defn match {
case Definition.Def(id, block) =>
Left(chez.Constant(nameDef(id), toChez(block)))
Expand Down

0 comments on commit bd24a6a

Please sign in to comment.