aij has quit [Read error: 104 (Connection reset by peer)]
aij has joined #ocaml
aij has quit [Read error: 104 (Connection reset by peer)]
aij has joined #ocaml
aij has quit [Read error: 104 (Connection reset by peer)]
sladegen has joined #ocaml
aij has joined #ocaml
[azoic] has joined #ocaml
Smerdyakov has joined #ocaml
jlouis_ has joined #ocaml
seafoodX has quit []
jlouis has quit [Read error: 110 (Connection timed out)]
jemfinch has left #ocaml []
Smerdyakov has quit ["Leaving"]
yminsky has quit []
ita has quit [Remote closed the connection]
jlouis has joined #ocaml
mvitale has quit [Read error: 113 (No route to host)]
mvitale_ has quit [Read error: 113 (No route to host)]
jlouis_ has quit [Read error: 110 (Connection timed out)]
nuncanada_ has quit ["Leaving"]
jlouis_ has joined #ocaml
<hcarty>
flux: I don't think you could (easily) use to two simultaneously, but I think part of the focus of camlp5 is to be able to use pre-3.10.0 extensions on 3.10+
<hcarty>
So it would probably be possible
jlouis has quit [Read error: 110 (Connection timed out)]
cmeme has quit [Excess Flood]
cmeme has joined #ocaml
seafoodX has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
authentic has joined #ocaml
crabstick has joined #ocaml
crabstick_ has quit [Read error: 110 (Connection timed out)]
schme has joined #ocaml
[azoic] has quit ["Leaving."]
_JusSx_ has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
joshcryer has joined #ocaml
jlouis has joined #ocaml
_JusSx_ has quit ["leaving"]
schme has quit [Remote closed the connection]
jlouis_ has quit [Read error: 110 (Connection timed out)]
ktne has joined #ocaml
<ktne>
hello
<ktne>
how do i find if something is in a list?
schme has joined #ocaml
Cygal has joined #ocaml
<lde>
ktne: List.mem(q)
jedai has joined #ocaml
<simon>
is there a better way to test for evenness than (i / 2) * 2 = i?
<ktne>
lde thanks
<ktne>
simon isn't there a modulo operator?
<lde>
simon: i mod 2 = 0;;
<ktne>
if you iterate through something you could use a boolean value as iterator
bluestorm_ has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
<simon>
lde, is there a better way than that? like, i & 1
<simon>
or is that meddling with the way the number is represented unnecessarily much?
<ktne>
using mod 2 is standard
<ktne>
i mean, it's the standard way to determine if a number is even
<pango>
it's even possible that the compiler translate between i mod 2 and i & 1, depending on what's faster on the target cpu
<ktne>
i &1 is a good way too
<ktne>
i haven't thought about that
<ktne>
:)
<ktne>
it's actually faster than mod 2 :)
<pango>
(btw OCaml logical and operator is land)
Demitar has quit [Connection timed out]
<bla>
Is there a way I can ensure that my function is tail-recursive? There're places when I'm not sure. ;p
<bla>
Maybe, easier way than compiling with -s and checking if asm func is calling itself.
<bla>
Albeit it's an option too.
<bla>
I guess I could use debugger to check if stack is incrementing...
<bla>
(Maybe I can just ask few questions and learn how to be sure if it's t-r?)
Mr_Awesome has quit ["aunt jemima is the devil!"]
olegfink has quit [Read error: 104 (Connection reset by peer)]
olegfink has joined #ocaml
<flux>
hmm.. it would be useful if ocamlc could be told to disregard .mli-files, and generate.
<flux>
.cmi-files according to the .cmo-file
<flux>
for testing phase that is, when you don't want to hide functions from the toplevel
<flux>
or perhaps ocaml could provide means to see through an .mli
<bla>
I usually force such behaviour with Makefile.
<bla>
It just generates .mli files from .ml after each .ml change.
<pango>
doesn't that defeat the purpose of using .mli files ?
<simon>
pango, ok. it's just that in some languages, i & 2 would actually be slower :)
<simon>
oops, i & 1. and I was thinking of javascript.
<pango>
simon: i & 1
<simon>
in JS, it stores all numbers as doubles, so for i & 1, it'd convert to int, perform the operation and convert back.
<pango>
bla: at least, some of the purposes (that can be seen as a way to make inferred types more easily available)
<bla>
For initial development I guess this suffice. Or for quick-projects. It most importantly defeats purpose of hiding private /objects/.
<pango>
one can argue that .mli should be written before corresponding .ml... But I guess most of the time it's not how things happen ;)
<bla>
;-)
<flux>
yeah, I of course mean the cases where I have my manually updated .mli; otherwise .mli is required anyway
ita has joined #ocaml
gaja_ has quit ["leaving"]
|Jedai| has joined #ocaml
slipstream has joined #ocaml
gaja has joined #ocaml
gaja has quit [Client Quit]
gaja has joined #ocaml
slipstream-- has quit [Read error: 113 (No route to host)]
jedai has quit [Read error: 110 (Connection timed out)]
yminsky has joined #ocaml
ygrek has joined #ocaml
yminsky has quit []
_JusSx_ has joined #ocaml
seafoodX has quit [Read error: 104 (Connection reset by peer)]
seafoodX has joined #ocaml
leo037 has joined #ocaml
yminsky has joined #ocaml
seafoodX has quit []
mvitale_ has joined #ocaml
mvitale has joined #ocaml
Demitar has joined #ocaml
yminsky has quit []
<flux>
hmm.. I wonder if the ocaml runtime guarantees that for example assignment are atomic..
<flux>
being very much single threaded when running ocaml code
lde has quit [Read error: 104 (Connection reset by peer)]
smkl has quit [Remote closed the connection]
<flux>
here's an idea for a campl4 extension: convert top-level-definitions to: let func a b c = .. -> let func a b c = ... let func_ref = ref func let func a b c = !func_ref a b c
<flux>
that's fun when you have a top-level attached to a piece of code and you want to replace functions on the fly
<ita>
javascript ? :-)
<ita>
now how to add new functions on the fly
<flux>
hm, if you're using toplevel, simply?
<flux>
for example I have this piece of code running in another thread calling function func
<flux>
I wrote a function: let snapshot () = let ch = Event.new_channel () in render_func := (fun segs loc -> render_func := do_render; Event.sync (Event.send ch (segs, loc)); do_render segs loc); Event.sync (Event.receive ch)
<flux>
hmh, the function name was actually do_render ;)
<ita>
i meant adding a new function when the code is running
<flux>
I say let (segs, loc) = snapshot () in the toplevel and I receive a sample of arguments the function has received
<flux>
you can add new functions?
<flux>
why couldn't you, with toplevel?
lde has joined #ocaml
<flux>
simply type let new_function () = Printf.printf "hello world";;
<flux>
tada, new function
<flux>
now the trick is to get existing functions to call that
<flux>
and that's what you need the function references for
<ita>
adding from the top-level is the only way
<flux>
well, you can also load new functions from a .cmo with Dynlink?
<ita>
so it cannot work with native code among others
<flux>
and IIRC there's a fork of ocaml that supports loading .cmx-files also
* ita
is looking
<flux>
personally I see the need to an eval-like function is very rare, although plugin-system otoh is nice to have
<ita>
flux: going back to your idea of replacing functions, that system would cost a dereference each time a function is called
seafoodX has joined #ocaml
smkl has joined #ocaml
<flux>
ita, yes. but the point is helping development, where hopefully there are more important aspects than just performance.
<flux>
actually that might also kill polymorphic functions.. one would need to use polymorphic record fields
<ita>
flux: so you will need a way to tag functions as "changeable/not changeable"
<flux>
well, I would be happy with a file-level tagging, but of course someone might want more refined control
<flux>
infact whole-file would be enough for me; debug build
<flux>
it's not often when you want to inspect/change the system at that level
<flux>
but now I'm checking out a piece of code I wrote a couple years ago, which remained in buggy condition
<ita>
so the thing you want is aop in caml
<flux>
not really
<ita>
for debugging/logging
<flux>
well, actually yes, because I view aop being useful only for debugging
<ita>
replacing functions and methods dynamically is that
<flux>
building actual applications with aop would seem like a nightmare to me
<ita>
haha
<ita>
the thing i would prefer is contract programming
<ita>
rather than debugging using function overloads, ensuring pre/post/invariants conditions would be much more useful (and more readable than littering the code with asserts)
<ktne>
eval could work in fsharp
<ktne>
or in other vm-based implementation
<ita>
ktne: go away with fsharp
<ita>
ktne: not everybody wants a wm
<ita>
vm
<flux>
ktne, well, I doubt you can replace functions on the fly in fsharp without aforementioned preparation or very ugly hacking
<flux>
I would like to see an LLVM 2.0-frontend for Ocaml
<flux>
I can't see other technologies but vm-ones finally ending the era of x86 - if ever ;)
<ktne>
x86 is not that bad
<ktne>
in fact it's very good
<flux>
compared to what?
<flux>
for example itanium was very interesting, and even though its performance was never stellar, there was much potential
magnus_ has quit ["Lost terminal"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
Smerdyakov has joined #ocaml
ramkrsna__ has joined #ocaml
mordaunt has quit [Read error: 104 (Connection reset by peer)]
<ktne>
i have here a problem
<ktne>
how do i run something imperative inside a function?
<ktne>
i only did that from the main file so far
seafoodX_ has joined #ocaml
<ktne>
a;b;c will run a b and c and will return c?
<flux>
yes
ramkrsna_ has quit [Read error: 113 (No route to host)]
<flux>
you can also do for example: let () = an_imperative_function () in let () = an_another_imperative_function ()
<ktne>
ah
<ktne>
yes that too
seafoodX has quit [Read error: 110 (Connection timed out)]
bluestorm_ has joined #ocaml
authentic has quit [Connection timed out]
authentic has joined #ocaml
Demitar has quit ["Burn the land and boil the sea. You can't take the sky from me."]
^authentic has joined #ocaml
Demitar has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
nuncanada has joined #ocaml
ygrek has quit [Remote closed the connection]
schme has quit [Read error: 104 (Connection reset by peer)]
schme has joined #ocaml
mvitale has quit [Read error: 113 (No route to host)]
mvitale_ has quit [Read error: 113 (No route to host)]
ygrek has joined #ocaml
lde has quit [No route to host]
seafoodX_ has quit []
lde has joined #ocaml
mordaunt has joined #ocaml
jeremiah has joined #ocaml
ktne has quit []
[azoic] has joined #ocaml
ygrek has quit ["Leaving"]
ygrek has joined #ocaml
jeremiah has quit []
jeremiah has joined #ocaml
jeremiah has quit [Client Quit]
Cygal has quit [Remote closed the connection]
bluestorm_ has quit ["Konversation terminated!"]
smimram has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
Tetsuo has joined #ocaml
schme` has joined #ocaml
schme has quit [Read error: 104 (Connection reset by peer)]
schme` is now known as schme
pango has quit [Remote closed the connection]
pango has joined #ocaml
pango- has joined #ocaml
joshcryer has quit [Nick collision from services.]
joshcryer_ has joined #ocaml
Tetsuo has quit ["Leaving"]
Mr_Awesome has joined #ocaml
_JusSx_ has quit ["leaving"]
leo037 has quit ["merci pour la future 2008.0"]
pango has quit [Remote closed the connection]
pango- has quit [Remote closed the connection]
pango has joined #ocaml
<hcarty>
I can't get the site(s) to load fully, but this OCaml-Java project looks to be quite interesting