Is there a way to specify that a camlp4 extension be loaded in to a
topfind script? My best shot so far is below, but the commented code
fails (when uncommented) because it needs the pa_pgsql.cmo extension
to be loaded somewhere. There is no "#syntax ..." in topfind.
I can't really understand why the #camlp4o directive exists ... What
use is it unless you can also load extensions?
Rich.
----------------------------------------------------------
#!/bin/sh
# (*
exec ocaml "$0" "$
"
*) use "topfind";;
#camlp4o;;
#require "unix";;
#require "extlib";;
#require "pcre";;
#require "calendar";;
#directory "../../../freeware/pgocaml";;
#load "pgocaml.cma";;
open Printf
let () =
(* Connect to databases. *)
let old_dbh =
PGOCaml.connect ~host:"localhost" ~port:5430 ~database:"subjectlink" () in
let new_dbh =
PGOCaml.connect ~host:"localhost" ~port:5431
~database:"subjectlink_new" () in
printf "Connected to the databases.n";
(*
let users =
PGSQL(dbh)
"select id, name, is_admin, password, email, registration_date, is_editor
from users" in
printf "Number of users = %dn" (List.length users)
*)
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
.