progs/fun/fun.sc
changeset 975 ae5c03560d4d
parent 955 47acfd7f9096
equal deleted inserted replaced
974:0cb4bf2469d1 975:ae5c03560d4d
   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._