<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)
<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:
<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?
<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)]