progs/while-arrays/compile_arrays.sc
changeset 869 81ee93b87258
parent 829 dc3c35673e94
child 870 739039774cee
equal deleted inserted replaced
868:8fb3b6d3be70 869:81ee93b87258
   212 // and run with
   212 // and run with
   213 //
   213 //
   214 //    java arr/arr
   214 //    java arr/arr
   215 
   215 
   216 // automating the above
   216 // automating the above
   217 import ammonite.ops._
   217 
       
   218 // pre-2.5.0 ammonite 
       
   219 // import ammonite.ops._
       
   220 
       
   221 // post 2.5.0 ammonite
       
   222 import $ivy.`com.lihaoyi::os-lib:0.8.0` 
       
   223 import os._
       
   224 
       
   225 
   218 
   226 
   219 def compile_to_file(bl: Block, class_name: String) : Unit = 
   227 def compile_to_file(bl: Block, class_name: String) : Unit = 
   220   write.over(pwd / s"$class_name.j", compile(bl, class_name))  
   228   write.over(pwd / s"$class_name.j", compile(bl, class_name))  
   221 
   229 
   222 def compile_and_run(bl: Block, class_name: String) : Unit = {
   230 def compile_and_run(bl: Block, class_name: String) : Unit = {