Commits

Barry Schwartz committed be43f87

Checking in a packed module version. But I'm still playing with how to arrange this library.

  • Participants
  • Parent commits 07a92d3

Comments (0)

Files changed (12)

 #--------------------------------------------------------------------------
 
 CAML2GEOM = caml2geom
+CAML2GEOM_MODULENAME = Caml2geom
 PKGCONFIG = pkg-config
 #OCAMLC = ocamlfind c -g
 #OCAMLOPT = ocamlfind opt -g
 %.cmo: %.ml %.cmi
 	$(OCAMLC) -c $<
 
-%.cmx: %.ml %.cmi
-	$(OCAMLOPT) -c $<
+%.cmx: %.ml %.cmi dll$(CAML2GEOM).so
+	$(OCAMLOPT) -for-pack $(CAML2GEOM_MODULENAME) -c $< -cclib dll$(CAML2GEOM).so
 
 %_stubs.o: %_stubs.c
 	$(OCAMLC) -cc "$(CXX)" -ccopt "$(CXXFLAGS)" -ccopt "$(CPPFLAGS)" -c $<
 
-%.cma: %.cmo
-	$(OCAMLMKLIB) -o $* $< $(LDFLAGS)
-
-%.cmxa: %.cmx
-	$(OCAMLMKLIB) -o $* $< $(LDFLAGS)
-
-dll%.so lib%.a: %_stubs.o
-	$(OCAMLMKLIB) -o $* $< $(LDFLAGS)
-
 #--------------------------------------------------------------------------
 
-default: $(CAML2GEOM).cmi $(CAML2GEOM).cma $(CAML2GEOM).cmxa dll$(CAML2GEOM).so
+UNITS = coord intCoord d2 point
+UNITS_CMO = $(addsuffix .cmo, $(UNITS))
+UNITS_CMX = $(addsuffix .cmx, $(UNITS))
+UNITS_CMI = $(addsuffix .cmi, $(UNITS))
 
-test1: test1.ml $(CAML2GEOM).cmi $(CAML2GEOM).cmo dll$(CAML2GEOM).so
-	$(OCAMLC) -o $@ -dllib `pwd`/dll$(CAML2GEOM).so $(CAML2GEOM).cmo test1.ml
+default: $(addprefix $(CAML2GEOM)., cmi cma cmxa) dll$(CAML2GEOM).so
 
-#test1: test1.ml $(CAML2GEOM).cmi $(CAML2GEOM).cma dll$(CAML2GEOM).so
-#	$(OCAMLC) -o $@ -dllib dll$(CAML2GEOM) $(CAML2GEOM).cma test1.ml
+$(CAML2GEOM).cmo $(CAML2GEOM).cmi: $(UNITS_CMO)
+	$(OCAMLC) -pack -o $@  $(UNITS_CMO)
+
+$(CAML2GEOM).cmx: $(UNITS_CMX)
+	$(OCAMLOPT) -pack -o $@ $(UNITS_CMX)
+
+$(CAML2GEOM).cma: $(CAML2GEOM).cmo
+	$(OCAMLMKLIB) -o $(CAML2GEOM) $^ $(LDFLAGS)
+
+$(CAML2GEOM).cmxa: $(CAML2GEOM).cmx
+	$(OCAMLMKLIB) -o $(CAML2GEOM) $^ $(LDFLAGS)
+
+dll$(CAML2GEOM).so lib$(CAML2GEOM).a: $(CAML2GEOM)_stubs.o
+	$(OCAMLMKLIB) -o $(CAML2GEOM) $< $(LDFLAGS)
+
+test1: test1.ml $(CAML2GEOM).cmi $(CAML2GEOM).cma dll$(CAML2GEOM).so
+	$(OCAMLC) -o $@ -dllib dll$(CAML2GEOM) $(CAML2GEOM).cma test1.ml
 
 clean:
 	rm -f *.[oa] *.so *.cm[ixoa] *.cmxa test1
 
 #--------------------------------------------------------------------------
+
+ocamlobj = $(foreach suffix, cmi cmo cmx, ${1}.${suffix})
+
+$(call ocamlobj, point): coord.cmi
+
+#--------------------------------------------------------------------------

caml2geom.ml

