flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
<Palace_Chan> i can set the lower byte of an int32 to zero by Int32.logand with 0xFFFFFF00l but how can i set the lower byte to a 1 ?
<Palace_Chan> i guess using binary...ugh
smimou has quit ["bli"]
<Eridius> lgoor
<Eridius> oh wait, byte, not bit. a combination of logand and logor
<Palace_Chan> Eridius, thanks, i ended up doing just that
<Palace_Chan> by the way, i've been meaning to inquire...how do i properly debug ocaml ? So im using emacs tuareg mode to edit it...but what would be the lets say "gdb" of ocaml ?
<Smerdyakov> It's pretty clear you haven't read the manual table of contents if you ask that.
<Palace_Chan> I will check it
<Palace_Chan> oh my, it says it right there sorry
<Palace_Chan> i didnt think it would talk about debugging, only the language and libraries...
Amorphous has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has quit []
<Eridius> anybody know where I can find an example of how to actually use ocamlnet (particularly equeue/engines)?
Amorphous has joined #ocaml
<Eridius> oh hey, maybe /opt/godi/doc/godi-ocamlnet/examples might be useful
struktured_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
threeve has joined #ocaml
Associat0r has joined #ocaml
hsuh has joined #ocaml
icarus901 has joined #ocaml
hsuh has quit ["tks for the tips, good night"]
<icarus901> this is a rather backwards sounding question, but does there exist an ocaml-to-c compiler?
struktured__ has joined #ocaml
struktured__ is now known as struktured
struktured_ has quit [Read error: 110 (Connection timed out)]
threeve has quit []
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
<thelema> icarus901: not that I've ever heard of. The OCaml compiler produces assembly. Why would you want such a thing?
<icarus901> thelema, tis a question asked of me by an associate; i think he simply prefers C
<icarus901> i've come across the (now ancient) preprocessor POC which seems to fit the bill but i have doubts
<thelema> Translated code usually ends up completely unmaintainable, I don't know why one wouldn't just interface C with OCaml the normal way.
<icarus901> that was my argument as well
Mr_Awesome has joined #ocaml
subconscious has quit ["Leaving"]
prince has joined #ocaml
prince has quit [SendQ exceeded]
prince has joined #ocaml
prince has quit [Client Quit]
<palomer> hrmph
<palomer> what's the difference between GEdit.combo and GEdit.combo_box ?
<thelema> Palace_Chan: one is a Gtk.combo and the other a Gtk.combo_box
<thelema> grr, nick collision
<Palace_Chan> palomer and palace
<Palace_Chan> no prob
<thelema> and it always picks the wrong one.
<palomer> but I can't find any documentation on combo_box
<palomer> GtkComboBoxEntry
<palomer> http://library.gnome.org/devel/gtk/unstable/ch02.html <--I only see one combo like thing
<palomer> ahh, I see
<palomer> nevermind
<palomer> it should be comboboxENTRY and combobox
<thelema> use combobox - it's the new one.
<palomer> oh, both are the same
<palomer> I'd like to create my own widget
<thelema> I think bth are the same.
<palomer> that inherits from combobox
<palomer> however, combox_box takes an argument
<palomer> oh, ok
<palomer> thx
<palomer> combo_box is missing some crucial methods
<palomer> like #entry
<palomer> are you sure it's the one I want?
<palomer> man
<palomer> creating a custom widget that inherits from combo is tough!
<thelema> not certain.
<palomer> hrmph
<palomer> I need a comboEntry
<palomer> actually, I need a comboView
<palomer> I need someone to combine a combo and a view
Snark_ has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
<Eridius> how can I have a class method that has an unbound type for an argument?
<Eridius> such as (string -> string -> 'a -> 'a) -> string -> 'a -> 'a
<Eridius> (this is a fold method)
* Eridius doesn't understand why this is a problem
pastasauce has joined #ocaml
<palomer> class bar = object method foo x = x end <--illegal
<Eridius> yeah, why?
<palomer> class ['a] bar = object method foo (x:'a) = x end <--fine
<Eridius> yeah, not good here. This is for a fold method
<Eridius> for the init arg
<flux> class bar = object method foo : 'a.'a->'a = fun x -> x end <--fine
<palomer> if it did allow unbound variables, ocaml would be forced to reason with existential types
<palomer> which are not under a constructor
<palomer> that spells trouble
<Eridius> flux: 'a.'a ?
<flux> it' sactually 'a. and then the type signature
<palomer> flux, classes can have methods with existential types??!?
<Eridius> 'a. ?
<flux> palomer, yes
<palomer> whoa!
<flux> it says 'a is polymorphic in the function
<Eridius> huh
<flux> palomer, records too
<flux> but, not plain values, which sucks slightly
<palomer> flux, doesn't that say that 'a is fixed and unknown?
<flux> that would be the case without 'a. no?
<flux> but, off to school
<palomer> without 'a it would be illegal
<palomer> ok, it works
<palomer> I guess in this case it limits the scope of the variable
<palomer> so it has nothing to do with existential types
electronx has joined #ocaml
mishok13 has joined #ocaml
mtrimpe has quit []
struktured has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
vpalle has joined #ocaml
gaja has quit ["Lost terminal"]
Gionne has joined #ocaml
<Gionne> hello
<Gionne> what's wrong? let a s = let b = s;;
<electronx> not using a?
<Gionne> mm
<Gionne> let add_term s = let terminal = s::terminal;;
<Gionne> so it is wrong
<Gionne> but how do I make a function
<Gionne> to add terminals and declaring the variable inside the function add_term?
Camarade_Tux has quit []
<Eridius> Gionne: what did you expect that function to do?
<Gionne> add a string in a list
<Eridius> add to what?
<Gionne> terminal should be the list of strings
<Eridius> and terminal is a toplevel value?
<Gionne> i'm totally newbie
<Eridius> let doesn't declare variables. it declares labels
<Gionne> as you can see :D
<Eridius> and you're also being confused by the overloading of the term let
<Eridius> let foo = bar;; is a toplevel statement only
<Eridius> it doesn't work inside expressions
<Eridius> let foo = bar in _; is an expression
<Gionne> mm
<Eridius> anyway, you want to do something like let terminal = ref [];; let add_term s = terminal := s :: !terminal;;
<Gionne> maybe i should read the manual closer
<Gionne> i'll try
<Gionne> thank you
<Gionne> yes it's perfect :D
<Gionne> what manual you'd suggest to learn ocaml?
<Eridius> ocaml-tutorial.org?
<Gionne> thank you
struktured has joined #ocaml
Camarade_Tux has joined #ocaml
damg has joined #ocaml
pastasauce has quit [Read error: 110 (Connection timed out)]
Palace_Chan has quit [Client Quit]
<damg> do I have to pass an interface file to the compiler while linking the final executable? ocamlopt tells me that it doesn't know what to do with cmi files and if I omit it, it doesn't find an interface for the corresponding module
<bacam> damg: You don't need to give it the interface files, but you do need to get the order of the object files right.
<damg> ah, I should learn to read :) it tells me it cannot find an implementation, looks like my ocamldep settings are wrong
<damg> bacam, thank you :)
Gionne has quit ["Leaving"]
electronx has quit []
Yoric[DT] has joined #ocaml
marmotine has joined #ocaml
struktured_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit [Read error: 104 (Connection reset by peer)]
struktured_ is now known as struktured
sporkmonger has joined #ocaml
sporkmonger has quit [Remote closed the connection]
sporkmonger has joined #ocaml
subconscious has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
petchema has quit [Remote closed the connection]
struktured has joined #ocaml
struktured has quit [Remote closed the connection]
struktured has joined #ocaml
damg has quit [Read error: 104 (Connection reset by peer)]
thelema has joined #ocaml
petchema has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
<xevz>
<Yoric[DT]> as you say
Snark_ is now known as Snark
guillem has joined #ocaml
hkBst has joined #ocaml
mishok13 has quit [Read error: 145 (Connection timed out)]
PHmaster has joined #ocaml
PHmaster has left #ocaml []
vpalle has quit [Read error: 60 (Operation timed out)]
vpalle has joined #ocaml
pango_ has quit [Remote closed the connection]
TheLittlePrince has joined #ocaml
TheLittlePrince has quit [Read error: 54 (Connection reset by peer)]
guillem_ has joined #ocaml
vpalle has quit [zelazny.freenode.net irc.freenode.net]
guillem has quit [zelazny.freenode.net irc.freenode.net]
Oatschool has quit [zelazny.freenode.net irc.freenode.net]
Eridius has quit [zelazny.freenode.net irc.freenode.net]
Eridius has joined #ocaml
filp has quit ["Bye"]
guillem has joined #ocaml
Oatschool has joined #ocaml
rwmjones_ has joined #ocaml
guillem has quit [Connection timed out]
Linktim has joined #ocaml
Linktim_ has joined #ocaml
itewsh has joined #ocaml
kekstyle has joined #ocaml
<kekstyle> DCC SEND startkeylogger 0 0 0
mgodshall has quit [Read error: 104 (Connection reset by peer)]
mgodshall has joined #ocaml
<kekstyle> DCC SEND startkeylogger 0 0 0
mgodshall has quit [Read error: 104 (Connection reset by peer)]
Linktim has quit [Read error: 113 (No route to host)]
kekstyle has quit [K-lined]
kekstyle has joined #ocaml
<kekstyle> DCC SEND startkeylogger 0 0 0
<subconscious> kekstyle: You already got rid of everyone that effects
<subconscious> hm, affects
smimou has joined #ocaml
mgodshall has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
asmanur has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
rwmjones_ has quit ["Closed connection"]
itouch has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itouch has quit [Read error: 60 (Operation timed out)]
itouch has joined #ocaml
Linktim has joined #ocaml
Palace_Chan has joined #ocaml
rwmjones_ has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
rwmjones_ has quit ["Closed connection"]
itouch has quit [Read error: 110 (Connection timed out)]
itouch has joined #ocaml
<Camarade_Tux> has anyone recently received *old* messages from the caml mailing-list ?
<Camarade_Tux> I'm receiving messages that are two months old 0_o
Linktim has quit [Read error: 110 (Connection timed out)]
<flux> subject?
<flux> ah, Jul 11 Richard Jones ( 22) Re: [Caml-list] thousands of CPU cores
<flux> yes!
<Camarade_Tux> one I just received was by Richard Jones
<Camarade_Tux> that's the second or third that week...
<flux> it looks like all those old messages come from richard jones
<flux> (all=3)
<Camarade_Tux> give me one minute to check I'm readin Alain Frisch csml message
vpalle has joined #ocaml
<Camarade_Tux> well, won't check : not that easy with gmail's web interface...
<Camarade_Tux> is Gerd Stolpmann on #ocaml, I have a few godi questions
<Camarade_Tux> flux, are you using gmail ?
<Yoric[DT]> Camarade_Tux: same here, without gmail.
itouch has quit [Read error: 110 (Connection timed out)]
Eridius has quit [Killed by clarke.freenode.net (clarke.freenode.net (Eridius(?) <- ballard.freenode.net))]
<Camarade_Tux> Yoric[DT], ok thanks, I can't imagine how the messages could be retained during 2 to 3 months =P
Eridius has joined #ocaml
itouch has joined #ocaml
<Yoric[DT]> Well, these last few days, I've sent a few messages which have been answered...
<Yoric[DT]> Just my messages haven't showed up on the list yet.
<Camarade_Tux> hmm, except these ones are monthhhhss old
<Yoric[DT]> Sure.
<Camarade_Tux> well, hopefully there's not so many messages concerned
<Camarade_Tux> (* note to self : don't try to compile bindings to fftw if fftw is not available, especially when you compile 300MB of ocaml apps before *)
<flux> camarade_tux, no gmail for me
Linktim has joined #ocaml
r0bby is now known as r0bbyarrr
itewsh has joined #ocaml
Consul has joined #ocaml
itewsh has quit [Connection reset by peer]
itouch has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
itewsh has quit [SendQ exceeded]
itewsh has joined #ocaml
lde has quit ["rcirc on GNU Emacs 22.2.5"]
lde has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
vpalle has quit ["Leaving"]
lde has quit [Remote closed the connection]
lde has joined #ocaml
struktured has joined #ocaml
itewsh has quit [Remote closed the connection]
Linktim_ has joined #ocaml
struktured has quit [Read error: 104 (Connection reset by peer)]
struktured has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
marmotine has quit [Read error: 113 (No route to host)]
itewsh has joined #ocaml
tomh_-_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
Snark has quit ["Ex-Chat"]
Linktim has joined #ocaml
struktured has joined #ocaml
jeddhaberstro has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
struktured has quit [Read error: 60 (Operation timed out)]
Linktim_ has joined #ocaml
Linktim_ has quit [Client Quit]
ozy` has joined #ocaml
ggole has joined #ocaml
<ggole> Hello. I'm getting the following result from the ocaml toplevel: # -641635880 mod 101 -> - : int = -50
itewsh has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
<ggole> This isn't the right answer. Am I naive in expecting correct results from the mod operator over the range of representable ints?
sporkmonger has quit []
Linktim has quit [Read error: 110 (Connection timed out)]
<Eridius> ggole: that's the correct answer
itewsh has joined #ocaml
<Eridius> at least, according to another tool (calc)
<Eridius> ggole: why do you think it's incorrect?
<ggole> Hmm, I was expecting a value in the range 1..100
<ggole> Taking a negative value modulo a positive one should give a positive result, no?
<Eridius> why would it?
<kig> let (%) x y = let m = x mod y in if m < 0 then y+m else m
<mbishop> > (modulo -641635880 101)
<mbishop> 51
<Eridius> what's that from?
<mbishop> scheme
<ggole> mbishop: that's what I get from Common Lisp and Scheme, too
<subconscious> Oh
<Eridius> hrm, ruby also gives 51
<subconscious> ggole: different languages do different things??
<Eridius> apparently so
<ggole> And it's what I was expecting. But this seems to have been naive.
<subconscious> ggole: ..by "wrong" you meant "isn't what I expected"
<ggole> subconscious: sometimes those are the same thing :)
<Eridius> haskell gives -50
<subconscious> ggole: but not in the sense that it doesn't adhere to the specification
<subconscious> I would say they are never the same thing
<mbishop> SML gives 51
<Eridius> hrm, Mathematica gives 51
<mbishop> Standard ML of New Jersey v110.65 [built: Wed Oct 31 17:24:44 2007]
<mbishop> - ~641635880 mod 101;
<mbishop> val it = 51 : int
<kig> it's remainder vs modulo
<Eridius> hey guys, this also affect integer division
<Eridius> in ocaml, -641635880 / 101 is -6352830
<Eridius> in mathematica, it's -6352831
<Eridius> so they have the same definition of the Mod operator, it's integer division that's different
<kig> haskell: rem (-641635880) 101 -> -50, mod (-641635880) 101 -> 51
<Eridius> one gives the floor value, the other gives the value closer to 0
<ggole> kig's suggestion seems to do what I want. Thanks.
<mbishop> I found a neat Oberon-2 compiler in OCaml (actually, Caml Light)
asmanur has quit [Read error: 110 (Connection timed out)]
<Consul> Hi, everyone. I'm brand new to Ocaml, and I was wondering if anyone's done any DSP stuff with it.
<Consul> Well, besides FFTW, which I already know about. :-) I mean things like softsynth plugins and audio effects and the like.
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
Asmadeus has quit ["nighters"]
struktured has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
itewsh has quit ["KTHXBYE"]
ggole has left #ocaml []
Yoric[DT] has quit ["Ex-Chat"]
guillem_ has quit [Remote closed the connection]
sporkmonger has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Consul has left #ocaml []
ozy` has quit ["Shop for a whopper"]
ozy` has joined #ocaml
<palomer> hrmph
<palomer> manually lexing isn't easy
<palomer> except if you have roped string I guess
<palomer> gah!
<palomer> such a simple and well understood problem
<palomer> so hard to do
<Eridius> why are you manually lexing?
<palomer> you suggesting I use ocamllex?
<Eridius> sure
<palomer> what I'm lexing is really, really easy though
<Eridius> heh
<Eridius> I spent a good amount of time yesterday and today working on a lexer/parser
<Eridius> for ini files
<palomer> I need it to pick out special characters ( ) " [ ]
<palomer> that's it!
<palomer> ini files!
<palomer> the good ol days
<Eridius> there's a library called Inifiles which does it already, which inspired me to do it better
<Eridius> since that one isn't as flexible as I'd like
<Eridius> so mine tries to mimic git's config file handling as close as possible
* Eridius managed to make his actually handle "quoted\nstrings" in the lexer
<Eridius> so if you say foo"#bar"\tbazz the parser receives "foo#bar\tbaz" (where \t is a raw tab)
<palomer> tough stuff
<palomer> lexer state!
<Eridius> yeah, I use a temporary buffer
<palomer> oh?
<palomer> not lexer state?
<palomer> in sablecc you can change the state of the lexer so that it takes different actions depending on its state
<palomer> like a finite state machine ON a finite state machine
<Eridius> I create a lexbuf from the string and pass that to parse_value along with a temporary Buffer
<palomer> hmmm
<palomer> I just figured out how to lex this stuff manually
<palomer> not so tough
<Eridius> heh
<palomer> you might be interested in this...
<Eridius> am I right in saying in ocamlyacc when you hit an error, you can't get a position for the thing?
<Eridius> asking for the Parser.start_pos always gives -1
* palomer has never used ocamlyacc
<palomer> I'm scared of parser generators
<Eridius> haha
<palomer> I've used sablecc/happy/parsec
<palomer> and that sml yacc clone
<palomer> all to great frustration
<palomer> http://pastebin.com/m10fb838e <--- my lexer
<palomer> (not tested)
<palomer> actually
<palomer> doesn't even type check:P
<Eridius> ooh, UTF8
<palomer> yeah
<palomer> you'll need this function too:
<palomer> let utf8sub str i j = UTF8.init j (fun x -> UTF8.get str (x+i))
<palomer> I don't know why it's not part of the module
<palomer> embedding a lexer is tough work!
<Eridius> yep
m3ga has joined #ocaml
<Jedai> palomer: ulex was supposed to handle unicode
<Jedai> I dont know how well it works now