rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
middayc has joined #ocaml
mwc has quit ["Leaving"]
hsuh has joined #ocaml
AxleLonghorn has joined #ocaml
thermoplyae has quit [Read error: 113 (No route to host)]
Yoric[DT] has quit ["Ex-Chat"]
revax has joined #ocaml
ReachingFarr has joined #ocaml
<ReachingFarr> Does anyone here have experience with Ocamlyacc, or know of a more appropriate channel for me to be asking for Ocamlyacc help?
<hsuh> the place is here, but i don't have experience
<ReachingFarr> Well, if anyone comes by and is able to help, here is my problem: Ocamlyacc seems to be reducing before it needs to, which is causing it to not except things that should be in the language.
<ReachingFarr> I have the following definitions: nonterm1 => TOKEN1 TOKEN2 TOKEN3; nonterm2 => TOKEN1 TOKEN2 nonterm3 TOKEN3;
<ReachingFarr> For some reason it keeps reducing to nonterm1 whenever it reads TOKEN1 TOKEN2 without waiting to see what is next.
thermoplyae has joined #ocaml
AxleLonghorn has left #ocaml []
thermoplyae has quit ["daddy's in space"]
onigiri has quit []
jlouis_ has joined #ocaml
thermoplyae has joined #ocaml
TheLittlePrince has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
ReachingFarr has left #ocaml []
madroach has quit [Remote closed the connection]
jlouis has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
brian` has joined #ocaml
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
brooksbp has joined #ocaml
brooksbp has quit []
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
Snrrrub__ is now known as Snrrrub
<Snrrrub> Hmm, I'm having some trouble accessing record fields from one module when the record was defined in another... here's a minimal example: http://pastebin.com/d364118e9 - could someone explain what I'm doing wrong?
<thelema> Snrrrub: record.Modulename.field
<thelema> Snrrrub: test.A.x
<Snrrrub> Whoa. That's intense. Makes sense, but I wouldn't have guessed it. :-) Thanks!
<thelema> I guess the compiler could keep track of the type of the value and prepend that module name to the record labels...
<thelema> if you open the module, things go easily
brian`` has joined #ocaml
brian` has quit [Read error: 110 (Connection timed out)]
mrsolo has joined #ocaml
NoGoodNik has joined #ocaml
mrsolo has quit ["This computer has gone to sleep"]
mrsolo has joined #ocaml
<mbishop> How could I split a string into an array of characters?
<thelema> mbishop: Array.init (String.length str) (fun i -> str.[i])
<thelema> (or something like that)
mrsolo has quit ["This computer has gone to sleep"]
<mbishop> ah yes, that worked, thanks
<mbishop> Too bad the program doesn't work heh
<mbishop> trying to write a brainfuck interpreter
<mbishop> it hangs somewhere
NoGoodNik has quit []
<mbishop> Hmm
<mbishop> try foo.(i) <- input_byte stdin with End_of_file -> failwith "Error" is giving me
<mbishop> "
<mbishop> This pattern matches values of type char
<mbishop> but is here used to match values of type exn
<mbishop> "
<mbishop> I tried putting ()'s around pretty much everything you can think of
<mbishop> still can't get it to work
ozzloy is now known as aska
ttamttam has joined #ocaml
aska is now known as aska__
aska__ is now known as ozzloy
Snrrrub has quit [Read error: 110 (Connection timed out)]
<thelema> mbishop: works for me in the toplevel:
<thelema> # let foo = Array.create 20 0;;
<thelema> val foo : int array =
<thelema> [|0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0|]
<thelema> # try foo.(1) <- input_byte stdin with End_of_file -> failwith "Error";;
<thelema> g
<thelema> # : unit = ()
<mbishop> yeah it worked for me too, but not in the code...anyway I just removed the try...with from the code (pasted above)
<mbishop> but it still hangs
<mbishop> :/
<thelema> mbishop: cp never gets incremented
<mbishop> Really?
<thelema> yup.
<mbishop> I wondered why it was indenting "cp := !cp + 1" funny
<thelema> you simply need () around your match statement
onigiri has joined #ocaml
<mbishop> thelema: Ah! And now it works, thanks :)
<thelema> :)
onigiri has quit [Client Quit]
Tetsuo has joined #ocaml
<mbishop> Hmm, doesn't seem to work on some other brainfuck snippets though, like addition
<mbishop> hmm scratch that, it works :)
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
thermoplyae has quit ["daddy's in space"]
aska3 has joined #ocaml
aska3 has left #ocaml []
filp has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit ["Ex-Chat"]
szell` has joined #ocaml
szell has quit [Read error: 110 (Connection timed out)]
madroach has joined #ocaml
<madroach> Hi, I'm wondering how the Thread module is supposed to work in the toplevel.
<madroach> I built by toplevel: ocamlmktop -thread unix.cma threads/threads.cma -o top
<madroach> ./top
<madroach> # Thread.create;;
<madroach> Unbound value Thread.create
<madroach> then I did: echo module Thread = Thread >blub.ml
<madroach> ocamlc -c -thread blub.ml
<madroach> ./top
<madroach> #load "blub.cmo"
<madroach> open Blub;;
<xavierbot> Characters 1-10:
<xavierbot> open Blub;;
<xavierbot> ^^^^^^^^^
<xavierbot> Unbound module Blub
<madroach> and then it worked.
<madroach> Strange hack. How it is supposed to work?
<madroach> Thread.create;;
<xavierbot> Characters 1-14:
<xavierbot> Thread.create;;
<xavierbot> ^^^^^^^^^^^^^
<xavierbot> Unbound value Thread.create
wolfgangbeck has joined #ocaml
rwmjones has joined #ocaml
munga has joined #ocaml
huh has quit [calvino.freenode.net irc.freenode.net]
dobblego has quit [calvino.freenode.net irc.freenode.net]
ertai has quit [calvino.freenode.net irc.freenode.net]
svenl has quit [Remote closed the connection]
dobblego has joined #ocaml
ertai has joined #ocaml
huh has joined #ocaml
hsuh has quit ["owr"]
letrec has quit []
svenl has joined #ocaml
letrec has joined #ocaml
mrsolo has joined #ocaml
madroach has quit [Remote closed the connection]
gaja has quit [Read error: 110 (Connection timed out)]
Tetsuo has quit ["Leaving"]
hkBst has joined #ocaml
ttamttam has left #ocaml []
wolfgangbeck has left #ocaml []
eroyf has left #ocaml []
ttamttam has joined #ocaml
xavierbot has quit [Read error: 104 (Connection reset by peer)]
rwmjones has quit [Read error: 104 (Connection reset by peer)]
ikaros has joined #ocaml
rwmjones has joined #ocaml
ikaros has quit [Remote closed the connection]
bzzbzz has joined #ocaml
filp has quit ["Bye"]
brian``` has joined #ocaml
brian`` has quit [Read error: 110 (Connection timed out)]
middayc has joined #ocaml
brian``` has quit [Connection timed out]
TheLittlePrince has quit [Client Quit]
ita has joined #ocaml
youscef has joined #ocaml
<youscef> salut
middayc has quit []
Snrrrub has joined #ocaml
Snrrrub__ has joined #ocaml
ecc has quit ["leaving"]
youscef has quit ["Quitte"]
Snrrrub has quit [Read error: 110 (Connection timed out)]
tsuyoshi has quit [Read error: 104 (Connection reset by peer)]
RobertFischer has joined #ocaml
Snrrrub__ is now known as Snrrrub
Morphous_ has joined #ocaml
jlouis_ has quit ["bbl"]
Morphous has quit [Read error: 110 (Connection timed out)]
munga has quit ["Leaving"]
Tetsuo has joined #ocaml
jstanley has joined #ocaml
<jstanley> Anyone know of a program that will take ocaml files (eg, .mli files) and generate corresponding C FFI functions for them?
<hcarty> jstanley: camlidl
<hcarty> Sorry, misread the question
<hcarty> camlidl goes the other way...
<rwmjones> jstanley, there is no such program -- I did a bit of work in this area, but nothing came of it
<rwmjones> would be very very useful for me
onigiri has joined #ocaml
bongy has joined #ocaml
<jstanley> rwmjones: yeah, me too =/
<jstanley> hcarty: yeah there's lots of stuff to go C -> OCaml
<jstanley> okay, how about this: does anyone know of a canned .mli parser in ocaml?
<jstanley> because if there's not, i might have to go write an ocaml -> C binding generator in haskell, lol ;P
<rwmjones> you can use camlp4 to parse those files
<jstanley> i assumed that a general-purpose infrastructure was around, i was hoping for a canned .mli parser specification
* jstanley is not an ocaml programmer ;P
<rwmjones> I'm not sure ... obviously the ocaml source contains a grammar
<jstanley> rwmjones: my main problem is that i need to have ocaml heap objects promoted to global roots quite commonly in C-land, so it's not a "tight" binding generator that I need.
<jstanley> rwmjones: *nod*
ttamttam has left #ocaml []
Tetsuo has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
<jonafan> my cps C# code doesn't want to be
thermoplyae has joined #ocaml
jderque has joined #ocaml
bongy has quit [Remote closed the connection]
bluestorm has joined #ocaml
bongy has joined #ocaml
RobertFischer has quit ["Trillian (http://www.ceruleanstudios.com"]
bongy has quit [Remote closed the connection]
thermoplyae has quit ["daddy's in space"]
ita has quit ["Hasta luego!"]
xavierbot has joined #ocaml
bongy has joined #ocaml
psnively has joined #ocaml
bongy has quit ["Leaving"]
Snark has joined #ocaml
thermoplyae has joined #ocaml
Yoric[DT] has joined #ocaml
Snark has quit ["Ex-Chat"]
<jonafan> so close
<jonafan> plus<int, int> (1) (one<int>) (id<int>) works but one<int> (plus<int, int>) (one<int>) (id<int>) doesn't
xavierbot has quit [Read error: 110 (Connection timed out)]
<jonafan> xavierbot had to bail
<jonafan> probably a mixture of nausea and shame
<Yoric[DT]> What is that ?
<Yoric[DT]> Some operators based on deriving ?
<jonafan> haha no, i'm trying to write some CPS code in C#
<jonafan> it's kind of fun seeing how gross this stuff turns out
<jonafan> here is the declaration of plus: static Func<Func<Func<int, int>, A>, Func<Func<A,B>, B>> plus<A, B>(int x)
<jonafan> entire function in ocaml: let plus x y f = f (y ((+) x));;
<thelema> ((int -> int) -> 'a) -> (('a -> 'b) -> 'b)
<Yoric[DT]> :)
<jonafan> er, right
<jonafan> so, what's the point of CPS?
<Yoric[DT]> It's a nice model ?
<jonafan> it seems like a great way to turn simple code into very complicated code
jderque has quit ["leaving"]
<jonafan> which can be fun, but i'm not sure why i'd actually use it
<psnively> CPS makes it possible to integrate novel control flow into languages that don't give it to you out of the box.
wickj has joined #ocaml
<jonafan> haha, jackpot
<jonafan> one<Func<Func<Func<int, int>, int>, Func<Func<int, int>, int>>>(plus<int, int>)(one<int>)(id<int>) ----> 2!!
<psnively> W00t!
jlouis has joined #ocaml
<jonafan> not an optimal language for this kind of stuff, but neat that you can do it
<psnively> CPS kinda basically means that you can use any language as a target of compilation, no matter how weird the source language. :-D
<Yoric[DT]> :)
ita has joined #ocaml
xavierbot has joined #ocaml
thermoplyae has quit ["daddy's in space"]
marmottine has joined #ocaml
mwc has joined #ocaml
psnively has quit []
onigiri has quit []
bluestorm has quit [Remote closed the connection]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
Optikal__ has quit [Read error: 104 (Connection reset by peer)]
jstanley has left #ocaml []
hsuh has joined #ocaml
marmottine has quit ["Quitte"]
hcarty has quit [Remote closed the connection]
Robdor has joined #ocaml
nameless` has joined #ocaml
thermoplyae has joined #ocaml
jlouis_ has joined #ocaml
hcarty has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
shortcircuit has quit ["Probably rebooting."]
Mr_Awesome has quit ["aunt jemima is the devil!"]
jlouis_ has quit [Read error: 110 (Connection timed out)]
Snrrrub has quit [Read error: 110 (Connection timed out)]
Morphous_ has quit ["shutdown"]
Amorphous has joined #ocaml