From b770c69ebce608c27ef6a7560dbb13ffe218bee5 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Sat, 25 Oct 2003 06:24:43 +0000 Subject: [PATCH] Examples updated. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5206 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/ocaml/simple/example_prog.ml | 1 + Examples/ocaml/std_string/runme.ml | 1 + Examples/ocaml/std_vector/example.i | 6 ++---- Examples/ocaml/std_vector/runme.ml | 1 + Examples/ocaml/stl/runme.ml | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Examples/ocaml/simple/example_prog.ml b/Examples/ocaml/simple/example_prog.ml index 5dafdc219..b8bc619e7 100644 --- a/Examples/ocaml/simple/example_prog.ml +++ b/Examples/ocaml/simple/example_prog.ml @@ -1,5 +1,6 @@ (* example_prog.ml *) +open Swig open Example (* Call our gcd() function *) diff --git a/Examples/ocaml/std_string/runme.ml b/Examples/ocaml/std_string/runme.ml index d6a933a1c..f178b9bc2 100644 --- a/Examples/ocaml/std_string/runme.ml +++ b/Examples/ocaml/std_string/runme.ml @@ -1,5 +1,6 @@ (* This example was mostly lifted from the guile example directory *) +open Swig open Example let y = "\205\177" diff --git a/Examples/ocaml/std_vector/example.i b/Examples/ocaml/std_vector/example.i index 385353ade..60285e529 100644 --- a/Examples/ocaml/std_vector/example.i +++ b/Examples/ocaml/std_vector/example.i @@ -8,10 +8,8 @@ %include stl.i /* instantiate the required template specializations */ -namespace std { - %template(IntVector) std::vector; - %template(DoubleVector) std::vector; -} +%template(IntVector) std::vector; +%template(DoubleVector) std::vector; /* Let's just grab the original header file here */ %include "example.h" diff --git a/Examples/ocaml/std_vector/runme.ml b/Examples/ocaml/std_vector/runme.ml index c6c8846f1..6bc206237 100644 --- a/Examples/ocaml/std_vector/runme.ml +++ b/Examples/ocaml/std_vector/runme.ml @@ -1,5 +1,6 @@ (* This example was mostly lifted from the guile example directory *) +open Swig open Example (* repeatedly invoke a procedure with v and an index as arguments *) diff --git a/Examples/ocaml/stl/runme.ml b/Examples/ocaml/stl/runme.ml index 82ac7a044..54146ebe0 100644 --- a/Examples/ocaml/stl/runme.ml +++ b/Examples/ocaml/stl/runme.ml @@ -1,5 +1,6 @@ (* This example was mostly lifted from the guile example directory *) +open Swig open Example let v = new_StringVector C_void