mnabil has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
oriba has quit [Quit: oriba]
mister_m has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
letrec has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Submarine has quit [Ping timeout: 244 seconds]
philtor has quit [Ping timeout: 245 seconds]
abdallah has joined #ocaml
datkin has joined #ocaml
emmanuelux has joined #ocaml
datkin has quit [Remote host closed the connection]
datkin has joined #ocaml
Tobu has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
jimmyrcom has quit [Ping timeout: 260 seconds]
twittard has joined #ocaml
philtor has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
wagle_ has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
Submarine has quit [Ping timeout: 246 seconds]
wagle_ is now known as wagle
Tobu has joined #ocaml
datkin has quit [Ping timeout: 276 seconds]
emmanuelux has quit [Read error: No route to host]
emmanuelux has joined #ocaml
cyphase has quit [*.net *.split]
g0dmoney- has quit [Ping timeout: 244 seconds]
g0dmoney- has joined #ocaml
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
cyphase has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
guru has joined #ocaml
guru is now known as Guest63341
<Guest63341>
im using oasis and after compilation my foo.byte is native. ocamlfind.conf contains ocamlc = "ocp-ocamlc.opt". why might that be ?
mjonsson has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 252 seconds]
<pippijn>
oasis doesn't like libraries where files are distributed over several directories, doe sit?
cyphase has joined #ocaml
<pippijn>
oh, it does, but only if I name the files with uppercase first letter
<pippijn>
does oasis not recognise mlypacks?
mister_m has quit [Quit: Leaving]
twittard has quit [Quit: twittard]
Tobu has quit [Ping timeout: 260 seconds]
* adrien
has never used ml_y_packs
<adrien>
but for oasis, you can use relative paths in most places (not only filenames)
KDr2 has joined #ocaml
Tobu has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
MaskRay has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
itewsh has joined #ocaml
Xizor has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<Guest63341>
'let [x;y] = [1;2]' results in match warning -- any workaround ?
<adrien>
syntax extensions
<Guest63341>
ok -- too complex 4me -- ill use tuples
<adrien>
:-)
<Guest63341>
)
Snark has joined #ocaml
Kikaxa has joined #ocaml
Guest63341 has quit [Ping timeout: 244 seconds]
Kikaxa has left #ocaml []
ttamttam has joined #ocaml
MaskRay has quit [Remote host closed the connection]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Anarchos has joined #ocaml
<jave>
I want to do the equivalent of a forward declaration, but it appears difficult
<jave>
its an existing codebase so its a bit difficult to move declarations around
<albacker>
what is a closure (in memory)
<Anarchos>
jave you can't use ref ?
<Anarchos>
or lazy values ?
<albacker>
why isn't this object being freed
<albacker>
let fresh =
<albacker>
let cnt = ref 0 in
<albacker>
fun () -> cnt := !cnt + 1; !cnt
<albacker>
;;
<adrien>
tring to use forward declarations because something is an existing codebase souds like "I want the minimal number of lines changed, no matter how dirty it's going to be"
<albacker>
fresh () gives 1 the first time, 2 the second, etc.
<flux>
albacker, what should be freed?
<adrien>
it's a toplevel declaration, visible from everywhere, it can't be freed
<albacker>
flux, cnt
<adrien>
cnt is used in "fresh"
<flux>
albacker, and when should it be freed? also, adrien's comment
<albacker>
when fresh finishes execution, why isn't the value set to 'ref 0' again?
<albacker>
the next time it starts execution, to be more precise.
<iZsh>
adrien: let fresh ()
<flux>
albacker, because by the time you say 'fresh', you are referring to the object that refers to the value created when the function definition was evaluated the first time
<flux>
so 'cnt' is created even before you call fresh ()
<flux>
exactly like if you just wrote let fresh = let cnt = ref 0 in ()
<flux>
of course, in this case cnt _is_ thrown away because it isn't reachable
<flux>
albacker, also this doesn't print anything when called, but when it is evaluated: let fresh = print_string "hello\n" in fun () -> ()
<flux>
similarly the expression containing ref is evaluated only once
<albacker>
so cnt is "global" and fresh points to fun () .. which in fact uses cnt
<flux>
well, it's global in its life time, but not in access
<albacker>
ok, would it be the same if we did let cnt = ref 0 in let fresh = fun () -> cnt:=!cnt + 1; !cnt;; or something like this?
<flux>
exactly similar, other than for the visibility of cnt
<flux>
well, exactly if we drop the first 'in'
<flux>
because that's not legal ocaml
<albacker>
yeah tried evaluating this, gave me syntax error.
<adrien>
let fresh =
<adrien>
let cnt = ref 0 in
<adrien>
let fresh = fun () -> cnt:=!cnt + 1; !cnt in
<adrien>
fresh
<adrien>
something like that too
<albacker>
would this happen if we compiled the program
<albacker>
and ran it several times?
<albacker>
would each execution print 1 or would they print increasing numbers?
<adrien>
would what happen?
<albacker>
val fresh : unit -> int = <fun>
<albacker>
# fresh ();;
<albacker>
- : int = 1
<albacker>
# fresh ();;
<albacker>
- : int = 2
<albacker>
this. now imagine i compile the program and print_endline (string_of_int( !cnt))
<albacker>
and run it
<zorun>
cnt doesn't exist
<zorun>
outside your "fresh" function
<albacker>
ok i see what is happening.
<albacker>
thanks
Anarchos has quit [Ping timeout: 260 seconds]
letrec has quit [Read error: Connection reset by peer]
letrec has joined #ocaml
<flux>
albacker, compiled ocaml programs can be thought like they evaluate each expression from top to bottom
<flux>
albacker, so if you execute the program again, the top-level definitions will be evaluated again as well, thus a new execution will always output 1 first
<albacker>
that's why wanted to compile, to see the difference
snarkyboojum_ has joined #ocaml
gnuvince_ has joined #ocaml
lorilan_ has joined #ocaml
hyperbor1ean has joined #ocaml
abdallah has quit [Quit: Ex-Chat]
gmcabrita_ has joined #ocaml
gmcabrita has quit [Disconnected by services]
gmcabrita_ is now known as gmcabrita
rwmjones has quit [*.net *.split]
gnuvince has quit [*.net *.split]
lorilan has quit [*.net *.split]
diml has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
snarkyboojum_ is now known as snarkyboojum
rwmjones has joined #ocaml
diml has joined #ocaml
lorilan_ is now known as lorilan
<thelema>
albacker: consider the difference between `let f = let c = ref 0 in fun () -> incr c; !c` and `let c = ref 0 in let f = fun () -> incr c; !c` and `let f () = let c = ref 0 in fun () -> incr c; !c`
<albacker>
the third one is of type unit -> unit -> int = <fun> while the first pne unit -> int and the second one gives Syntax error.
lorill has joined #ocaml
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<thelema>
albacker: really? oops.
<thelema>
ah, because I used in... replace the "in" with ";;"
skchrko has joined #ocaml
<albacker>
the first one makes a global c which will be accessible from f (only?!), and the 2nd one makes a global c that is accesible from everywhere in the top-level
<thelema>
the first and second both create a *single* c, in the first, it's local, in the second it's global
<thelema>
the third creates a new c each time the outer () is evaluated
ftrvxmtrx_ has joined #ocaml
MaskRay has quit [Remote host closed the connection]
ftrvxmtrx has quit [Ping timeout: 276 seconds]
albacker has quit [Quit: Leaving]
iago has joined #ocaml
asdfhjkl has joined #ocaml
Anarchos has joined #ocaml
caligula__ has joined #ocaml
caligula_ has quit [Ping timeout: 245 seconds]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
<jave>
Anarchos: i might be able to use refs, yes.
<Anarchos>
jave ok :)
<thelema>
jave: for mutual recursion, it's either refs or let ... and ...
avsm has joined #ocaml
<pippijn>
or passing the caller to the callee
KDr2 has quit [Remote host closed the connection]
<thelema>
pippijn: true, I had forgotten about that way of untying the knot
<mrvn>
I'm going to try to do that with recursive modules using first class modules.
jimmyrcom has joined #ocaml
cdidd has quit [Ping timeout: 260 seconds]
itewsh has quit [Quit: o/]
MaskRay has quit [Quit: leaving]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
lorill has quit [Quit: Ex-Chat]
letrec has quit [Ping timeout: 264 seconds]
lorilan has quit [Quit: Quitte]
lorilan has joined #ocaml
oriba has joined #ocaml
albacker has joined #ocaml
<adrien>
ok, checked the ocaml commit log, saw " update version to 4.01.0 after branching of 4.00"
<adrien>
already 6 days ago
ttamttam has quit [Remote host closed the connection]
Drup has joined #ocaml
albacker has quit [Ping timeout: 246 seconds]
<thelema>
adrien: really? hmmm, time to investigate
<thelema>
you're right, it looks like 3.13 will be 4.0
<adrien>
I really wish cross-compilation support would have gone in 4.0
<thelema>
or rather 4.00.0
<adrien>
it's not too late but not very early either
<mfp>
4.00? are there enough compat-breaking changes to justify the change (or is it just because of GADTs?)
<mfp>
gotta check Changes
<adrien>
it also means that we need to get better at public relations before it gets out
<thelema>
there are a ton of good improvements
<thelema>
adrien: very correct, how well we can communicate them will be very important
<adrien>
should be out in June; it leaves some time hopefully
philtor has joined #ocaml
Tobu has quit [Read error: Connection reset by peer]
Tobu has joined #ocaml
<iZsh>
maybe it's jesus day, and they implemented adhoc polymorphism ;)
<chimeracoder>
I'm just getting started with OCaml. Is there a recommended lightweight building/testing framework for a small project?
<chimeracoder>
I'm not very familiar with OCaml, so I'm not looking for anything too elaborate - just some basic tests
<zorun>
define precisely what a "building/testing framework" means
<zorun>
an IDE?
ftrvxmtrx_ has quit [Ping timeout: 246 seconds]
<chimeracoder>
Hm, I'm not being clear - I'm not using an IDE at the moment. I usually only do testing in scripting languages... is this something that should just be incorporating directly into my Makefile, or is there a better way
<chimeracoder>
Right now, my program creates a REPL, and I want to test input/output at that REPL
<thelema>
chimeracoder: your program implements a REPL?
<chimeracoder>
Yeah, it's for a compilers class
<thelema>
The normal way to do unit testing is with OUnit, so as long as you have an API that allows one to push a string into the repl and get the result, it can be used
<chimeracoder>
so my compiled executable is a REPL that accepts its own input (not OCaml)
<thelema>
got it. The ocaml compiler has its own homebrew testing suite that does what you're asking for, but it's really just: run the program with a file piped in, save the output, diff against expected output
philtor has quit [Read error: Operation timed out]
<chimeracoder>
Okay, I mean, my executable can accept a command via STDIN - I can just do this with the shell right now, but I'm keeping an eye out in case it gets more complex
<chimeracoder>
what's the testing suite you're referring to?
<thelema>
chimeracoder: I'd recommend just producing input scripts and expected output files if you really want tests of a REPL without exposing its functionality as an API
<thelema>
If you can programmatically call your REPL, then use OUnit.
<chimeracoder>
Alright, thanks
<chimeracoder>
Yeah, for the REPL that's fine, but I was thinking I might need to write more. :-) Thanks!
chimeracoder has quit [Quit: WeeChat 0.3.7]
datkin has joined #ocaml
Submarine has quit [Remote host closed the connection]
datkin has quit [Remote host closed the connection]
datkin has joined #ocaml
albacker has joined #ocaml
Drup has quit [Quit: Leaving.]
zcero has joined #ocaml
zcero has quit [Quit: Lost terminal]
philtor has joined #ocaml
skchrko has quit [Quit: ChatZilla 0.9.88.1 [Firefox 11.0/20120314111819]]