-(*
-  Copyright (c) 2011 Barry Schwartz
-
-  Permission is hereby granted, free of charge, to any person
-  obtaining a copy of this software and associated documentation
-  files (the "Software"), to deal in the Software without
-  restriction, including without limitation the rights to use,
-  copy, modify, merge, publish, distribute, sublicense, and/or sell
-  copies of the Software, and to permit persons to whom the
-  Software is furnished to do so, subject to the following
-  conditions:
-
-  The above copyright notice and this permission notice shall be
-  included in all copies or substantial portions of the Software.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-  OTHER DEALINGS IN THE SOFTWARE.
-*)
-
-module Coord =
-struct
-  type t = float
-  external _get_epsilon : unit -> t = "epsilon_wrapper"
-  let _eps_value = _get_epsilon ()
-  let epsilon = _eps_value
-  external infinity : unit -> t = "infinity_wrapper"
-  external are_near : t -> t -> bool = "are_near_wrapper"
-  external are_near_eps : t -> t -> t -> bool = "are_near_eps_wrapper"
-  external rel_error_bound : t -> t -> bool = "rel_error_bound_wrapper"
-  external rel_error_bound_eps : t -> t -> t -> bool = "rel_error_bound_eps_wrapper"
-end
-
-module IntCoord =
-struct
-  type t = int
-end
-
-module D2 =
-struct
-  module type S =
-  sig
-    type elt
-    type t
-    val make_at_origin : unit -> t
-    val make : elt -> elt -> t
-    val copy : t -> t
-    val coord : t -> int -> elt
-    val set_coord : t -> int -> elt -> unit
-    val length : t -> elt
-    val normalize : t -> unit
-    val ccw : t -> t
-    val cw : t -> t
-    val neg : t -> t
-    val set : t -> t -> unit
-    val add_to : t -> t -> unit
-    val sub_from : t -> t -> unit
-    val mul_by : t -> elt -> unit
-    val div_by : t -> elt -> unit
-  end
-end
-
-module Point : D2.S with type elt = Coord.t =
-struct
-  type elt = Coord.t
-  type t
-  external make_at_origin : unit -> t = "new_point_at_origin_wrapper"
-  external make : elt -> elt -> t = "new_point_wrapper"
-  external copy : t -> t = "copy_point_wrapper"
-  external coord : t -> int -> elt = "point_coord_wrapper"
-  external set_coord : t -> int -> elt -> unit = "set_point_coord_wrapper"
-  external length : t -> elt = "point_length_wrapper"
-  external normalize : t -> unit = "point_normalize_wrapper"
-  external ccw : t -> t = "point_ccw_wrapper"
-  external cw : t -> t = "point_cw_wrapper"
-  external neg : t -> t = "point_neg_wrapper"
-  external set : t -> t -> unit = "point_set_wrapper"
-  external add_to : t -> t -> unit = "point_add_to_wrapper"
-  external sub_from : t -> t -> unit = "point_sub_from_wrapper"
-  external mul_by : t -> elt -> unit = "point_mul_by_wrapper"
-  external div_by : t -> elt -> unit = "point_div_by_wrapper"
-end

caml2geom.mli

-(*
-  Copyright (c) 2011 Barry Schwartz
-
-  Permission is hereby granted, free of charge, to any person
-  obtaining a copy of this software and associated documentation
-  files (the "Software"), to deal in the Software without
-  restriction, including without limitation the rights to use,
-  copy, modify, merge, publish, distribute, sublicense, and/or sell
-  copies of the Software, and to permit persons to whom the
-  Software is furnished to do so, subject to the following
-  conditions:
-
-  The above copyright notice and this permission notice shall be
-  included in all copies or substantial portions of the Software.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-  OTHER DEALINGS IN THE SOFTWARE.
-*)
-
-module Coord :
-sig
-  type t = float
-  val epsilon : t
-  external infinity : unit -> t = "infinity_wrapper"
-  external are_near : t -> t -> bool = "are_near_wrapper"
-  external are_near_eps : t -> t -> t -> bool = "are_near_eps_wrapper"
-  external rel_error_bound : t -> t -> bool = "rel_error_bound_wrapper"
-  external rel_error_bound_eps : t -> t -> t -> bool = "rel_error_bound_eps_wrapper"
-end
-
-module IntCoord :
-sig
-  type t = int
-end
-
-
-module D2 :
-sig
-  module type S =
-  sig
-    type elt
-    type t
-    val make_at_origin : unit -> t
-    val make : elt -> elt -> t
-    val copy : t -> t
-    val coord : t -> int -> elt
-    val set_coord : t -> int -> elt -> unit
-    val length : t -> elt
-    val normalize : t -> unit
-    val ccw : t -> t
-    val cw : t -> t
-    val neg : t -> t
-    val set : t -> t -> unit
-    val add_to : t -> t -> unit
-    val sub_from : t -> t -> unit
-    val mul_by : t -> elt -> unit
-    val div_by : t -> elt -> unit
-  end
-end
-
-module Point : D2.S with type elt = Coord.t
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type t = float
+external _get_epsilon : unit -> t = "epsilon_wrapper"
+let _eps_value = _get_epsilon ()
+let epsilon = _eps_value
+external infinity : unit -> t = "infinity_wrapper"
+external are_near : t -> t -> bool = "are_near_wrapper"
+external are_near_eps : t -> t -> t -> bool = "are_near_eps_wrapper"
+external rel_error_bound : t -> t -> bool = "rel_error_bound_wrapper"
+external rel_error_bound_eps : t -> t -> t -> bool = "rel_error_bound_eps_wrapper"
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type t = float
+val epsilon : t
+external infinity : unit -> t = "infinity_wrapper"
+external are_near : t -> t -> bool = "are_near_wrapper"
+external are_near_eps : t -> t -> t -> bool = "are_near_eps_wrapper"
+external rel_error_bound : t -> t -> bool = "rel_error_bound_wrapper"
+external rel_error_bound_eps : t -> t -> t -> bool = "rel_error_bound_eps_wrapper"
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+module type S =
+sig
+  type elt
+  type t
+  val make_at_origin : unit -> t
+  val make : elt -> elt -> t
+  val copy : t -> t
+  val coord : t -> int -> elt
+  val set_coord : t -> int -> elt -> unit
+  val length : t -> elt
+  val normalize : t -> unit
+  val ccw : t -> t
+  val cw : t -> t
+  val neg : t -> t
+  val set : t -> t -> unit
+  val add_to : t -> t -> unit
+  val sub_from : t -> t -> unit
+  val mul_by : t -> elt -> unit
+  val div_by : t -> elt -> unit
+end
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+module type S =
+sig
+  type elt
+  type t
+  val make_at_origin : unit -> t
+  val make : elt -> elt -> t
+  val copy : t -> t
+  val coord : t -> int -> elt
+  val set_coord : t -> int -> elt -> unit
+  val length : t -> elt
+  val normalize : t -> unit
+  val ccw : t -> t
+  val cw : t -> t
+  val neg : t -> t
+  val set : t -> t -> unit
+  val add_to : t -> t -> unit
+  val sub_from : t -> t -> unit
+  val mul_by : t -> elt -> unit
+  val div_by : t -> elt -> unit
+end
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type t = int
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type t = int
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type elt = Coord.t
+type t
+external make_at_origin : unit -> t = "new_point_at_origin_wrapper"
+external make : elt -> elt -> t = "new_point_wrapper"
+external copy : t -> t = "copy_point_wrapper"
+external coord : t -> int -> elt = "point_coord_wrapper"
+external set_coord : t -> int -> elt -> unit = "set_point_coord_wrapper"
+external length : t -> elt = "point_length_wrapper"
+external normalize : t -> unit = "point_normalize_wrapper"
+external ccw : t -> t = "point_ccw_wrapper"
+external cw : t -> t = "point_cw_wrapper"
+external neg : t -> t = "point_neg_wrapper"
+external set : t -> t -> unit = "point_set_wrapper"
+external add_to : t -> t -> unit = "point_add_to_wrapper"
+external sub_from : t -> t -> unit = "point_sub_from_wrapper"
+external mul_by : t -> elt -> unit = "point_mul_by_wrapper"
+external div_by : t -> elt -> unit = "point_div_by_wrapper"
+(*
+  Copyright (c) 2011 Barry Schwartz
+
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following
+  conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+  OTHER DEALINGS IN THE SOFTWARE.
+*)
+
+type elt = Coord.t
+type t
+val make_at_origin : unit -> t
+val make : elt -> elt -> t
+val copy : t -> t
+val coord : t -> int -> elt
+val set_coord : t -> int -> elt -> unit
+val length : t -> elt
+val normalize : t -> unit
+val ccw : t -> t
+val cw : t -> t
+val neg : t -> t
+val set : t -> t -> unit
+val add_to : t -> t -> unit
+val sub_from : t -> t -> unit
+val mul_by : t -> elt -> unit
+val div_by : t -> elt -> unit
+
+(*
+external make_at_origin : unit -> t = "new_point_at_origin_wrapper"
+external make : elt -> elt -> t = "new_point_wrapper"
+external copy : t -> t = "copy_point_wrapper"
+external coord : t -> int -> elt = "point_coord_wrapper"
+external set_coord : t -> int -> elt -> unit = "set_point_coord_wrapper"
+external length : t -> elt = "point_length_wrapper"
+external normalize : t -> unit = "point_normalize_wrapper"
+external ccw : t -> t = "point_ccw_wrapper"
+external cw : t -> t = "point_cw_wrapper"
+external neg : t -> t = "point_neg_wrapper"
+external set : t -> t -> unit = "point_set_wrapper"
+external add_to : t -> t -> unit = "point_add_to_wrapper"
+external sub_from : t -> t -> unit = "point_sub_from_wrapper"
+external mul_by : t -> elt -> unit = "point_mul_by_wrapper"
+external div_by : t -> elt -> unit = "point_div_by_wrapper"
+*)
 
 (*-----------------------------------------------------------------------*)
 
+let c = Coord.epsilon
+
 let p = Point.copy (Point.make_at_origin ()) ;;
 Point.set_coord p 1 50. ;;
 let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;