How to activate ocaml trace

294 views
Skip to first unread message

mdasraf...@gmail.com

unread,
Aug 23, 2013, 8:28:18 PM8/23/13
to ocaml...@googlegroups.com
I am using Objective Caml version 3.12.1 in ubuntu. I could not trace my code. When I trace by code its gives a error "Error: Unbound value trace".

Could anybody help me to activate trace in my ocaml. 


Philippe Veber

unread,
Aug 24, 2013, 3:30:59 PM8/24/13
to ocaml...@googlegroups.com
Hi !

Maybe you've forgotten the sharp character before your trace invocation ?

# let rec f n = if n = 0 then 1 else f (n - 1) * n;;
val f : int -> int = <fun>
# #trace f;;
f is now traced.
# f 3;;
f <-- 3                                                                                                                                                     
f <-- 2                                                                                                                                                     
f <-- 1                                                                                                                                                      
f <-- 0
f --> 1
f --> 1
f --> 2
f --> 6
- : int = 6

cheers,
  philippe

I am using Objective Caml version 3.12.1 in ubuntu. I could not trace my code. When I trace by code its gives a error "Error: Unbound value trace".

Could anybody help me to activate trace in my ocaml. 


--
You received this message because you are subscribed to the Google Groups "ocaml-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages