Commit 4bfc47fa authored by Erwan Jahier's avatar Erwan Jahier

Define my own mapchoose since Map.choose is only available since 3.12.0

parent 29e79219
......@@ -5,7 +5,8 @@
include $(LURETTE_PATH)/Makefile.common.source
include $(LURETTE_PATH)/source/Makefile.ln
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
OCAMLFLAGS += -I $(OBJDIR) -I $(OCAMLLIB) -I $(PREFIX)/$(HOSTTYPE)/lib
#-I ~/dd/ocamlnat/_build/src/toplevel/
IDLFLAGS=-nocpp
......@@ -13,11 +14,12 @@ POLKA=polkag
ifdef STATIC
OCAMLLDFLAGS = -cclib -lstdc++ -cclib -lm -cclib -lc -ccopt -static\
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA)_caml -cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
else
OCAMLLDFLAGS= -cclib -lstdc++ -cclib -I/usr/lib/w32api \
-cclib -l$(POLKA)_caml \
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG)
-cclib -l$(POLKA) -cclib -lgmp $(OCAMLOPTFLAG) \
-cclib ~/dd/ocamlnat/_build/src/libocamlnat.a
endif
......
......@@ -163,3 +163,6 @@ Ldbg.apropos \"\";;
for all commands
";
flush stdout
(* let _ = *)
(* Topmain.main() *)
default: compile_all
all: clean compile_all
all: compile_all
#
all-win32: clean
make ltop || make ltop
make compile_all
include $(LURETTE_PATH)/Makefile.common.source
include ./Makefile.ln
......@@ -493,11 +498,16 @@ ldbgbc: $(OBJDIR)
$(MAKE) -k ln -f ../Lurettetop/Makefile.ldbg && \
$(MAKE) -k bcl -f ../Lurettetop/Makefile.ldbg
ldbgnc: $(OBJDIR)
ldbgncl: $(OBJDIR)
cd $(OBJDIR) && \
$(MAKE) -k ln -f ../Lurettetop/Makefile.ldbg && \
$(MAKE) -k ncl -f ../Lurettetop/Makefile.ldbg
ldbgnc: $(OBJDIR)
cd $(OBJDIR) && \
$(MAKE) -k ln -f ../Lurettetop/Makefile.ldbg && \
$(MAKE) -k nc -f ../Lurettetop/Makefile.ldbg
ltop_clean: $(OBJDIR)
cd $(OBJDIR) && $(MAKE) -k clean -f ../*/Makefile.lurettetop
......@@ -684,7 +694,7 @@ cp:
cp $(OBJDIR)/lucky$(EXE) $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/lutin$(EXE) $(BIN_INSTALL_DIR) ;\
cp $(OBJDIR)/show_luc_exe$(EXE) $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/ldbg_exe.top$(EXE) $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/ldbg_exe$(EXE).top $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/check-rif$(EXE) $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/luc2luciole$(EXE) $(BIN_INSTALL_DIR) ; \
cp $(OBJDIR)/lurettetop_exe$(EXE) $(BIN_INSTALL_DIR) ; \
......
......@@ -49,10 +49,19 @@ let (to_expr: t -> Expr.t) =
in
Expr.Op (Expr.Sum, l)
exception Choose_elt of Value.num
let (mapchoose:t -> Value.num) =
fun ne ->
(* only available since ocaml 3.12.0... *)
(* StringMap.choose ne *)
try ignore (StringMap.fold (fun k a acc -> raise (Choose_elt a)) ne 0); (F 0.0) (* dummy *)
with Choose_elt x -> x
let (is_int: t -> bool) =
fun ne ->
assert(ne <> StringMap.empty);
match snd (StringMap.choose ne) with
match (mapchoose ne) with
| I _ -> true
| F _ -> false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment