Discussion IRP Areski

De Willforge
Aller à : navigation, rechercher

type point_symbol = Point of string;;

type coordinate_symbol = Coordinate of string;;


type point_container = coordinate_symbol * coordinate_symbol * coordinate_symbol ;;

                          Point "A"
              /             |            \
      Coordinate "X"  Coordinate "Y"   Coordinate "Z"


let point_a = Point "A";;

let x = Coordinate "X";;


type container defines the datastructure of the symbols of entities necessary to build a value of an entity.


type point_container = coordinate_symbol;;


type point_classic = { name : string;
                     x : float;
                     y : float;
                     z : float
                     }


 point_classic is not a container because a container is a datastructure of symbols. float is NOT any symbol.