mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<hcarty> Jeff_123: Plotting rainfall!
<Jeff_123> hey that does sound neat. What are you using to model teh butterflies? :)
<Smerdyakov> A room full of butterflies
<hcarty> What else?
<hcarty> Jeff_123: It's all satellite data, so no physical modeling at this point
Tetsuo has quit ["Leaving"]
Jeff_123 has quit []
<Yoric[DT]> Well, anyway, goodnight everyone.
hkBst has quit ["Konversation terminated!"]
<Yoric[DT]> Have a nice end-of-year-rush-shopping-and-holidays.
Yoric[DT] has quit ["Ex-Chat"]
smimou has quit ["bli"]
postalchris has joined #ocaml
qpu has joined #ocaml
jlouis_ has joined #ocaml
wy has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
postalchris has quit ["Leaving."]
jlouis_ has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
qpu has quit []
yminsky has joined #ocaml
buluca has quit [Read error: 110 (Connection timed out)]
qpu has joined #ocaml
seafood_ has quit []
mordaunt has joined #ocaml
dibblego has joined #ocaml
brooksbp has joined #ocaml
qpu has quit []
<orbitz> hello
<orbitz> Smerdyakov: hello sir
wy__ has joined #ocaml
wy__ has quit [Read error: 104 (Connection reset by peer)]
qpu has joined #ocaml
mordaunt has quit [Read error: 104 (Connection reset by peer)]
qpu has quit []
brooksbp has quit []
qpu has joined #ocaml
kmeyer is now known as lmeyer
lmeyer is now known as kmeyer
qpu is now known as qpu|away
qpu|away is now known as qpu
qpu is now known as qpu|away
qpu|away is now known as qpu
Nutssh has joined #ocaml
mng has joined #ocaml
Snark has joined #ocaml
dibblego has quit [Remote closed the connection]
thermoplyae has quit ["daddy's in space"]
ygrek has joined #ocaml
kelaouchi has joined #ocaml
ttamttam has joined #ocaml
ttamtta1 has joined #ocaml
ttamtta1 has left #ocaml []
ttamttam has left #ocaml []
|Catch22| has quit [Read error: 104 (Connection reset by peer)]
|Catch22| has joined #ocaml
TaXules has quit [Remote closed the connection]
wy has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
Yoric[DT] has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Associat0r has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
<flux> hm, that visualization in subtext (subtextual.org) presentation would be fun to see being generated from existing code
<flux> of course, I'm at 4 minutes of the video, so perhaps I'll see that it wouldn't work or perhaps see something more interesting ;)
Soleil has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
moglum has joined #ocaml
filp has joined #ocaml
smimou has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
mattam has quit ["Lost terminal"]
Demitar has joined #ocaml
moglum has quit []
Demitar has quit [calvino.freenode.net irc.freenode.net]
asmanur has joined #ocaml
buluca has joined #ocaml
Demitar has joined #ocaml
Anarchos has joined #ocaml
qpu is now known as qpu|away
TaXules has joined #ocaml
mattam has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
Demitar has quit [Read error: 110 (Connection timed out)]
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
filp has quit [Remote closed the connection]
hkBst has quit ["Konversation terminated!"]
filp has joined #ocaml
bluestorm_ has joined #ocaml
bluestorm has quit [Read error: 104 (Connection reset by peer)]
asmanur is now known as asma
buluca has quit [Read error: 113 (No route to host)]
jnkm has quit ["ex-pratstund"]
ertai has joined #ocaml
buluca has joined #ocaml
qpu|away has quit []
Demitar has joined #ocaml
ecc has quit ["Client exiting"]
qpu has joined #ocaml
filp has quit [Read error: 110 (Connection timed out)]
<orbitz> can i do camel case with module names or i sonly the ifrst letter capitalized?
kelaouchi has quit [Client Quit]
asma has quit [Read error: 110 (Connection timed out)]
<hcarty> orbitz: As long as the first letter is capitalized, the remaining can be written however you'd like. But the filename may have to match - I am not certain.
buluca has quit [Read error: 113 (No route to host)]
mattam has quit [Read error: 113 (No route to host)]
mattam has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
asma has joined #ocaml
Soleil has quit ["Busco roce con derecho a chica."]
Demitar has quit [Read error: 110 (Connection timed out)]
jeffwheeler has joined #ocaml
<jeffwheeler> I'm having trouble getting imports to work just right in Debian (Sid) -- specifically, I am unable to ``open Pxp_yacc'' (I have the package installed), with an error of an unbound module.
<jeffwheeler> Googling seems to suggest that I would need to compile an mli file or something, but I'm new to this and am unsure if that is correct... or even how to go about doing that.
<bluestorm_> you have to give the related .cmo/.cma file to the compiler
<bluestorm_> do you know where is pxp located in you /usr/lib/ocaml ?
<orbitz> hwo does the interpreter find stdlib ones? can you give it a directory and just say "find modules here"?
<bluestorm_> hm
<bluestorm_> orbitz: yes, -I
<bluestorm_> but you still have to give modules name manually, iirc
<bluestorm_> hm
<orbitz> you still have to specifythe moudles to the itnerprter though
<bluestorm_> seems pxp on debian use ocamlfind
<orbitz> doe sit have the quivalent of a CLASPATH?
<bluestorm_> jeffwheeler:
<orbitz> bluestorm_: can i paramaterize a function around any tp eof Set?
<bluestorm_> try (if your source is foo.ml) : ocamlfind ocamlc -package pxp -linkpkg foo.ml -o foo
<bluestorm_> hm
<jeffwheeler> oh, sorry, was looking at the other screen Googling some more
<orbitz> or i guess more generic a question, can i paramaterize a function around aa functor
<bluestorm_> i'm not fluent with functors
<bluestorm_> but i'm afraid you can't
<orbitz> that is the fear i have as well
<jeffwheeler> thanks a bunch bluestorm_, I'll try that
<bluestorm_> what you could do is to write a functor yourself
<bluestorm_> giving that function
<bluestorm_> and relying on the functor signature
<orbitz> i cold pas Fucntor.foo to every functiont aht want sto call foo
<orbitz> but that seems poor
<orbitz> it would be nice if som ehow i could just do Set.foo and it coudl work across sets
<bluestorm_> create a functor that would generate the your foo from the Set.Make output given
<jeffwheeler> bluestorm_: works great; thank you
<bluestorm_> (or even generate an enhanced Set from a single OrderedType)
lde has quit [Read error: 104 (Connection reset by peer)]
<bluestorm_> orbitz: i agree having to use functors yourself may seem a bit heavy, but otherwise it's a quite nice solution
<orbitz> bluestorm_: what is a solution to set that doens't use functors?
<bluestorm_> hm ?
<bluestorm_> are you asking for a non-functorial set-like library ?
<orbitz> is there a version of Set that is like a Queue that does nto use a functor?
<bluestorm_> i know there is some, but not in StdLib
<orbitz> well the upside to osethign liek Queue is i don't care what type it holds
<bluestorm_> ExtLib may have that
<orbitz> the downside is it's mutating all around which i do not like
<bluestorm_> orbitz: why are you so unwilling to use a functor yourself ?
<orbitz> i was just thinking of if there was a non functo rway
<bluestorm_> if Set is the datastructure you really need, i think you should try to use it instead of lesser equivalents
<bluestorm_> hm
<orbitz> bluestorm_: what would a functiont aht takes set and turns it to a list look like in this case?
<bluestorm_> hm
<bluestorm_> there are two possibilites
<bluestorm_> you're only interested in a particular OrderedType case (for example ints), and thus you create an adequate Set yoursef (for example IntSet), and have a function to_list : IntSet.elt -> int set
<orbitz> right, but what if i'm interested in turning a set of 'a to 'a list?
<bluestorm_> orelse you want genericity, and you create a functor that takes an OrderedType as input, and produce an EnhancedSet back, with every function of Set, plus a to_list function
<bluestorm_> to what i understand of functors, "set of 'a" does not make sense
<bluestorm_> you only have YourSet.elt
<bluestorm_> where YourSet is a module you created
<bluestorm_> let me throw you some code
<orbitz> bluestorm_: that woud work but i'm unsure it truly solves the problem, as I still need to know the name of the new module in order to call to_list
<bluestorm_> hm orbitz
<bluestorm_> do you know of the "elements" function ?
<bluestorm_> val elements : t -> elt list
<orbitz> right, but to list is just an example, what i'm really after is a way to perform owrk on a set withotu so much carring about the type
<orbitz> perhaps my end goal is mistaken and it simply isn't a situation correctlyw ritten ocaml should come across
<bluestorm_> orbitz: does that looks like a suitable solution ?
Demitar has joined #ocaml
<orbitz> bluestorm_: hrm. i have to run right now but le tme mull it over and get back to you? thanks a lot
<bluestorm_> :p
deneb has joined #ocaml
jeffwheeler has left #ocaml []
deneb has quit ["KVIrc 3.2.4 Anomalies http://www.kvirc.net/"]
__suri_ has quit [Read error: 110 (Connection timed out)]
__suri has joined #ocaml
wy has joined #ocaml
mrpingoo has joined #ocaml
munga_ has joined #ocaml
xavierbot has quit [Read error: 104 (Connection reset by peer)]
ertai has quit [Read error: 110 (Connection timed out)]
asma is now known as asma|joue
asma|joue is now known as asma
qpu has quit ["zimzim urallala zimzim urallala zimzim zanzibar zimzalla zam"]
<orbitz> val printf : ('a, out_channel, unit) format -> 'a
<orbitz> what is the name for whatever is in ()'s there?
<munga_> which binpaste do you people use ?
<hcarty> munga_: pastebin.com has OCaml highlighting, several have been used here though. There does not seem to be one that is official.
<munga_> hcarty: is broken atm or it's just me ?
<hcarty> http://ocaml.pastewith.us/ - this one seems to be working
<hcarty> Yes, pastebin.com seems to be broken here as well
<bluestorm_> i use pastebin.be
<bluestorm_> because it does OCaml
<bluestorm_> orbitz: hm
<bluestorm_> printf's typing is kinda obscure
<bluestorm_> you can read the doc if you really want to know about it
<bluestorm_> but it's not necessary
<bluestorm_> for 99% of uses, it suffices to think that you have to type printf/scanf *with* the associated format string
<bluestorm_> e.g. don't type (Printf.printf), type (Printf.printf "%s : %d\n")
<bluestorm_> string -> int -> unit, it's easy
<orbitz> maybe i'll atke al ook at it later then
<orbitz> is this absically how it is allowe for an unknown number of arguments?
<bluestorm_> yes
<bluestorm_> there's some magic around here
<bluestorm_> (or at least it's what you think when you don't know this stuff deeply enough, like me)
<munga_> ok can anyone tell me why this example fails to compile with ocamlbuild ? http://pastebin.be/7655
<orbitz> what's the error?
<orbitz> can i export a record form a module or do i have to us ea create function?
<munga_> I just figure it out ... I was calling camlp4 in the wrong way ... camlp4o instead of camlp4of !
Smerdy has joined #ocaml
<bluestorm_> orbitz: you can
<bluestorm_> you have to put the record in the module signature
<bluestorm_> (the whole declaration)
kelaouchi has joined #ocaml
jedai has joined #ocaml
<munga_> I'm compiling a simple program with ocamlbuild that uses camlp4 to write a parser. The compilation goes thought, but ocamlbuild fails to link camlp4lib.cma and therefore I get
<munga_> Error while linking dnf.cmo: Reference to undefined global `Camlp4'
<munga_> how can I convince ocamlbuild to link everything with camlp4lib.cma ?
<munga_> of course it works if I do it by hand
<munga_> shall I write a plugin fot this purpose ?
<bluestorm_> -I +camlp4
<bluestorm_> or -I camlp4 maybe
<bluestorm_> hmm
<bluestorm_> it's ocamlbuild
<bluestorm_> don't know if you have to say something specific about not-in-the-usual-directory .cma, then
<bluestorm_> munga_:
<bluestorm_> « You may need to add options such as -cflags -I,/usr/local/lib/ocaml/ and -lflags -I,/usr/local/lib/ocaml/ if the libraries you wish to link with are not in OCaml's default search path. »
<bluestorm_> try -I,/usr/lib/ocaml/camlp4
<munga_> ... ok, but ... camlp4lib is in the standard ocaml directory...
<bluestorm_> hm
<bluestorm_> /usr/lib/ocaml ?
<bluestorm_> (or whatever is your standard dir)
<munga_> ocamlbuild tries to compile with ocamlc dnf.cmo otherlib.cmo -o dnf.byte
<munga_> but it should add the camlp4lib.cma
<munga_> yep, I'm on a debian system
<bluestorm_> hm
<bluestorm_> so you're looking for a way to inform ocamlbuild that he have to use camlp4lib there
<bluestorm_> that must be in the manual
<munga_> so if I compile with ocamlc /usr/lib/ocaml/camlp4lib.cma dnf.cmo otherlib.cmo -o dnf.byte it works fine
<munga_> if there was a manual :)
<munga_> I'm trying to write a plugin ... but I'm a bit lost at the moment ...
<munga_> it seems that this is not possible directly in _tags
Smerdy has quit ["Leaving"]
<bluestorm_> munga_:
<orbitz> "foo".[1], is .[int] a ocmpiler trick or a special function? wher eisit defined?
<bluestorm_> .[n] is the standard syntax for string char-access
<bluestorm_> a.[n]
<munga_> yes, I read that, but it didn't help ...
<bluestorm_> whereas tab.(n) is for array access
<munga_> this is what I get ...
<bluestorm_> internally they use String.get and Array.get (and String.set and Array.set for mutations)
<orbitz> bluestorm_: right i know that much but is it a special function or a compielr trick or what?
<bluestorm_> hm
<flux> it's a compiler trick, and it maps to String.get
<orbitz> so i can't make my own object with a .[]?
<flux> too bad xavierbot's not around
<flux> let module String = struct let get _ a = Printf.printf "getting at %d\n%!" a end in "foo".[4];;
<munga_> I've also tried with this small pugin http://pastebin.be/7658
<flux> so you sort of "can"
<flux> but it's inadvisable :)
<orbitz> haha
<orbitz> that's cheaper than the compiler trikc:)
<munga_> bluestorm_: I partially solved the problem. If I compile with
<munga_> ocamlbuild -classic-display -lflags -I,+camlp4 -libs camlp4lib dnf.byte
<munga_> then it's ok .
<bluestorm_> hm
<munga_> Do you have any idea how I can add these flags in my _tags ?
<hcarty> orbitz: You can mess with camlp4 to get .[] .() .{} etc to do different things. They are all defined in the OCaml sources as sugar for the matching *.get functions
<orbitz> that's ok, i was mostly curious as to how it works. at first iw as thinking string migh tbe a class but . is not the oeprator to calla metho don a class so that led me here
<bluestorm_> munga_: "yourfile.ml": -lflags -I,+camlp4 -libs camlp4lib ?
<bluestorm_> hm
<bluestorm_> isn't :D
<munga_> no ... doesn't work . the manual is kinda obscure ...
<bluestorm_> seems you have to write a plugin
<bluestorm_> to define your self tags
<orbitz> when definign a class you do blah = object(self), is teh self necesary? I ge tan unsued variable warning form the compielr so I mad eit object(_). what is the self for?
<bluestorm_> the self is for referring to the object
<bluestorm_> kinda like "this" in some languages
<bluestorm_> you can omit it if you have no use for it
<bluestorm_> = object ...
<orbitz> can one create anonymous classes?
<bluestorm_> you create anonymous objects
<bluestorm_> "class" are named objects schemes (don't know if it's the correct wording though)
Demitar has quit [Remote closed the connection]
Morphous has joined #ocaml
Snark has quit ["Quitte"]
Amorphous has quit [Read error: 110 (Connection timed out)]
<orbitz> what is teh ~ operator? it keep son showing up in tutorials/references bu i aven't come acorss an explanation yet
Mr_Awesome has joined #ocaml
<orbitz> ah soethign to do wtih labeled argumetns
ygrek has quit [Remote closed the connection]
hkBst has joined #ocaml
asma has quit [Remote closed the connection]
mng has quit [Read error: 110 (Connection timed out)]
mng has joined #ocaml
<hcarty> foo ~arg:1 ;; calls foo with named argument arg set to the value 1
<orbitz> thanks
<hcarty> It is also combined with - and -. for negative numbers, ex: ~-1 and ~-.1.0
delamarche has joined #ocaml
<orbitz> what does it do there?
<hcarty> It lets you type (foo ~-1) rather than (foo (-1))
<hcarty> If that makes any sense... it's an associativity thing, but I don't remember the proper name. Unary operator perhaps?
buluca has joined #ocaml
<orbitz> yes it does
<orbitz> thanks
<hcarty> Glad to help
<hkBst> hmm, is it like Haskell's $ then?
<bluestorm_> no it's not
<bluestorm_> it's more like, say
<bluestorm_> the python thing
<bluestorm_> foo(arg=val)
<bluestorm_> for named arguments
<bluestorm_> (is that python ? i'm not sure anymore)
delamarche has quit []
opening` has joined #ocaml
opening has quit [Connection timed out]
opening has joined #ocaml
opening` has quit [Read error: 110 (Connection timed out)]
mrpingoo has quit ["Connection reset by pear"]
<orbitz> bluestorm_: yes i tis
<orbitz> is tehr eany equivalent to $ in haskell? or .?
<bluestorm_> you have to code it up yourself
<bluestorm_> let (&) f x = f x;;
<bluestorm_> ((&) is a possibility)
<bluestorm_> (($) won't work as excepted for associativity reason)
<orbitz> i don't think that works
Morphous_ has joined #ocaml
<bluestorm_> why wouldn't it ?
<orbitz> because that currs f with x which is't what you want
<bluestorm_> hm ? what do you want ?
<bluestorm_> iirc ($) is just application
<bluestorm_> ie. identity
<orbitz> f . g == f (g)
<bluestorm_> yes
<bluestorm_> let (@@) f g x = f (g x)
<bluestorm_> hm
<orbitz> hat won't do teh same either
<orbitz> that*
<bluestorm_> hm
<bluestorm_> my (&) was haskell's ($), and this (@@) is (.)
<orbitz> hrm, you'rs wasn't $ eithe ri dont' think
<orbitz> or actually
<orbitz> it was yo uare right
structured has joined #ocaml
Morphous has quit [Read error: 110 (Connection timed out)]
munga_ has quit ["Ex-Chat"]