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/
flux-_ has joined #ocaml
zamez has quit [zelazny.freenode.net irc.freenode.net]
dbueno has quit [zelazny.freenode.net irc.freenode.net]
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
fremo has quit [zelazny.freenode.net irc.freenode.net]
zamez has joined #ocaml
fremo has joined #ocaml
dbueno has joined #ocaml
Hadaka has joined #ocaml
flux__ has quit [Read error: 104 (Connection reset by peer)]
fremo has quit [Remote closed the connection]
fremo has joined #ocaml
Nutssh has joined #ocaml
chessguy has joined #ocaml
delamarche has joined #ocaml
RSi has left #ocaml []
delamarche has quit []
<Slack4020> i really just dont understand what the problem is
<Demitar> Slack4020: Interesting. ;)
<Slack4020> Demitar: i have compiled ocaml now 8 times and lablgtk2 9 times
<Slack4020> and it just wont compile near the end
<Demitar> Curious.
<Demitar> http://workaround.org/moin/GettingHelpOnIrc <- I think you might want to read point 2.
<Slack4020> Demitar: no one is going ot help , apparently its a problem with my system or something i have compiled this many times i just dont get it
<Demitar> Ah, just idle chatter then. :)
<Slack4020> its called need ot rant :P
<Slack4020> to*
delamarche has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- The dawn of a new IRC era"]
sponge45 has joined #ocaml
batdog|gone is now known as batdog
Slack4020 has quit ["Konversation terminated!"]
delamarche has quit []
danly has joined #ocaml
iFreeCarve has joined #ocaml
<iFreeCarve> bonjour a tous / hello all
<iFreeCarve> i'm learning opengl for the first time
<iFreeCarve> i'm trying to convert an example of selection and picking (written in c) into ocaml
<iFreeCarve> but i can't find a good reference for glSelectBuffer (and its return types), and a bunch of other functions
<buluca> bonjour iFreeCarve / hello iFreeCarve
<iFreeCarve> hi
<buluca> iFreeCarve, mmm I did never used OpenGL, did you look at its reference manual?
<iFreeCarve> yes. i have seen some manuals for openGL, but the ocaml library doesn't use pointers and arrays like the c library does
<iFreeCarve> actually, if i could figure out how to open the lablGL or lablGlut modules in the ocaml interpreter then i could probably get the types from that
<buluca> #Load "/path/to/filename.cmi"
<buluca> ?
<iFreeCarve> ok i will try that
<buluca> I don't know how exactly this should be done :(
<sponge45> try just lablgl
<iFreeCarve> Objective Caml version 3.08.4
<iFreeCarve> # open lablgl;;
<iFreeCarve> Syntax error
<iFreeCarve> # open lablGL;;
<iFreeCarve> Syntax error
<iFreeCarve> #
<buluca> hmm... the only thing which I'm sure of is ";;"
<buluca> iFreeCarve, the quotes
<sponge45> No, the lablgl program/command
danly has quit ["Leaving"]
<iFreeCarve> quotes dont seem to work either
<iFreeCarve> i have a command lablglut ... no lablgl
<iFreeCarve> hang on
<iFreeCarve> aah that seems to work
<buluca> iFreeCarve, how does it?
<iFreeCarve> well, it runs the ocaml interpreter
<iFreeCarve> but now i can type in GL functions and it recognizes them
<sponge45> I don't know how convenient it is...
<iFreeCarve> certainly better than just guessing!
<sponge45> I'd rather put my program in a file, and just run it using lablgl file.ml
<iFreeCarve> true
<iFreeCarve> but this way i can get the function types
<iFreeCarve> like so:
<iFreeCarve> # GlDraw.color;;
<iFreeCarve> - : ?alpha:float -> Gl.rgb -> unit = <fun>
<iFreeCarve> :)
<sponge45> I usually use ocamlbrowser
<iFreeCarve> let me check that out...
<sponge45> It comes with labltk
<iFreeCarve> i gotta get that set up... apparently gentoo doesn't have that package yet
<iFreeCarve> do you know where i can download the labltk source?
<buluca> Ohh, not running Debian is often painful :) sometimes ever Debian is
* buluca has just discovered the ocamlbrowser's usage
dibblego has joined #ocaml
<iFreeCarve> hmm, maybe i can check the debian package on labltk to get the homepage
<buluca> iFreeCarve, one moment...
<buluca> iFreeCarve, mmm...
<iFreeCarve> yeah... i'm not having much luck with google
<buluca> I think it's actually lablgtk... in debian I can't find labltk... (or is it in the "standard libraries"?)
<buluca> it's included in the ocaml package indeed, in Debian
<buluca> (that were other lib)
<buluca> so I think it's in the same repo as ocaml
<iFreeCarve> the gentoo package seems to have every executable except the browser one :(
<iFreeCarve> thats so annoying
<buluca> maybe you can emerge it with the right flag?
<iFreeCarve> aah it appears you are right
<buluca> iFreeCarve, cool :-P
<iFreeCarve> i had tcltk turned off for some reason
<iFreeCarve> i was probably drunk
<buluca> iFreeCarve, ahah
<buluca> (tcl?)
<iFreeCarve> yes, the flag is "tcltk"
<buluca> iFreeCarve, I supposed it didn' use tcl too!
<iFreeCarve> true... its funny because i did my final project last semester with lablgtk and had no problems
<buluca> I wish to make something with lablgtk2
<iFreeCarve> i can't offer much in the way of gtk programming... i just used it to draw lines
<iFreeCarve> i was writing an elevator scheduler and used gtk to make a simulator
<iFreeCarve> so it was just colored boxes going up and down
<buluca> nice ;)
<iFreeCarve> nothing with inputs or buttons though
buluca has quit [Remote closed the connection]
Smerdyakov has quit ["Leaving"]
_velco has joined #ocaml
Slack4020 has joined #ocaml
<Slack4020> hmm
Snark has joined #ocaml
delamarche has joined #ocaml
dibblego has quit ["Leaving"]
_velco has quit [Read error: 60 (Operation timed out)]
_velco has joined #ocaml
<Slack4020> d
Slack4020 has quit [Remote closed the connection]
love-pingoo has joined #ocaml
velco has joined #ocaml
sponge45 has quit ["zzzzzzzz"]
Snark has quit ["Leaving"]
slipstream-- has joined #ocaml
pauldia has joined #ocaml
pauldia has quit [Client Quit]
Skal has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
chris2 has joined #ocaml
<chris2> excuse the noobish question, but i'm only familiar with lazy functional programming languages. when i do two List.map after each other, will ocaml optimize that or do them after each other (and use memory for the temporary result)?
<mellum> chris2: the latter
<chris2> too bad
dbueno_ has joined #ocaml
dbueno has quit [Read error: 113 (No route to host)]
triple_ has joined #ocaml
<pango> use streams
<chris2> pango: aah, thanks
<pango> however I think you'll have to redefine map & friends :/
buluca has joined #ocaml
<pango> only do that if it makes a difference for scalability... for lists small enough to fit in minor heap, that's probably not worth it, temporary lists will just get collected on next minor gc
<chris2> so it's not a problem in practise, or dont do ocaml programmers use these functional features as heavy as e.g. haskell programmers?
<mellum> It's not a problem in practice.
<chris2> interesting
<pango> it'd be great if compiler implemented some deforestation algorithm... but that's not an optimizing compiler, you just get what you ask for...
<chris2> would mlton maybe do that?
<chris2> without referential transparency, it's probably not easy
<pango> couldn't find any evidence that it implements it either
<chris2> well, haskell doesnt "implement" it either, it's just a matter of fact
<pango> it doesn't implement deforestation, does it ?
<pango> just relying on lazy evaluation (on lists, in this case)
<pango> so the closest implementation in ocaml would be to use streams (lazy lists)
<chris2> yeah, just lazy evaluation
<chris2> ok, i'll read about them
<chris2> bbl
swi has joined #ocaml
Snark has joined #ocaml
<pango> beware that reading from standard streams is destructive... camlp4 has functional streams too, but I've yet to figure out the correct syntax for them ;)
<chris2> mmh, neat
swi has left #ocaml []
chris2 has quit ["Leaving"]
yondalf has joined #ocaml
<love-pingoo> anybody knows if OCaml has native threads on OSX ?
yondalf_ has joined #ocaml
yondalf_ has quit [Client Quit]
yondalf has quit [Read error: 60 (Operation timed out)]
chessguy has joined #ocaml
descender has quit [Remote closed the connection]
descender has joined #ocaml
batdog is now known as batdog|gone
ikaros has quit ["Leaving"]
ikaros has joined #ocaml
velco has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
CosmicRay has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
delamarche has quit []
ikaros has quit ["Leaving"]
ikaros has joined #ocaml
pebblestone has joined #ocaml
pebblestone has left #ocaml []
pebblestone has joined #ocaml
pebblestone has left #ocaml []
chris2 has joined #ocaml
batdog|gone is now known as batdog
love-pingoo has quit ["Leaving"]
triple_ has quit [Read error: 148 (No route to host)]
_fab has joined #ocaml
CosmicRay has quit ["Client exiting"]
bluestorm has joined #ocaml
Leonidas has joined #ocaml
ppsmimou has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
danly has joined #ocaml
jajs has joined #ocaml
ppsmimou has joined #ocaml
gim has joined #ocaml
Leonidas has quit ["An ideal world is left as an exercise to the reader"]
delamarche has joined #ocaml
_velco is now known as velco
klapmuet1 has joined #ocaml
delamarche has quit []
ikaros has quit [Read error: 60 (Operation timed out)]
klapmuetz has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
datrus has quit ["leaving"]
oxygene has joined #ocaml
smimou has joined #ocaml
Smerdyakov has joined #ocaml
rillig has joined #ocaml
sam__ has joined #ocaml
<sam__> hi all. I'm on an intel based mac and installed OCaml using GODI. I'm trying to install mtasc and I get the following error:
<sam__> Cannot load required shared library dllunix.
<sam__> any idea what i could I be doing wrong?
<love-pingoo> no idea :(
<love-pingoo> but I've got a question: do you have native threads on intel macs ?
<sam__> i have no idea, not that technical
<love-pingoo> can you run "ocamlc -thread threads.cma"
<love-pingoo> ?
<sam__> i did, it didnt output anythin
<sam__> i know this might be a dumb question, but how do i apply a patch?
postalchris has joined #ocaml
<love-pingoo> using the patch command: patch mypatch.diff file
<love-pingoo> but usually, you need to pass more options, and I'm no good at it :\
<love-pingoo> sam__: thanks for the answer, no output is normal, it succeeded
<sam__> succeeded?
<love-pingoo> no output on the command I gave you is a success
<love-pingoo> sam__: which version of ocaml do you have ?
<love-pingoo> shit, the patch _will_ be in 3.10 :(
<love-pingoo> sam__: (lame answer, but it should just work) apply the patch by hand anyway, it's only one line change..
<love-pingoo> - powerpc-apple-darwin*)
<love-pingoo> + *-apple-darwin*)
<love-pingoo> in the configure script
<sam__> yeah, im totally confused on how to do that, what am i applying the patch to?
<sam__> i used GODI to install so I'm confused as what i need to do to reinstall
<love-pingoo> aah
<love-pingoo> then download the last source tarball
<love-pingoo> edit the configure script
<love-pingoo> and then follow the build/install procedure
<sam__> what about the version i have installed currently?
<love-pingoo> (remove from godi first)
<sam__> so your saying dont use GODI when I install the newly patched version
<love-pingoo> yeah
<love-pingoo> if you want to patch, you need to install from sources yourself
<sam__> ok, thank you very much for your help
<dbueno_> Where is a pastebin for this channel?
<dbueno_> I want to paste a bit of code that isn't working (circular doubly-linked lists & lazy evaluation)
<bluestorm> http://pastebin.be ?
<bluestorm> ( http://rafb.net or http://pastecode.com might be right as well, but if find this one is nice _and_ support OCaml)
pango has quit ["Leaving"]
<dbueno_> Can someone tell me what is wrong with the code at http://pastebin.be/3329/ ?
<dbueno_> Or at least how I can use lazy evaluation properly.
dbueno_ is now known as dbueno
<bluestorm> dbueno:
<bluestorm> you're doing an infinite something
<dbueno> Yes.
<bluestorm> hum
<dbueno> And instead of asking for an infinite computation, I need to use laziness to bound it.
<bluestorm> have you tried it in interpretor ?
<dbueno> I know I'm doing it wrong; I don't know how to fix it.
<dbueno> That error is from the OCaml interpreter.
<bluestorm> ah
<bluestorm> here is what i have
<bluestorm> i think the problem is when defining l
<dbueno> Yes...
<dbueno> I'm reasonably sure the pretty printer cuts off an infinite loop.
<bluestorm> ^^
<dbueno> Because if you run make_proper_llist as I wrote it, you'll get an aborted infinite loop.
pango has joined #ocaml
<dbueno> pango: How are you on laziness & circular data structures?
jajs has quit [Remote closed the connection]
<pango> are you sure it's a problem of lazyness, or just structural equality following your loops ?
<dbueno> pango: Not sure. The code is at http://pastebin.be/3329/
<pango> yes
<dbueno> You know how I can fix it?
<pango> does it work without the asserts ?
<pango> don't use structural equality on circular datastructures, that's all
<dbueno> Sure.
<dbueno> pango, ah. Just reference equality?
<pango> or some smarter equality that knows how to detect loops, maybe
<dbueno> Ah yes, that does work. Hmm. Is there a way not to cache the computed value after a Lazy.force?
<pango> use (fun () -> expr) instead of lazy expr
<dbueno> Then of course Lazy.force won't work on that.
<dbueno> pango, Thanks for your help.
<pango> and f () to force evaluation
<bluestorm> (do you specifically need lazyness here ?)
<pango> that's really delayed evalution
<pango> s/u/ua/
<dbueno> bluestorm, it is my impression that for pure, circular data structures, you need laziness.
<bluestorm> hm
<dbueno> I could use destructive update, but I would rather not.
<bluestorm> seems strange
<dbueno> That I don't want to use destructive update?
<bluestorm> that you need laziness
<dbueno> How else would you create a datastructure with a pointer to itself, without ref cells or mutable slots?
<bluestorm> hm
<bluestorm> just a pure recusrive datastructure ?
<dbueno> Make a linked list record that has a field that points to itself.
<dbueno> Yes.
<bluestorm> (i don't know if it work yet, but i'm trying. maybe a more experienced one like pango could say you)
<pango> bluestorm: they're usually a pain... and not only to build (printing loops, etc.)
<bluestorm> pango: does physical equality work on this type of things ?
<pango> maybe this will give you ideas on workarounds: http://okmij.org/ftp/Scheme/parent-pointers.txt
<pango> bluestorm: afaik, physical equality is guaranteed to complete
<pango> bluestorm: however,while physical equality implies structural equality, the reverse is not true
<pango> # let rec ones = 1 :: ones2 and ones2 = 1 :: ones in ones == ones2 ;;
<pango> - : bool = false
<dbueno> pango, Fortunately, physical equality is all I need.
ruben17 has joined #ocaml
<dbueno> I have A.mli and A.ml --- is there any way to get OCaml to ignore the interface I've specified in A.mli so that I can test every function in A.ml?
<dbueno> (needless to say, there are more functions in A.ml than are exposed by A.mli.)
sam__ has quit []
<dbueno> (And I would like not to rename A.mli....)
<pango> possibilities using .ml/.mli couple are limited... You'd have much more freedom by using explicit module and module type definitions
bluestorm is now known as bluestorm_aw
bluestorm_aw is now known as bluestorm
_fab has quit [Read error: 104 (Connection reset by peer)]
<dbueno> Ooh, circulary, lazily-defined data structures crash camldebug.
<dbueno> (When you try to print them.)
_fab has joined #ocaml
danly has quit ["Leaving"]
<dbueno> Can anyone figure out how to fix a bug in my lazy, doubly-linked circular list?
<dbueno> It "fails" by causing a Bus error in ocaml.
<dbueno> (If you try to use the data structure after the add.)
ruben17 has quit [Remote closed the connection]
bluestorm has quit ["Konversation terminated!"]
love-pingoo has quit ["Connection reset by pear"]
velco has quit ["I'm outta here ..."]
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
Snark has quit ["Leaving"]
malc_ has joined #ocaml
danly has joined #ocaml
chris2 has quit ["Leaving"]
katatsumuri has joined #ocaml
danly has quit ["Leaving"]
danly has joined #ocaml
Demitar_ has joined #ocaml
<katatsumuri> Somebody tried to create OCaml variants from a C interface?
bluestorm has joined #ocaml
<malc_> katatsumuri: jsure
<katatsumuri> I cant make it work. I think don't understand the structure of the variant.
<katatsumuri> I have a constructor with one int argument "EventKeyDown of int"
<katatsumuri> but the OCaml program quits or crashes with my implementation
<malc_> which is?
<katatsumuri> something like this:
<katatsumuri> CAMLlocal1 (fm_event);
<katatsumuri> fm_event = caml_alloc (2, 0);
<katatsumuri> Store_field (fm_event, 0, caml_hash_variant ("EventKeyDown"));
<katatsumuri> Store_field (fm_event, 1, Val_int ((int) event.key.keysym.sym));
<katatsumuri> CAMLreturn (fm_event);
<katatsumuri> basically
<katatsumuri> It is an SDL binding
<malc_> what variants have to do with all of this? you are dealing with plain sum types
<malc_> if your type is type t = Event of something
<malc_> then it's tag will be 0 (or 1.. too late to recall correctly)
<katatsumuri> i thought that was called variant
<katatsumuri> type event = EventNone | EventKeyDown of int | EventKeyUp of int | EventQuit;;
<katatsumuri> This is the definition in ml.
Demitar has quit [Connection reset by peer]
<malc_> then ketdown will have the tag 1 or 2
<katatsumuri> I think i found one misstake in my code
<malc_> and fwiw there are bindings to SDL already
<katatsumuri> I think EventNone and EventQuit has indices 0 and 1 because they don't have any arguments.
<katatsumuri> I know but I should learn this.
ziggurat has joined #ocaml
<katatsumuri> One mistake was that I used 3 instead of 1 for EventQuit. That made me think the program crashed because it didn't quit.
<katatsumuri> After it quits i can see that i received some EventKeyDown events but the value of the argument is totally wrong.
chessguy has quit [Read error: 110 (Connection timed out)]
benben has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
dark_light has joined #ocaml
<dark_light> is there any way to do Event.choose myeventlist and then recover a list of all other events that was not selected? because i want read/send them too, later
<dark_light> in fact i want to build a function like Event.select, but this function would call recursively itself until the list is empty, and then return ()
<dark_light> the Event module seems to be implemented in C.. there are no event.ml here at least :(
<malc_> dark_light: wrong
<malc_> dark_light: and besides choose does not _extract_ event from the list
<malc_> it returns some
<dark_light> it returns only one
<malc_> otherlibs/systhreads/event.ml
<dark_light> so the others might be forgotten
<dark_light> Hmm
<malc_> by some i mean some of the events in the list
<malc_> erm.. one some
<malc_> some one
<malc_> whatever
<dark_light> sure! and how to know exactly which events was not returned? any way?
<malc_> i doubt it
<malc_> i'd go and read CML papers (on which Event is based) to be sure though
<dark_light> it's a good idea
<dark_light> i am trying to build a complicated server without knowing the CML basis
<malc_> that's probably not such a good idea if you do use Event module
smimou has quit ["bli"]
<katatsumuri> I don't know if I really misunderstood the OCaml documentation on C binding or if the documentation is just wrong.
<katatsumuri> I have my event working now but it is not made as described in the manual but instead as in an other SDL binding I downloaded.
<dark_light> malc_, i have a let evsend chan ev = Event.sync(Event.send chan ev)), and when i need to send two events i do evsend chan1 ev1; evsend chan2 ev2, what is somewhat stupid.. but i will keep this idiotic behaviour until i read some docs about CML
<malc_> dark_light: sorry i'm of no use here, i just use condvars for my servers
<malc_> read the ML archives, there was some strong Event advocacy by someone, perhaps contacting that person would be beneficial
<dark_light> hmm, ok:)
<dark_light> someone built an example of Event syncs here and it was too simple and that's because i am trying to use events :P
<malc_> and CML was a good and entertaining reading, too bad nothing of it stuck with me.
<dark_light> i always prefer to try to build for myself than reading, and never it is cool for me stop development of something i am doing just for fun and go reading docs.. generally when i really can't do something, i stop and other day i try to read/learn how to do
<malc_> yeah well, at the very least doc describe the intent. and that's a nice thing to know.
Skal has quit [Read error: 104 (Connection reset by peer)]
beschmi has joined #ocaml
katatsumuri has quit ["Leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
malc_ has quit ["leaving"]
knobo_ has quit [Read error: 110 (Connection timed out)]
knobo has joined #ocaml
_fab has quit []