piggybox_ has quit [Read error: 110 (Connection timed out)]
Abo-Marwan67 has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
CRathman has joined #ocaml
gaja has quit ["leaving"]
Tetsuo has joined #ocaml
gaja has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
[azoic] has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
pants1 has joined #ocaml
schme has quit [Remote closed the connection]
schme has joined #ocaml
pantsd has quit [Read error: 110 (Connection timed out)]
pants1 has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
pantsd has joined #ocaml
mordaunt has quit ["Konversation terminated!"]
screwt820 has quit [Remote closed the connection]
Abo-Marwan67 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan67 has joined #ocaml
CRathman has quit [Read error: 110 (Connection timed out)]
aij_ has joined #ocaml
aij has quit [Read error: 104 (Connection reset by peer)]
screwt820 has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
slipstream-- has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
aij_ has quit [Remote closed the connection]
slipstream has quit [Read error: 110 (Connection timed out)]
Shammah has joined #ocaml
Shammah has quit ["This computer has gone to sleep"]
olegfink has quit [Read error: 104 (Connection reset by peer)]
olegfink has joined #ocaml
aij has joined #ocaml
crabstick has joined #ocaml
l_a_m has joined #ocaml
_JusSx_ has joined #ocaml
aij has quit [Read error: 104 (Connection reset by peer)]
aij has joined #ocaml
mr_hugo has joined #ocaml
<mr_hugo>
hello
piggybox_ has joined #ocaml
<mr_hugo>
can someone help me with this code: http://pastebin.com/d134eac20 it is supposed to get all the lines of a file in a list, except for the commented ones, i tested in /etc/ld.so.conf but it didn't work properly
<mr_hugo>
an empty list was returned
<pango>
correct, the value you return is final_list, defined line 11
<mr_hugo>
wasn't it supposed to change ?
<mr_hugo>
im adding elements to it
<pango>
where ?
<pango>
you're not
<mr_hugo>
line 6 ?
<pango>
line 6 you're building lists, yes, that get passed recursively to list_aux... How does that affect final_list?
<mr_hugo>
because in line 13 i'm passing final_list as argument to the function ?
<pango>
so ? It gives the initial list value to the function
<mr_hugo>
so how do i change its contents ?
<pango>
you don't, lists are immutable
<mr_hugo>
change as in add contents to it...
<mr_hugo>
:/
<pango>
and final_list is a let binding, not a variable, so it's incorrect to talk about its "content", much less try to change it
<pango>
it's like trying to change the content of 2, or the content of the empty list
Abo-Marwan67 has quit [Read error: 104 (Connection reset by peer)]
screwt820 has quit [Read error: 104 (Connection reset by peer)]
<pango>
your problem is that when the End_of_file exception happens, control goes directly to line 14 and you loose the value of your painstakenly build list
<mr_hugo>
ok
<mr_hugo>
now it works
<mr_hugo>
:P
<pango>
exception handling must happen within the recursive function, so that when it happens you can return the current list value
<pango>
the usual (newbie) trap being to keep the function calls tail recursive, so it doesn't blow up on larger files (around 40k lines)
<mr_hugo>
and i can add more functions to parse different things
<mr_hugo>
this is great yes
<mr_hugo>
ill be going now, thanks for everything ;)
mr_hugo has left #ocaml []
<pango>
bye!
CRathman has joined #ocaml
Demitar has quit [Read error: 113 (No route to host)]
schme has quit [Remote closed the connection]
Shammah has quit ["This computer has gone to sleep"]
<flux>
io is one part in ocaml that doesn't seen always very elegant to use - I blame using exceptions
<pango>
yup
<pango>
turn out not to mix well with functional style
<flux>
if you have a function to convert exceptions to values it's a bit better
<flux>
I wonder what's the performance hit, though.. (not enough for me to benchmark it ;-))
schme has joined #ocaml
<pango>
given how much cycles must be used in operating system bowel, I guess it's way below radar level
<flux>
well, a read might never go the OS, so that depends on the buffer sizes
<pango>
maybe it matters if you read a character at once
<pango>
(that's why C's getc() is a macro, for example)
Demitar has joined #ocaml
schme has quit [Remote closed the connection]
lord_sesshomaru has joined #ocaml
schme has joined #ocaml
Demitar_ has joined #ocaml
Demitar has quit [Connection timed out]
CRathman has quit [Read error: 110 (Connection timed out)]
schme has quit [Read error: 104 (Connection reset by peer)]
Demitar_ has quit [Read error: 110 (Connection timed out)]
schme has joined #ocaml
bluestorm_ has joined #ocaml
kelaouchi has joined #ocaml
seafoodX has quit []
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
Demitar has joined #ocaml
lord_sesshomaru has left #ocaml []
kelaouch1 has joined #ocaml
drice has joined #ocaml
kelaouchi has quit [Read error: 110 (Connection timed out)]
Demitar has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
mordaunt has joined #ocaml
dbueno has joined #ocaml
Mr_Awesome has joined #ocaml
CRathman has joined #ocaml
pango has quit [Excess Flood]
pango has joined #ocaml
leo037 has joined #ocaml
danderson has left #ocaml []
schme has quit [Read error: 104 (Connection reset by peer)]
schme has joined #ocaml
Abo-Marwan95 has joined #ocaml
screwt820 has quit [Read error: 104 (Connection reset by peer)]
Abo-Marwan67 has quit [Read error: 104 (Connection reset by peer)]
screwt862 has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
crabstick_ has joined #ocaml
kelaouch1 has quit [Read error: 104 (Connection reset by peer)]
crabstick has quit [Read error: 110 (Connection timed out)]
pantsd has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
schme has quit [Read error: 104 (Connection reset by peer)]
schme has joined #ocaml
schme` has joined #ocaml
ita has joined #ocaml
schme has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
schme` is now known as schme
EliasAmaral has joined #ocaml
Tetsuo has quit ["Leaving"]
bogdano has joined #ocaml
<hcarty>
What is the method for building a custom toplevel with ocamlbuild?
<hcarty>
The documentation seems to indicate that it's possible, but "ocamlbuild foo.top" says that there are no rules to build that target
_JusSx_ has quit ["leaving"]
Shammah has joined #ocaml
Shammah has quit [Remote closed the connection]
bkudria has joined #ocaml
<bkudria>
can i ask an sml question here, no one seems to be alive in #sml ?
<ita>
bkudria: ask and see
<ita>
if it is enough ml-related
<bkudria>
i have this powerset function: http://pastebin.ca/698956 but this way, power(tl(L)) is computed twice. should i put it into a temp. variable, or what is the correct way to ensure it is computed only once?
<ita>
use a declaration just above ? ("let" ?)
<ita>
temp variable yes
<bkudria>
aah, i'm having a bit of touble with the let syntax. is it "let y = f(x) in dosomething(y) end;" ?