Vincent Gripon's Homepage

Research and Teaching Blog

OOCaml

OOCaml is a pre-alpha of an idea I would like to develop in the coming years. It uses a pre-processing to transform the syntax of OCaml such that basic types are objects.

It allows some syntaxic sugar such as:

#print ("hello"^(3.5+1)*2);;
hello8 - : unit = ()
#for i = 0 to 3 do print (exp i); done;;
1.2.718281828467.3890560989320.0855369232- : unit = ()
#let rec sum list =
    if list#empty
    then 0
    else list#hd + (sum list#tl)
  ;;
val sum :
  (< empty : bool; hd : < int : int; .. >; 
      tl : 'a; .. > as 'a) -> Oint.oint = <fun> 
# print (sum [1.;2.]);;
3- : unit = ()

Embryonic version available here.





You are the 495886th visitor

Vincent Gripon's Homepage