dark_light changed the topic of #ocaml to: OCaml 3.09.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/
kencausey has quit ["Time to go, visit me at http://kencausey.com/"]
chessguy has joined #ocaml
icebee_ has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC has never been so good"]
f78 has quit [Read error: 110 (Connection timed out)]
EsotericMoniker has left #ocaml []
asbeta has quit []
fab__ has quit [Read error: 110 (Connection timed out)]
fab__ has joined #ocaml
dark_light has quit [Remote closed the connection]
chessguy has joined #ocaml
jcreigh has joined #ocaml
zak_ has joined #ocaml
pango has quit [Remote closed the connection]
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <-"]
zak_ has quit [Remote closed the connection]
ski has quit [Read error: 110 (Connection timed out)]
shawn_ has quit [Connection timed out]
Smerdyakov has quit ["Leaving"]
shawn_ has joined #ocaml
ski has joined #ocaml
jcreigh has joined #ocaml
ramkrsna has quit [Read error: 110 (Connection timed out)]
_velco has joined #ocaml
Snark has joined #ocaml
beschmi has quit ["Leaving"]
jcreigh has quit ["my bed is calling"]
mikeX has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
velco has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
llama32 has joined #ocaml
Carillon has quit [" HydraIRC -> http://www.hydrairc.com <- IRC for those that like to be different"]
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
_jol_ has joined #ocaml
_jol_ has quit ["leaving"]
<llama32> does ocaml have any standard way of storing structured data in files?
love-pingoo has joined #ocaml
<zvrba> it has serialization library
<llama32> excellent... thanks
finelemon has joined #ocaml
stesch has quit [Read error: 60 (Operation timed out)]
stesch has joined #ocaml
DRMacIve1 has joined #ocaml
finelemo1 has quit [Read error: 110 (Connection timed out)]
DRMacIver has quit [Read error: 110 (Connection timed out)]
icebee_ has quit [Client Quit]
<flux__> infact, atleast two. I like se sexpr-one..
_jol_ has joined #ocaml
nebosuke2 has quit [Read error: 110 (Connection timed out)]
love-pingoo has quit ["Download Gaim: http://gaim.sourceforge.net/"]
zak_ has joined #ocaml
zak_ is now known as llama33
llama32 has quit [Read error: 110 (Connection timed out)]
llama33 has quit ["Leaving"]
_jol_ has quit ["leaving"]
_JusSx_ has joined #ocaml
<zvrba> hm, I have "structure Primes" in primes.ml
<zvrba> together with functor PrimeUtils
<zvrba> and another program which uses that structure
<zvrba> how do I make ocamlopt see primes.ml when compiling the other program?
mikeX has joined #ocaml
<pango> zvrba: I suppose your problem is not about compilation, but about modules...
<pango> since they're in primes.ml, they're called Primes.Primes and Primes.PrimeUtils now
<zvrba> hm, oki.. I thought that too.
<zvrba> now it says Unbound module PrimesTable
<zvrba> in primes.ml I have module PrimesTable : PRIMES =
<zvrba> struct
<zvrba> together with signature PRIMES
<pango> probably Primes.PrimesTable, etc.
<pango> unless you get bored of it, and start using open Primes ;)
<zvrba> where?
<zvrba> in primes.ml or in main program?
<pango> main program
<zvrba> oh, it works now :)
<zvrba> thx
<zvrba> hm, is there some flush function
<zvrba> i have print_int x; print_string "\n" ;
<zvrba> but still I don't get immediate output to stdout
<zvrba> ah, print_endline :)
love-pingoo has joined #ocaml
chessguy has joined #ocaml
DRMacIver has joined #ocaml
chessguy has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
DRMacIve1 has quit [Read error: 110 (Connection timed out)]
chessguy has joined #ocaml
DRMacIve1 has joined #ocaml
<flux__> zvrba, the Printf-module is useful. Printf.printf "%d\n%!" d
chessguy has quit [Connection timed out]
chessguy has joined #ocaml
DRMacIver has quit [Read error: 110 (Connection timed out)]
DRMacIver has joined #ocaml
DRMacIve1 has quit [Read error: 110 (Connection timed out)]
pango has quit ["Leaving"]
pango has joined #ocaml
Wild_Cat has joined #ocaml
velco has quit ["Ex-Chat"]
DRMacIve1 has joined #ocaml
Smirnov has joined #ocaml
<Smirnov> Hi guys, I was looking through the manual and I was wondering where to find functions like print_string, cause I am trying to print a string on its own line and usually languages have their own print_line
<Smerdyakov> Pervasives
mnemonic has joined #ocaml
<Smirnov> Thanks much :)
<Wild_Cat> by the way, is there a function in the Ocaml interpreter similar to Python's dir() -- that is, one that lists the contents of a module?
<Smerdyakov> No. Like type information, module signatures are lost during compilation.
<Wild_Cat> that's too bad. Thanks anyway.
_velco is now known as velco
<mnemonic> hi
DRMacIver has quit [Read error: 110 (Connection timed out)]
sreeram has joined #ocaml
<Smirnov> so ocaml is more like C where it loses type information?
<Wild_Cat> yeah, but in C it's possible to ignore that information at compile-time. Not in Ocaml.
<Smirnov> ok
<Smirnov> so there's no duck typing in ocaml then ?
<ski> in one sense, there is
<love-pingoo> That's not exactly accurate.. in C you need to bypass the type info all the time, in OCaml you don't need -- but you can explicitely do casts too, using black Obj.magic.
<love-pingoo> Smirnov: to me, most of "duck typing" is in structual subtyping
<love-pingoo> OCaml OO has a great structural subtyping scheme, very "ducky"..
<Smerdyakov> Dynamic typing is superceded by static typing, when you have a strong enough type system (like Coq does).
<Wild_Cat> yeah, I think you can say Ocaml uses duck-typing in its OO scheme.
<Smirnov> I haven't done any OO in ocaml yet, :(
<Smerdyakov> Smirnov, good. It's lame. :P
<Wild_Cat> neither have I, only read stuff in tutorials ^^
<Smirnov> I tried doing "foo".length and that didn't work so I gave up
<Smerdyakov> Most OCaml users don't use the OO.
<Smirnov> but i like OO land :-\
<Wild_Cat> but the type inference system validates arguments not from their types, but from the methods/attributes that are used in the function.
<Wild_Cat> Ocaml's OO looks like it's been bolted on.
<love-pingoo> OO in OCaml is worth trying, if you're writing software in OO-friendly domains
<Wild_Cat> guess so. GUIs, for example.
<Smirnov> ocaml looks hardcore
<Smerdyakov> Smirnov, Coq is even more hardcore! It is the future!
<Smirnov> never heard of it
<Smirnov> a "proof management system" ?
<Smirnov> whatever happened to coding
<Smerdyakov> Programming and proving are the same thing.
<love-pingoo> part of "programming" has been explained that way
<Smerdyakov> Nope, it all has. :)
<love-pingoo> Smerdyakov: why aren't you doing haskell by the way ? you should love the separation between pure coq-explainable and dirty I/O code.
<ski> "haskell isn't pure enough"
<Smerdyakov> Haskell is too impure for me.
<love-pingoo> Smirnov: forget about these fights for the moment ;p
<Smirnov> wtf?
<Smerdyakov> This isn't a ridiculous aesthetic squabble; try proving the correctness of your Haskell program and you will see the trouble.
<Smirnov> wow man you guys are hardcore functional people
<love-pingoo> not everybody wants to prove formally correctness (Smirnov probably doesn't care) and not everything can be written in Coq
<love-pingoo> I love that tool, but there are limits, that's all
<Smirnov> i dont even know what correctness is
<love-pingoo> forget about that for now and go enjoy OCaml, then :)
<Smirnov> ok
<Smerdyakov> I disagree. Everything can be written in Coq.
<Smerdyakov> It's a Turing-complete programming language.
<Smerdyakov> (When you use a non-termination monad)
<Smirnov> wow you're not going to believe the homework problem that i just had
<love-pingoo> why are you still using OCaml ? did you every formalized what an IRC client was ? and so on...
* love-pingoo stops trolling
<Smerdyakov> love-pingoo, ATM, I use OCaml to write Coq plug-ins. :)
<Smirnov> Write a function app3 that takes a function needing 3 arguments, followed by each of the 3 arguments, and applies the function to the 3 arguments
<Smirnov> it cant get any more trivial than that
<ulfdoz> use id, it fullfills the spec. ;)
<ski> curried or not (respectively for 'app3' and the argument function) ?
<Smirnov> curried
<Smirnov> they give us the signature
<Smirnov> let app3 f x y z = ...
<Smirnov> i wonder if they think we are in beginning cs?
<ski> ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd
<Smirnov> yes that would be the type
<Smirnov> pretty funny cause you just put f x y z again and you're done
<Smirnov> it takes more writing to invoke that function than to describe it :(
Wild_Cat has quit []
<Smirnov> oh well, i'm sure its gonna get harder, i'm in a programming languages course
love-pingoo has quit ["Download Gaim: http://gaim.sourceforge.net/"]
<Smirnov> Does the word "permutation" carry a special connotation in Ocaml?
Snark has quit ["Leaving"]
Mr_Awesome has joined #ocaml
<ski> not that i know
<Smirnov> Ok they must be talking about a regular permutation then
<Smerdyakov> Smirnov, at which university?
<Mr_Awesome> i have a module B that uses module A, and I'd like to quickly make an interface file to B.ml. however, when i run ocamlc -i A.cmo B.ml i get errors about things in B that are defined in A. is there any way to create an interface file with ocamlc when the module depends on another?
mnemonic has quit ["leaving"]
<Smerdyakov> Mr_Awesome, you're using the recursive module extension? Traditionally, modules _can't_ depend on each other.
<Mr_Awesome> oh, didnt know that
<pango> Smerdyakov: I don't think he meant cross-dependancy
<Smirnov> do I need to do something special to use Int, String, etc?
<Mr_Awesome> i mean B depends on A, not A depends on B
<Smirnov> Smerdyakov: university of illinois at urbana champaign
<Mr_Awesome> Smirnov: hey, im going there in year
<Smirnov> for grad school ?
<Smerdyakov> Mr_Awesome, oh.
jcreigh has joined #ocaml
<Mr_Awesome> as a freshman
<Smirnov> congrats
<Smerdyakov> Mr_Awesome, I just use OCamlMakefile and don't worry about the magic incantations.
<Smirnov> Mr_Awesome: you got accepted already... its september?
<Mr_Awesome> trust me, ill get accepted
<Mr_Awesome> im applying this weekend
<Smirnov> oh you should've said that
<Mr_Awesome> anyway, the ocaml makefile doesnt create .mli files for me
<pango> Mr_Awesome: is the A.cmo really necessary ?
<Smirnov> Int/String? :(
<pango> Mr_Awesome: a possible problem is that, while module names take a capital letter, the module file names start with a lowercase
<Mr_Awesome> my filenames start with lowercase
<Mr_Awesome> i have open A at the top of b.ml, so if i ever try to compile anything with just B, of course i get an error
<Mr_Awesome> but even when i include a.ml or a.cmo, it still gives the same error
<pango> Mr_Awesome: ok then.. here, with a.cmo already build, ocamlc -c -i b.ml works just fine
<pango> maybe it's the -c ?
<Mr_Awesome> why do i need the -c?
<pango> -c Compile only
<Smerdyakov> Mr_Awesome, I didn't know there was any OCaml tool to create mli files automatically.
<Smerdyakov> Mr_Awesome, I can't think of a situation when I'd want to do that.
<Mr_Awesome> its a quick way to get all of the definitions into an mli file, then you edit it later
mnemonic has joined #ocaml
<Smerdyakov> I think it's useful to write your mli files from scratch. Write them before their ml files, even.
<Mr_Awesome> i suppose so
<Smerdyakov> Writing a large ml file before writing its interface is probably a bad idea, and this -i won't save you much time if you use it when the ml file is still small.
<flux__> why would it be a bad idea?
<Smerdyakov> flux__, it's a period of not taking advantage of separation between interface and implementation.
<Smerdyakov> Mr_Awesome, what makes UIUC your first choice?
<flux__> but it's taking advantage of the type inference removing your work or writing types
<flux__> anyway, I usually start without an mli, but when the module reaches a certain size, I use ocamlc -i and then keep maintaining it
<Smerdyakov> The whole point of interface files is that you give values _different_ types in them than in implementations.
<Mr_Awesome> if nothing else, its a good way to find out what ocaml thinks the types are
<flux__> hm, I don't think I'm quite following?
<Mr_Awesome> Smerdyakov: from what i can tell, its one of the best (if not the best) college in illinois
<Smerdyakov> Mr_Awesome, OK, but not in the world or even the country.
<Smerdyakov> flux__, ml file contains : val f : int -> int
<Smerdyakov> flux__, mli file contains : type t val f : t -> t
<Mr_Awesome> Smerdyakov: my parents want me to stay in the midwest
<Smerdyakov> Mr_Awesome, OK, but you should just recognize that that choice is against your best interests.
<Smerdyakov> It's not as big of a deal for undergrad, but going to grad school at UIUC when you have other options would be a big mistake.
<Mr_Awesome> how so? uiuc is great university
<Smerdyakov> For CS, Berkeley, CMU, MIT, and Stanford are much better.
<Mr_Awesome> MIT is out of my league; i dont have that much money
<flux__> smerdyakov, well yes, but for small programs thats not really that essential - single developer
<Smerdyakov> Mr_Awesome, it would be worth taking out loans.
<Smerdyakov> flux__, I use abstraction all the time in single-developer programs.
<Smerdyakov> flux__, it's not a question of what's _necessary_, but rather what is worthwhile.
<flux__> smerdyakov, I think the example was simplifying a bit, usually one (well, I) doesn't do type t = int, but something with a constructor to avoid accidental type errors even within the same module
<Smerdyakov> flux__, I have several examples in code I've written recently of abstract types implemented with int.
<flux__> and if you're using the module from some other module, it's not likely you'll use the concrete type by accident
<flux__> I suppose that's a difference in our styles then
<flux__> s/in/between/
<Mr_Awesome> in my module, i use a function that requires random numbers. should i include Random.self_init () in this module?
zmdkrbou_ has joined #ocaml
zmdkrbou has quit [Read error: 110 (Connection timed out)]
<Smerdyakov> Mr_Awesome, probably
<Mr_Awesome> ok
<Smirnov> How come using Int 5;; gives me an unknown constructor error?
<Smerdyakov> Why wouldn't it?
<Smirnov> cause ocaml-tutorial.org is doing it :(
<Smerdyakov> They probably defined the Int constructor first.
<pango> Num module is not loaded by default (much less opened)
Snark has joined #ocaml
mnemonic has quit ["leaving"]
beschmi has joined #ocaml
<Smirnov> How do you end a match?
<Mr_Awesome> you dont
<Snark> you win or you lose...
<Smerdyakov> Bracket it in parentheses or begin..end if needed for order-of-operations.
<Smirnov> I have a syntax error with http://pastebin.com/782198 not sure where or why
<Smerdyakov> Look again at list syntax.
<Smerdyakov> Though I don't think that would be a cause of a syntax error.
<Smirnov> ah crap
<Smirnov> yeah that should just take a list of a tuple
<Smerdyakov> I assume you know that your use of nested matches doesn't do what you expect.
<Smerdyakov> (Because of your question about "ending matches.")
<Smirnov> I just get a syntax error
<Smerdyakov> I can't help without the error text.
<Mr_Awesome> you need to put parens around the nested match expressions id think
<Smerdyakov> Mr_Awesome, that doesn't affect syntax errors.
<Smirnov> Ok I added some parens and fixed , to ;
<Mr_Awesome> does anything come after or before this code that might be causing an error
<Smirnov> no
<Smirnov> here is my full ocaml session http://pastebin.com/782202
<Smirnov> am I just doing something fundamentally wrong?
<Smerdyakov> Weird.
<Smerdyakov> I don't deal with ;; much, since I write most code in files and compile it.
<Smirnov> do you see what I mean about the error message sucking?
<Mr_Awesome> compiles fine for me
<Smirnov> then why doesnt it work interactively???
<Mr_Awesome> idk, very odd indeed
<Smerdyakov> Also compiles fine for me.
<Smirnov> wtf!
<Smirnov> it doesnt work interactively for either of you guys?
<Smerdyakov> I'm guessing that you were copying and pasting from pastebin.com and got some extra characters, like I did...
<Smerdyakov> It works interactively for me, is what I mean.
<Smirnov> no I was editing in vim and copied and pasted to ocaml interactive
<Mr_Awesome> works interactively for me too
<Smirnov> wtf
<Smerdyakov> Must have pasted some characters that you didn't expect.
<Smerdyakov> Use emacs instead and avoid this business.
<Smerdyakov> (ocaml-mode sends text to a toplevel for you)
<Smirnov> umm.. no holy wars
* Mr_Awesome hates vim/emacs
<Smerdyakov> This isn't a holy war. This is a clear instance of why you'd be better off using Emacs.
<Smirnov> ....
<Mr_Awesome> i use gedit and scite
<Smirnov> gedit is dog
<Smerdyakov> Mr_Awesome, do those have any kind of integration with tools for any functional language?
<Mr_Awesome> integration? no
<Smerdyakov> OK, then you lose in a big way.
<Smirnov> scite probably does
<Mr_Awesome> what is the advantage of emacs' integration tools?
<Smerdyakov> You can run code directly out of the buffer you're editing it in.
<Smerdyakov> No copy-and-paste or manual management of shells.
<Mr_Awesome> you can do that in scite
<Mr_Awesome> you mean just press a key and have it run ocaml my_file.ml and print the results? yeah, scite can do that
<Smerdyakov> Also, try doing any work in interactive theorem proving with any general editor but Emacs.... it's just not possible to do productively.
<Smerdyakov> No, emacs will keep an 'ocaml' process running and send snippets of code to it as you direct; no disk files involved.
<Smirnov> umm ok
<Mr_Awesome> i just cant get used to the way youre supposed to use emacs
<Smirnov> whats wrong with copying and pasting between the vim and ocaml windows?
<Smerdyakov> Smirnov, you just saw what's wrong. You get strange behavior.
<Smerdyakov> And it takes longer.
<Smirnov> i was copying and pasting from wordpad in this case
<Smirnov> i just started to get productive in vim recently and now you want me to switch to emacs?
<Mr_Awesome> ugh, how can you guys like those editors
<Smerdyakov> You don't generally find productive functional programmers who don't use Emacs.
<Smirnov> ocaml is my first functional language
<Mr_Awesome> note to self: use emacs
Snark has quit ["Leaving"]
marcelino has joined #ocaml
stesch has left #ocaml []
marcelino has quit ["Ex-Chat"]
cge has joined #ocaml
<Smirnov> What's with this w32sock.lib error?
<Smerdyakov> I would interpret that message as "Don't use Windows, you schmuck."
Mr_Awesome has quit [Remote closed the connection]
f78 has joined #ocaml
<Smirnov> I know I know, but I'm on a tablet PC and haven't gotten around to installing *nix yet :(
cge has quit [Connection timed out]
SyntaxNinja has joined #ocaml
<SyntaxNinja> greetings from Haskell country ;)
<Smerdyakov> OK!
<SyntaxNinja> heya Smerdyakov
cge has joined #ocaml
cge has quit [Read error: 110 (Connection timed out)]
velco has quit ["I'm outta here ..."]
SyntaxNinja has quit ["Download Gaim: http://gaim.sourceforge.net/"]
Wild_Cat has joined #ocaml
sreeram has quit ["leaving"]
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]