ocaml - Difference in program behavior with different make files -


i have ocaml program

open core.std;; open printf;;  let l = list.fold ~f:(&&) ~init:true l;;  let l = list.fold ~f:(||) ~init:false l;;  let main () = let bools = [true; false; true; true; false; true] in   printf "%b %b\n" (all bools) (any bools);; main();; 

and 2 make files, first

all: a.out     @true  a.out: fold.cmx     ocamlfind ocamlopt -g -linkpkg -package core -package core_kernel -thread -w -10 fold.cmx  fold.cmx: fold.ml fold.cmi     ocamlfind ocamlopt -g -c fold.cmx -package core -package core_kernel -thread -w -10 fold.ml  fold.cmi: fold.mli     ocamlfind ocamlopt -g -c -package core -package core_kernel -thread -w -10 fold.mli  fold.mli: fold.ml     ocamlfind ocamlc -i -package core -package core_kernel -thread -w -10 fold.ml > fold.mli  clean:     @rm *.cmx *.cmi *.o tests 2>/dev/null || true 

which produces a.out gives expected output of false true. second is

all: fold     @true  fold: fold.cmx     ocamlfind ocamlopt -g -o fold -linkpkg -package core -package core_kernel -thread -w -10 fold.cmx  fold.cmx: fold.ml fold.cmi     ocamlfind ocamlopt -g -c fold.cmx -package core -package core_kernel -thread -w -10 fold.ml  fold.cmi: fold.mli     ocamlfind ocamlopt -g -c -package core -package core_kernel -thread -w -10 fold.mli  fold.mli: fold.ml     ocamlfind ocamlc -i -package core -package core_kernel -thread -w -10 fold.ml > fold.mli  clean:     @rm *.cmx *.cmi *.o tests 2>/dev/null || true 

which produces fold on machine, hangs without output. difference between 2 1 of them puts output in fold , other puts in a.out. version numbers ocaml, ocamlc, ocamlopt, , ocamlfind 4.02.1 , opam show core says it's version 112.06.01. of guys know what's causing difference?

you running standard fold program. try ./fold.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -