HTML examples garbled
[My first send was to the wrong address. I've now diagnosed the
problem.]
On Mon, 2007-10-15 at 13:53 -0700, Ross Boylan wrote:
> I tried to run the examples on
> http://www.recherche.enac.fr/opti/facile/doc/manual004.html
> but couldn't.
The problem is that various special characters such as "~" and "%d"
didn't make the transition from the source to the web page (or at least,
the web page as displayed by the browser).
>
> The second one clearly has some garbled syntax where it should print out
> the results. None of my efforts to fix it produced something that
> worked. I'm very new to OCaml.
For example, I didn't realize I needed a ~ for integer operations.
My toy example and the your corrected examples (I tried only the first)
now worrk.
>
> The first one gives me
> $ ./facile -I +facile eg1.ml
> File "eg1.ml", line 10, characters 11-30:
> This expression has type bool but is here used with type Facile.Cstr.t
>
> I did ocamlmktop -o facile -I +facile facile.cma as you suggested before
> doing this.
>
> I'm on Debian GNU/Linux with
> libfacile-ocaml-dev 1.1-5
> ocaml-nox 3.09.2-9
>
> Ross Boylan
>
> P.S. I tried the examples because my testprogram
> open Facile
> open Easy
>
> let _ =
> (* Variables *)
> let a = Fd.interval 0 9 and b = Fd.interval 0 9 in
> (* Constraints *)
> (*
> Cstr.post (((fd2e a) + (fd2e b)) = i2e 4);
> *)
> Cstr.post( fd2e a < i2e 3);
> Cstr.post( fd2e b < i2e 2);
> (* Goal *)
> let var_list = [a; b] in
> let goal = Goals.List.labeling var_list in
> if Goals.solve goal then begin
> Printf.printf "a="; Fd.fprint stdout a;
> Printf.printf " b="; Fd.fprint stdout b;
> print_newline () end
>
> gives
> File "rb1.ml", line 11, characters 10-27:
> This expression has type bool but is here used with type Facile.Cstr.t
> I tried the constraints in the comments first.
Reply to: