progs/fun/fun.sc
changeset 974 06148fc63273
parent 954 4a7ed272d46e
equal deleted inserted replaced
973:db987b9717a4 974:06148fc63273
   160 }
   160 }
   161 
   161 
   162 // the main compilation function
   162 // the main compilation function
   163 def compile(prog: List[Decl], class_name: String) : String = {
   163 def compile(prog: List[Decl], class_name: String) : String = {
   164   val instructions = prog.map(compile_decl).mkString
   164   val instructions = prog.map(compile_decl).mkString
   165   (library + instructions).replaceAllLiterally("XXX", class_name)
   165   (library + instructions).replace("XXX", class_name)
   166 }
   166 }
   167 
   167 
   168 
   168 
   169 // pre-2.5.0 ammonite 
   169 // pre-2.5.0 ammonite 
   170 // import ammonite.ops._
   170 // import ammonite.ops._