progs/lecture2.scala
changeset 323 1f8005b4cdf6
parent 320 cdfb2ce30a3d
child 329 8a34b2ebc8cc
equal deleted inserted replaced
322:755d165633ec 323:1f8005b4cdf6
   156 Try({
   156 Try({
   157   val x = 3
   157   val x = 3
   158   val y = 0
   158   val y = 0
   159   Some(x / y)
   159   Some(x / y)
   160 }).getOrElse(None)
   160 }).getOrElse(None)
       
   161 
       
   162 
       
   163 // minOption 
       
   164 // maxOption 
       
   165 // minByOption 
       
   166 // maxByOption
   161 
   167 
   162 // Higher-Order Functions
   168 // Higher-Order Functions
   163 //========================
   169 //========================
   164 
   170 
   165 // functions can take functions as arguments
   171 // functions can take functions as arguments