mfurr changed the topic of #ocaml to: OCaml 3.08.2 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
smimou has quit ["?"]
monochrom has quit ["Few people understand "understanding"."]
vodka-goo has quit [":q!"]
smkl_ has joined #ocaml
humasect has quit [Read error: 110 (Connection timed out)]
Sonarman has joined #ocaml
cjohnson has joined #ocaml
gim__ has joined #ocaml
gim_ has quit [Read error: 110 (Connection timed out)]
vezenchio has joined #ocaml
a-zwei has quit []
gim__ has quit [Read error: 110 (Connection timed out)]
gim__ has joined #ocaml
monochrom has joined #ocaml
smkl_ has quit [Read error: 110 (Connection timed out)]
mbh has quit ["leaving"]
CLxyz has joined #ocaml
smkl_ has joined #ocaml
cjohnson has quit ["i retire"]
Sonarman has quit [Read error: 60 (Operation timed out)]
smkl_ has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
monochrom has quit ["Few people understand "understanding"."]
smkl_ has joined #ocaml
Msandin has joined #ocaml
smkl_ has quit [Read error: 110 (Connection timed out)]
xqw has quit ["Abandonando"]
mlh has quit [Client Quit]
juhammed has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
Snark has joined #ocaml
__DL__ has joined #ocaml
juhammed has joined #ocaml
smkl_ has joined #ocaml
smimou has joined #ocaml
zzorn has joined #ocaml
zzorn is now known as zzorn_away
vodka-goo has joined #ocaml
pango has joined #ocaml
gim__ is now known as gim
Banana has quit [Read error: 110 (Connection timed out)]
grirgz has joined #ocaml
smimou has quit ["?"]
vodka-goo has quit []
Msandin has quit [Read error: 104 (Connection reset by peer)]
skylan_ has joined #ocaml
skylan has quit [Connection reset by peer]
smkl_ has quit [Read error: 110 (Connection timed out)]
Submarine has quit ["Leaving"]
smkl_ has joined #ocaml
Herrchen has joined #ocaml
vezenchio has quit ["We learn from history that we learn nothing from history"]
cognominal has quit [Read error: 60 (Operation timed out)]
cognominal has joined #ocaml
smkl_ has quit [Read error: 110 (Connection timed out)]
humasect has joined #ocaml
cognominal has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
Submarine has joined #ocaml
smkl_ has joined #ocaml
Nutssh has quit [Read error: 60 (Operation timed out)]
<cognominal> why does not ocaml support "functions" with zero parameters?
<Smerdyakov> Why is that better than unit?
<mauke> how would you call them?
<cognominal> I want a function that retunrs a 5x5 matrix filled with zeros
<cognominal> can't I force a call with foo() ?
<mauke> () is the unit value
<cognominal> ok, so I can call it
<Submarine> let foo () = ...
<mauke> foo must accept a value for that to work
<cognominal> now how can I define it
<Submarine> foo()
<cognominal> thx
<mauke> let foo () = Array.make_matrix 5 5 0;;
<mauke> heh, let foo _ = Array.make_matrix 5 5 0;; would work too
CosmicRay has joined #ocaml
<Smerdyakov> Knowing OCaml, I wouldn't be surprised if that were less efficient at runtime. ;)
cognominal has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
Demitar has joined #ocaml
cognominal has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
stef_ has joined #ocaml
cognominal has quit [Read error: 54 (Connection reset by peer)]
Msandin has joined #ocaml
Skal_ has joined #ocaml
goomba has joined #ocaml
palomer has joined #ocaml
<palomer> I have a huge .ml file
<palomer> with many modules
<palomer> and id like to know the type of one of the functions in one of the modules
<palomer> how do I do this?
<Snark> look at the .mli ?
<palomer> there is none:(
<mflux> ocamlc -i generates one for you
<palomer> let get_char m = if m.eof then raise End_of_file else...
<palomer> mflux: nice
_fab has quit [Read error: 60 (Operation timed out)]
<palomer> now, ocaml says that m is of some record type
<palomer> yet that record type doesn't have an eof component!
<mflux> is that eof declared in the same or another module?
<palomer> oh, righto
<palomer> nevermind
zzorn_away is now known as zzorn_afk
<palomer> why does ocaml have 2 exception raising keywords: raise and failwith?
<Smerdyakov> failwith isn't a keyword.
<rossberg_> neither is a keyword, both are functions
<Smerdyakov> raise needs to be built in somehow, though. failwith is a regular function you could implement yourself on top of raise.
Skal_ has quit ["Client exiting"]
<Submarine> failwith is a convenience function
<Smerdyakov> There's no such thing in SML because precedence rules make it easier to just do: raise Fail "Message"
<Smerdyakov> (One reason to make 'raise' a keyword)
rossberg_ is now known as rossberg
humasect_ has joined #ocaml
pango has quit ["Leaving"]
humasect has quit [Connection reset by peer]
<palomer> done; failwith "fell off infinite while?!"
<palomer> with Found_token t -> m.token <- t;
<palomer> what does that syntax mean?
mrvn has joined #ocaml
humasect_ is now known as humasect
mrvn_ has quit [Read error: 110 (Connection timed out)]
Skal_ has joined #ocaml
vodka-goo has joined #ocaml
smimou has joined #ocaml
Banana has joined #ocaml
stef_ has quit [Read error: 54 (Connection reset by peer)]
cognominal has joined #ocaml
_fab has joined #ocaml
mattam has joined #ocaml
monochrom has joined #ocaml
monochrom has quit [Remote closed the connection]
monochrom has joined #ocaml
<palomer> hoho
<palomer> hulle mono
<palomer> even hello
<monochrom> hollu!
pango has joined #ocaml
pango has quit [Client Quit]
m3ga has joined #ocaml
pango has joined #ocaml
mlh has joined #ocaml
<palomer> let oldState = if !dfa_state < -1 then ((-2) - !dfa_state) else !dfa_state in dfa_state := -1; other expressions
<palomer> that let binding is only valid in dfa_state := -1, right?
<palomer> not in other_expressions
<smimou> no
<smimou> it's also valid in other_expr
<palomer> but when does the scope end?
<palomer> as soon as there's a line without a semicolon?
<smimou> at the end of the function
<palomer> whoa, that's crazy
<palomer> in sml let bindings are only valid within 1 expression
<Snark> seems logical...
Msandin has quit [Read error: 110 (Connection timed out)]
<smimou> (let oldState = if !dfa_state < -1 then ((-2) - !dfa_state) else !dfa_state in
<smimou> dfa_state := -1
<smimou> );
<smimou> other expressions
<palomer> which seems logical?
<smimou> would be ok I gues
<smimou> +s
<palomer> is the oldstate binding valid outside that expression?
<Snark> palomer: no, because of the parenthesis
<palomer> gah
<palomer> without the parenthesis, when does the expression end?
<smimou> at the end of the function...
<palomer> that's insane
<smimou> no it's not
<Snark> palomer: the value of expr1; expr2; ...; exprn is the value of exprn
<Snark> so that the whole block is a valid scope for a let binding
<palomer> expr1; expr2;... is not a block for me
<palomer> begin expr1;expr2;... is
cjohnson has joined #ocaml
<palomer> done; failwith "fell off infinite while?!"
<palomer> with Found_token t -> m.token <- t;
<palomer> m.token
<palomer> that code is very ambiguous to me
<palomer> does the with apply to the previous "code block" who's 2 last expressions are done; failwith "fell off infinite while?!" ?
<palomer> what about m.token, does it belong to the exception handling?
<Snark> I would say yes
<mauke> "with" is part of try .. with
<palomer> try while true do is how the "block" starts
<palomer> so its true while .... do ... done; failwith "fell off infinite while?!" with Found_token t -> m.token <- t; m.token
<palomer> so the with applies to the do ... done; and to failwith "...", correct?
<mauke> what do you mean by "the with applies to"?
<palomer> try while true do ... done ; failwith ".." with Found ...
<palomer> meaning, the with will try to catch anything that's thrown in the do ... done or in the failwith
<mauke> it will catch anything thrown between "try" and "with"
<palomer> gotcha
Snark has quit ["Leaving"]
vodka-goo has quit [Remote closed the connection]
vodka-goo has joined #ocaml
humasect_ has joined #ocaml
humasec__ has joined #ocaml
humasect has quit [Connection timed out]
humasec__ is now known as humasect
humasect_ has quit [Read error: 110 (Connection timed out)]
vodka-goo has quit []
vodka-goo has joined #ocaml
Submarine has quit ["Leaving"]
Sonarman has joined #ocaml
CosmicRay has quit ["Client exiting"]
zzorn_afk is now known as zzorn
palomer has quit ["Leaving"]
<cognominal> what is the simpler way to split a string in its consitutant characters? or integer encodings if there is no such thing as a char?
<cognominal> ho, the type char exists
<monochrom> Some "explode" function in the string module maybe?
smkl_ has quit [Read error: 110 (Connection timed out)]
<monochrom> Yuck, I can't find one either...
<Smerdyakov> You can write your own in 10.8 seconds. ;)
<smimou> there's one in extlib I think else
<monochrom> Use the stream library instead. :)
Demitar has quit ["Terminated with extreme prejudice - dircproxy 1.0.5"]
<Smerdyakov> Use SML instead. :O
<monochrom> Stream.of_string ---> get a stream, now use Stream.next, Stream.empty, Stream.iter, ...
zzorn has quit ["zzzzzz"]
<monochrom> Actually you can probably encode what you want to do into a call to String.iter.
<cognominal> String.iter will probably do it.
<Smerdyakov> Why no String.fold? That's just lame.
<monochrom> Agreed.
<Smerdyakov> Again, see SML. ;)
<mattam> that would make you think it's functional
<monochrom> hahahaha
<Smerdyakov> mattam, it is in SML.
<mattam> i know, but it isn't in ocaml
<Smerdyakov> Silly OCaml.
<monochrom> mattam is trying to say ocaml isn't functional :)
<mattam> i say string isn't a functional, immutable string
<monochrom> Oops sorry.
<mattam> i find it a very sensible decision
<mattam> like most of the 'discussed' choices made by the ocaml team
smimou has quit ["?"]
<Smerdyakov> I don't know. I prefer to make things functional by default, and I think that should include types with built-in construction syntax.
kuribas has joined #ocaml
skylan_ is now known as skylan
<cognominal> what is the ocaml equivalent of the C break to exit a loop?
<Riastradh> Use recursive functions instead of the syntactic looping constructs.
<cognominal> there is no syntaxic soap for someone who is not yet functionally cabled?
<grirgz> use exceptions
<Riastradh> Yuck. No, become functionally 'cabled.'
<grirgz> :)
__DL__ has quit [Remote closed the connection]