mfp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
tmaedaZ is now known as tmaeda
<Drk-Sd> :D
tmaeda is now known as tmaedaZ
caligula_ has joined #ocaml
det has quit [Ping timeout: 260 seconds]
det has joined #ocaml
caligula__ has quit [Ping timeout: 260 seconds]
dobby has quit []
joewilliams is now known as joewilliams_away
avsm has quit [Quit: Leaving.]
mutew has joined #ocaml
<mutew> Is there a quick way to reset the ocaml toplevel when running it in the shell?
Drk-Sd has quit [Quit: {'EXIT', Drk-Sd, "bye"}]
mutew has quit [Ping timeout: 276 seconds]
joewilliams_away is now known as joewilliams
ski_ has quit [Quit: Lost terminal]
tmaedaZ is now known as tmaeda
Associat0r has quit [Quit: Associat0r]
pad has joined #ocaml
mutew has joined #ocaml
Mr_Awesome has joined #ocaml
djanderson has joined #ocaml
derdon has quit [Quit: derdon]
elehack has joined #ocaml
bzzbzz has joined #ocaml
yakischloba has quit [Quit: Leaving.]
thrasibule has joined #ocaml
Yoric has quit [Quit: Yoric]
joewilliams is now known as joewilliams_away
bzzbzz has quit [Quit: leaving]
<travisbrady> is there an ocaml library for date and time calculations? I've found the Jane Street one but I'm already using batteries and would prefer something in the stdlib
elehack has quit [Quit: Goodbye...]
mutew has quit [Quit: leaving]
Alpounet has quit [Ping timeout: 265 seconds]
det has quit [Remote host closed the connection]
det has joined #ocaml
travisbrady has quit [Quit: travisbrady]
mutew has joined #ocaml
mutew has quit [Quit: For good!]
yakischloba has joined #ocaml
<thelema> if travis comes back, tell him about http://calendar.forge.ocamlcore.org/
CcSsNET has joined #ocaml
thrasibule has quit [Ping timeout: 246 seconds]
thrasibule has joined #ocaml
det_ has joined #ocaml
det has quit [Read error: Connection reset by peer]
_unK has quit [Remote host closed the connection]
pad has quit [Read error: Connection reset by peer]
Amorphous has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
joewilliams_away is now known as joewilliams
ulfdoz has joined #ocaml
Modius has joined #ocaml
joewilliams is now known as joewilliams_away
boscop has joined #ocaml
yakischloba has quit [Quit: Leaving.]
ttamttam has joined #ocaml
ikaros has joined #ocaml
Modius has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
Submarine has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
Snark has joined #ocaml
fx___ has left #ocaml []
fx_ has joined #ocaml
fx_ has quit [Client Quit]
fx_ has joined #ocaml
jcaose has joined #ocaml
fx_ has quit [Quit: Leaving]
f[x] has joined #ocaml
f[x] has left #ocaml []
pimmhogeling has joined #ocaml
f[x] has joined #ocaml
mattam has quit [Ping timeout: 256 seconds]
avsm has joined #ocaml
Alpounet has joined #ocaml
pimmhogeling has quit [Ping timeout: 272 seconds]
pimmhogeling has joined #ocaml
_zack has joined #ocaml
pimmhogeling has quit [Ping timeout: 272 seconds]
pimmhogeling has joined #ocaml
filz has joined #ocaml
filp has joined #ocaml
filz has quit [Client Quit]
Yoric has joined #ocaml
_andre has joined #ocaml
dark-side has joined #ocaml
dark-side has left #ocaml []
drk-sd` has joined #ocaml
djanderson_ has joined #ocaml
djanderson has quit [Ping timeout: 272 seconds]
djanderson_ is now known as djanderson
slash_ has joined #ocaml
pimmhogeling has quit [Remote host closed the connection]
drk-sd` has quit [Quit: foo]
pimmhogeling has joined #ocaml
derdon has joined #ocaml
slash_ has quit [Quit: leaving]
slash_ has joined #ocaml
slash_ has quit [Client Quit]
slash_ has joined #ocaml
slash_ has quit [Client Quit]
slash_ has joined #ocaml
alp has joined #ocaml
Alpounet has quit [Quit: ``Do what you think you can't do.'']
alp has quit [Client Quit]
Alpounet has joined #ocaml
djanderson has quit [Quit: djanderson]
itewsh has joined #ocaml
Submarine has joined #ocaml
ccasin has joined #ocaml
orbitz has joined #ocaml
valross has quit [Quit: Ex-Chat]
<Gertm> is there an operator in OCaml like Haskell's $ operator?
<Gertm> as in: function $ <take everything here, evaluate and apply it to function>
<ccasin> I don't think there is one built in, but it's probably easy to define
<Gertm> I think so yea, I'm just not sure how to do it :)
<ccasin> let's see
<Gertm> print_endline $ somestr ^ somestr instead of having to do print_endline (somestr ^ somestr)
<Gertm> doesn't have to be $
<f[x]> let (&) f x = f x
<ccasin> will that have the right precedence?
<Gertm> let's try it!
<ccasin> well, it works on your example anyway
<ccasin> of course, the haskell one has the advantage of being inlined for efficiency.
<Gertm> hmm
<Gertm> I'm not sure what that means
<Gertm> (I'm not yet that fluent in deep programming stuff, I just wanna build things :) )
<ccasin> as in, the compiler automatically rewrite it to eliminate the extra function application
<Gertm> ah!
<ccasin> so at run time you don't actually execute the ($) function
<Gertm> ah I see
<ccasin> I'm sure ocaml has a way to indicate to do this as well, but I don't know it
<Gertm> so using the parens will execute faster
<Alpounet> I guess it's possible to do that with camlp4/5
<Gertm> hmm I still have to look in to that, still learning ocaml itself
<Gertm> I read somewhere that camlp4 is like defmacro on steroids
<Gertm> I know the lisp way of making macros and the power of it, so I'm quite anxious to try it
ccasin has quit [Quit: Leaving]
<Alpounet> it's powerful
slash_ has quit [Quit: Lost terminal]
<mfp> Gertm: this one has the right associativity let (@@) f x = f x foo @@ bar @@ baz y <=> foo (bar (baz y)))
<f[x]> actually & and @@ both have the same associativity
mutew has joined #ocaml
<mutew> Is there a way to reset the top-loop in ocaml quickly?
<derdon> mutew: do you mean the interactive shell?
<julm> mutew: Toploop.initialize_toplevel_env ();; perhaps
<thelema> Gertm: camlp4 has the problem that it's external to the ocaml code itself.
ulfdoz has quit [Ping timeout: 246 seconds]
mutew has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
_unK has joined #ocaml
mutew has joined #ocaml
pimmhogeling has quit [Ping timeout: 256 seconds]
itewsh has quit [Quit: There are only 10 kinds of people: those who understand binary and those who don't]
mutew has quit [Ping timeout: 246 seconds]
bzzbzz has joined #ocaml
joewilliams_away is now known as joewilliams
<derdon> is there a lib for syntax highlighting of code?
<Camarade_Tux> well, camlhighlight 1.0 has been announced a few hours ago : http://camlhighlight.forge.ocamlcore.org/
<Camarade_Tux> then, maybe gtksourceview in lablgtk too
<derdon> yes, I want to combine it with lablgtk
<thelema> I wrote the syntax highlighting for gtksourceview
<thelema> for ocaml - it should be pretty good.
<derdon> wow, amazing!
<thelema> There's some decisions about matching taht were made by the main developers, so it's not as rainbow as some might like it, but it should be correct + complete.
<thelema> let me know if it's not. (or fix it yourself, of course)
<derdon> ok, gtksourceview is what I was looking for
pimmhogeling has joined #ocaml
<derdon> thanks a lot mates!
<thelema> you're welcome. enjoy
<derdon> not yet, homework :(
<derdon> 15 pages about the new passport in Germany
yakischloba has joined #ocaml
f[x] has quit [Ping timeout: 248 seconds]
slash_ has joined #ocaml
yziquel has joined #ocaml
<yziquel> hi. why is mlsize_t not simply size_t?
<yziquel> does it happen that one is unsigned long int while the other is unsigned int?
Yoric has quit [Quit: Yoric]
avsm has quit [Ping timeout: 252 seconds]
hyperboreean has quit [*.net *.split]
Ori_B has quit [*.net *.split]
Tianon has quit [*.net *.split]
schme has quit [*.net *.split]
bitbckt has quit [*.net *.split]
zhijie has quit [*.net *.split]
mbishop has quit [*.net *.split]
flux has quit [*.net *.split]
deavid has quit [*.net *.split]
tab has quit [*.net *.split]
munga has quit [*.net *.split]
bitbckt has joined #ocaml
hyperboreean has joined #ocaml
Ori_B has joined #ocaml
Tianon has joined #ocaml
schme has joined #ocaml
zhijie has joined #ocaml
mbishop has joined #ocaml
deavid has joined #ocaml
tab has joined #ocaml
munga has joined #ocaml
flux has joined #ocaml
mal`` has quit [Quit: Coyote finally caught me]
mal`` has joined #ocaml
derdon has quit [Quit: derdon]
filp has quit [Quit: Leaving]
ttamttam has quit [Quit: Leaving.]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
smimou has quit [Quit: bli]
Submarine has quit [Quit: Leaving]
joewilliams is now known as joewilliams_away
arturh has joined #ocaml
_zack has quit [Quit: Leaving.]
tmaeda is now known as tmaedaZ
ulfdoz has quit [Ping timeout: 260 seconds]
<thelema> http://codemonkeyism.com/beware-magical-code/ <- "Magic is non-linear" This just made a lot of sense to me.
<thelema> maybe that's one thing about ocaml - it's very linear.
<thelema> there's not a lot of magic in the implementation (except maybe the type system)
<orbitz> not suer what he means here "Garbage collection works like a charm, up until it doesn’t work anymore"
<thelema> I thought the next line cleared it up - long pauses in program caused by GC
<thelema> you're right - his first point is vague
<thelema> maybe it refers to data that's live according to the GC, but should be collected because it's never going to be used again.
<thelema> the phenomenon of how one can leak memory even with a GC
<orbitz> ah
<orbitz> maybe
<orbitz> Funny how he sugests, basically, using a free function goet getAddress, not trying to put the magi cin the object
<thelema> say again?
<orbitz> His solution to the RMI call 'getAddress'
<thelema> he suggests using a function attached to dao instead of directly to customer to expose some of the magic
<thelema> yes?
<orbitz> is basically to move teh getAddress to a nother class and pass you customer to it
<thelema> I can't agree that another level of indirection is the right answer to this problem...
<orbitz> a lot of boiler palte code in that solution
<thelema> yup.
<orbitz> Yay not having first class functions
<thelema> "everything is leaky abstractions" - agreed?
<orbitz> I'm not sure
derdon has joined #ocaml
<thelema> if you didn't need to simplify what you were abstracting, you wouldn't use an abstraction, would you?
arturh has quit [Quit: Leaving]
<orbitz> sure
<thelema> another way of putting the above is "The map is not the territory"
qwertycute has quit []
Yoric has joined #ocaml
bouzukist has joined #ocaml
<bouzukist> hi
<thelema> hi
<bouzukist> any one have an idea if i can obtain a DIMACS tile type (.cnf) from .ml ?
<bouzukist> file*
* thelema looks up dimacs
Submarine has joined #ocaml
<bouzukist> ?
<bouzukist> no manual on the net :(
<thelema> what is dimacs? I assume you don't mean "Center for Discrete Mathematics and Theoretical Computer Science"
<bouzukist> yes :)
<bouzukist> exactly
<bouzukist> there is any commande to do make file from .ml sourcE?
<thelema> These files are CNF expressions, for satisfiability. What do you mean by turning a .ml file into one of these?
<thelema> .ml files (in this channel) are OCaml source code
<thelema> or do you want a library to generate these files?
<bouzukist> i make a game with ocaml .ml my probleme is making file .cnf asociated to ml for usin SAT-solver
<bouzukist> made*
<bouzukist> (ssorry for my english is too bad llol)
<thelema> you want to make .cnf files to run the DIMACS SAT solver?
<thelema> and you want to it from your OCaml program?
<thelema> how do you have your clauses right now?
<thelema> Looking at the format, it's a very simple format file.
<bouzukist> yes i want to make .cnf to run the SAT
_andre has quit [Quit: *puff*]
<bouzukist> actualy i hate SUDOKU.ml i want to generate .cnf file
<bouzukist> the Ocaml file is already is DONE
<bouzukist> i want to know the NEXT step
<bouzukist> generating .cnf fil from .ml
<thelema> let print_cnf oc clauses = List.print ~sep=" 0\n" ~first:"" ~last:"" (List.print ~sep:" " ~first:"" ~last:"" Int.print) oc clauses
<thelema> pass in a list of lists, with each list indicating what terms to 'or' together, negative numbers indicating the complement of a term, positive numbers indicating a term.
<thelema> This code assumes batteries, btw.
Drk-Sd has joined #ocaml
<bouzukist> :(
<thelema> oc is the output channel to write the data to. let print_to_file clauses = File.with_file_out ~mode:[`create|`trunc] "dimacs.cnf" print_cnf clauses
<thelema> This will wrap print_cnf to print to the file "dimacs.cnf"
<bouzukist> where i put my file sudomu.ml .
<bouzukist> ? in the comande
<thelema> Add the given code to your project and call it to write a dimacs.cnf file
<bouzukist> i 'ill try
<thelema> :( you'll need a bit more...
_unK has quit [Remote host closed the connection]
<bouzukist> complex :( lol ill try
<bouzukist> thanks :)
<thelema> let print_cnf oc clauses = Printf.printf "p cnf %d %d\n" (List.reduce max (List.map List.length clauses)) (List.length clauses); List.print ~sep=" 0\n" ~first:"" ~last:"" (List.print ~sep:" " ~first:"" ~last:"" Int.print) oc clauses
<bouzukist> yes . but where is the file ocaml parameter in the command
<thelema> bouzukist: the 'oc' parameter should be the output channel to the file you want to write to.
<olegfink> bouzukist: what exactly are you trying to do?
<thelema> the wrapper [print_to_file] takes care of that part.
<bouzukist> olegfink: making .cnf file from .ml
<thelema> I think he wants to programmatically generate CNF files per the URL above
<bouzukist> thelema i will re'explain the probleme maybé i talk not corectly
<thelema> go ahead.
<bouzukist> i have Ocaml programe sudoku.ml (caré_magic.ml too)
<bouzukist> i'm usine Ocaml Interpret
<bouzukist> im not compiling i juste loadind the sudoku.ml into ocaml (file>open)
mutew has joined #ocaml
<bouzukist> so my programe is loaded in ocaml (no file created in hard disk) so i can do some teste with using the function sudoku(...);;
<bouzukist> So from the source file .ml i want to make .cnf file (.)
<bouzukist> :) The end
<Alpounet> you want to transform your OCaml code (of the .ml file) to .cnf for the SAT-solver ?
<bouzukist> §YES
<bouzukist> correct
<thelema> bouzukist: can you pastebin your sudoku.ml?
<bouzukist> the file its on my university seession not at home
<bouzukist> sorry i can
<bouzukist> but we can consider a XXXX.ml file
<bouzukist> i just to know using the tools to make me .cnf file
<thelema> any example file you want to convert will help us understand.
<bouzukist> consider the function x,y->x&y;;
<bouzukist> i want the cnf of (its easy this i can do it manualy)
mutew has quit [Quit: leaving]
<bouzukist> there is'nt any manual to .ml or to java or to C to make .cnf file ?
<bouzukist> maybe ill understand more alone
<thelema> the cnf format doesn't describe programming languages (except in very esoteric ways)
<thelema> In general you can't turn a .ml file into a .cnf file.
<bouzukist> ok
<thelema> s/programming languages/programs/
<bouzukist> with java and c there is possibility to turn to .cnf ?
<thelema> no
<bouzukist> ok
<thelema> what output would you want for the program "print 14 / 7"
<thelema> there's no way to represent this program as .cnf
<bouzukist> the cnf is boolean variable
<bouzukist> so .cnf is coding manualy?
<thelema> .cnf is conjunctive normal form - it's possible to describe turing machine computations with it if you're insane, but it's not useful for programming.
<bouzukist> hmm
<bouzukist> anyway thank you
<thelema> good luck in whatever you're doing
<bouzukist> :)
bouzukist has left #ocaml []
pad has joined #ocaml
bouzukist has joined #ocaml
yziquel has quit [Ping timeout: 248 seconds]
bouzukist has left #ocaml []
<flux> thelema, I think that most of the things that are said to be 'leaky abstractions' infact are not. for example some say that sockets are a leaky abstraction because there are things like abrupt disconnections and latency issues. (I think they are part of the package, abstraction, even if the coder doesn't think of them always.)
Snark has quit [Quit: Ex-Chat]
derdon has quit [Quit: derdon]
Drk-Sd has quit [Quit: aw]
jcaose has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
mutew has joined #ocaml
<thelema> treating sockets as files for IO is an abstraction, and sockets aren't really files and behave differently
pimmhogeling has quit [Ping timeout: 245 seconds]
<orbitz> what if you think of files as sockets?
<thelema> the abstraction doesn't go that way
_unK has joined #ocaml
<orbitz> why not?
<thelema> sockets are more complex than files
<orbitz> So? You can consider thsoe other operatiosn NOOP's with files
<thelema> But with files, you can seek, which you can't do with sockets
<thelema> neither is a subset of the other
<orbitz> fair
mutew has quit [Ping timeout: 265 seconds]
Yoric has quit [Quit: Yoric]
yziquel has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop_ has joined #ocaml
Yoric has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
yziquel has quit [Quit: Page closed]
Yoric has quit [Quit: Yoric]
pad has quit [Read error: Connection reset by peer]
Submarine has quit [Quit: Leaving]
pimmhogeling has joined #ocaml
Modius has joined #ocaml
smimou has joined #ocaml
pad has joined #ocaml
avsm has joined #ocaml
boscop_ has quit [Quit: Gxis revido!]
boscop has joined #ocaml
tmaedaZ is now known as tmaeda
mattam has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
yangsx has joined #ocaml