5.16.5.12. Object

Start data section to src/flx_parse.mly[17 /33 ] Next Prev First Last
  1468: object_definition:
  1469:   | OBJECT NAME tvarlist fun_args compound
  1470:     {
  1471:       let sr = rsrange (slift $1) (fst $5)
  1472:       and name = snd $2
  1473:       and return_type = `TYP_none
  1474:       and body = snd $5
  1475:       and args = List.map snd $4 (* elide srcref *)
  1476:       and vs = $3
  1477:       in mkcurry sr name vs args (return_type,None) `Object body
  1478:     }
  1479: 
  1480: 
  1481: 
  1482: parameter_comma_list:
  1483:   | parameter COMMA parameter_comma_list { $1 :: $3 }
  1484:   | parameter { [$1] }
  1485:   | { [] }
  1486: parameter:
  1487:   | NAME COLON arrow { snd $1,typecode_of_expr $3 }
  1488:   | NAME { snd $1,`TYP_none }
  1489:   | VAR NAME COLON arrow { snd $2,`TYP_lvalue (typecode_of_expr $4) }
  1490:   | VAR NAME { snd $2,`TYP_lvalue (`TYP_none) }
  1491: 
End data section to src/flx_parse.mly[17]
Flx functions and procedures are first class citizens: the may both be passed as arguments to procedures, and they may both be be returned from functions. Only functions may be passed to functions.