cymonts has quit [Read error: 60 (Operation timed out)]
gl has quit [Read error: 113 (No route to host)]
bobov has quit [bear.openprojects.net irc.openprojects.net]
timmy has quit [bear.openprojects.net irc.openprojects.net]
jaene has quit [bear.openprojects.net irc.openprojects.net]
themus has quit [bear.openprojects.net irc.openprojects.net]
smkl has quit [bear.openprojects.net irc.openprojects.net]
dmiles_afkish has quit [bear.openprojects.net irc.openprojects.net]
Dybbuk has quit [bear.openprojects.net irc.openprojects.net]
mr_bubbs has quit [bear.openprojects.net irc.openprojects.net]
bobov has joined #ocaml
Dybbuk has joined #ocaml
jaene has joined #ocaml
themus has joined #ocaml
smkl has joined #ocaml
dmiles_afkish has joined #ocaml
timmy has joined #ocaml
mr_bubbs has joined #ocaml
yangsx has joined #ocaml
yangsx has quit [Remote closed the connection]
eivuokko has joined #ocaml
mr_bubbs has quit [Read error: 110 (Connection timed out)]
gl has joined #ocaml
JX has joined #ocaml
<JX>
hi
<JX>
how do I do to "transtype" a byte array into a string ?
<JX>
how do I do to convert a char array into a string ?
<JX>
(well Array.map Char.chr myByteArray works fine)
<JX>
(but does not create string
gl has quit [bear.openprojects.net irc.openprojects.net]
jaene has quit [bear.openprojects.net irc.openprojects.net]
smkl has quit [bear.openprojects.net irc.openprojects.net]
themus has quit [bear.openprojects.net irc.openprojects.net]
dmiles_afkish has quit [bear.openprojects.net irc.openprojects.net]
eivuokko has quit [bear.openprojects.net irc.openprojects.net]
bobov has quit [bear.openprojects.net irc.openprojects.net]
timmy has quit [bear.openprojects.net irc.openprojects.net]
Dybbuk has quit [bear.openprojects.net irc.openprojects.net]
gl has joined #ocaml
eivuokko has joined #ocaml
bobov has joined #ocaml
Dybbuk has joined #ocaml
jaene has joined #ocaml
themus has joined #ocaml
smkl has joined #ocaml
dmiles_afkish has joined #ocaml
timmy has joined #ocaml
CleeK has joined #ocaml
<CleeK>
huh
<JX>
you can see
<JX>
no activity
<CleeK>
:(
CleeK has left #ocaml []
bobov has quit [Read error: 104 (Connection reset by peer)]
JX is now known as DocGreen
DocGreen is now known as JX
malc has joined #ocaml
malc has quit ["no reason"]
gl-limsi has joined #ocaml
yangsx has joined #ocaml
yangsx has quit [Client Quit]
TimFreeman has joined #ocaml
gl-limsi has quit [Killed (NickServ (Nickname Enforcement))]
<TimFreeman>
Does anyone have examples where the new first-class polymorphism is useful?
<TimFreeman>
I can make toy examples but I don't see what to do with it yet.
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
yangsx has joined #ocaml
* JX
PUTAIN MAIS ILS POURRAIENT LE PASSER UN AUTRE JOUR QUE LE VENDREDI APRES MIDI LEUR PUTAIN DE ROULEAU COMPRESSEUR COMPACTEUR A LA MORD MOI LE NOEUD
<JX>
ooops
<JX>
sorry
* JX
will self punish
JX has left #ocaml []
<exarkun>
First-class polymorphism?
* exarkun
boggles.
<exarkun>
Is that, like, polymorphism as an object?
<TimFreeman>
The following is valid syntax now: type foo = {f : 'a . 'a -> 'a}
<TimFreeman>
It means that foo has a field f, and f has the type forall alpha, a function from alpha to alpha.
<TimFreeman>
Normally with polymorphism in ML-like languages, that quantifier on the type variable is always at the top level.
<TimFreeman>
But I can't immediately think of anything interesting to do with it.
* exarkun
stretches brain.
<exarkun>
Ahh, neat. I think.
<TimFreeman>
Back when I was in school, the story was that this feature tended to make type inference undecidable. I don't remember enough details nor do I understand the status quo well enough to know how they got around it.
yangsx has quit ["Client Exiting"]
TimFreeman has left #ocaml []
Dalroth has joined #ocaml
derffy has joined #ocaml
derffy has quit []
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
taw has joined #ocaml
<taw>
let id_hash = (Hashtbl.create 1024);;
<taw>
The type of this expression, ('_a, '_b) Hashtbl.t,
<taw>
contains type variables that cannot be generalized
<taw>
how can i tell it that it's string -> int
<Dybbuk>
taw: I don't know that you need to.
<taw>
i need to have Hashtbl.t variable
<taw>
from string to int
<Dybbuk>
You should be able to do that just with a Hashtbl.create.
gl has quit [Read error: 104 (Connection reset by peer)]
<two-face>
let cast w : window obj = Object.try_cast w "GtkWindow"
<two-face>
in a mli file
<malc>
two-face
<malc>
in a .mli?
<two-face>
yes
<smkl>
it must be a comment line then
<two-face>
hmm no
<two-face>
a .ml
<two-face>
gtkWindow.ml
<malc>
thats better
<malc>
basically semi-safe way to cast stuff
<malc>
as imaginative name suggests
<two-face>
is : for w is of type wndow ?
<two-face>
is : for w is of type window ?
<smkl>
window obj is type for cast w
<malc>
'a Gtk.obj i would guess
<two-face>
smkl: quite hard to see
<malc>
two-face: gtkBase.Object.try_cast
<malc>
dirty hackery
<two-face>
i would liek to handle polymorphism from C++ in OCaml, what can i do?
taw has joined #ocaml
<malc>
two-face: can you be a tad bit more specific
<two-face>
well
<two-face>
imagine in C++, B and C inherits from A, and A is virtual
<malc>
heh. reminds me recent test assignment presented after job interview. shrug
<two-face>
sometimes, some methods need A* because of polymorphism, sometimes they need B*
Dalroth has quit ["quijebo"]
<two-face>
but when you have only B*, you may want to cast it to A*
<malc>
two-face: are you subscribed to the list?
<two-face>
yes
<malc>
there was a lengthy exchange on various OO features not so long ago.. [i didnt paid enough attention however, maybe it irrelevant to your question]
<two-face>
i don't recall
<smkl>
you need to encode the class hierarchy like: type a = [ `A ] and b = [ `A | `B ] and c = [ `A | `C ], and then have type for pointers for objects in this hierarchy: type -'a t. functions that need only A have type [> a] t etc.
<malc>
it think most of the trafic was due to alex@baretta.com
<two-face>
smkl: waww, not that easy
<two-face>
malc: what month?
<malc>
July
<two-face>
hmm
<two-face>
REcovery mask methods ?
<smkl>
i guess two-face wants to interface with C++. that thread was about protected methods or something
<malc>
i dont recall.. fa.caml on groups.google.com with not so hard to figure out query strings can be helpful
<malc>
interface with C++, or emulate certain features?
<two-face>
interfacing
gene9 has joined #ocaml
<malc>
k
<smkl>
that is why two-face was looking at lablgtk code .. it has similar system to work with gtk+ "class" hierarchy
<malc>
has nothing to do with C++ though (unfort. for two-face)
<two-face>
yes, because in c++ interface, you can only create object dynmically so you have the same pointer issue
<two-face>
but lablgtk is coded by an ocaml ace
<two-face>
i was trying to code a small Ocaml interface for Qt, that is :)
<malc>
ahem
<malc>
notify me when you are done
<smkl>
i guess what i said should be enough for the OCaml side
<two-face>
smkl: exactly
<two-face>
malc: i think the hello world example would be fine
<two-face>
what needs to be done is a generalisation of the way to interface with c++
<two-face>
maybe some piece of documentation
<smkl>
does somebody know what is the easieast way to implement existential types with the new polymorphism feature?
<two-face>
well, i first have to get used to all the current ones so ... :p
* two-face
notice that a new version of tuareg mode is out
<two-face>
I'm currently writing another binding with is easier : xlibs
<smkl>
there already is an xlib using sockets
<two-face>
yes but writen in ocaml, and old, and no longer suported
<malc>
there are two xlib interfaces. LeFessant's one pure ocaml, and C bindings by some dude
<two-face>
i've never found the C bindings?
<malc>
there is little to support actually, its complete
<malc>
two-face: sec
gene9 has quit ["Client Exiting"]
<malc>
two-face: its part of ffi-1.2 by David Fox
<two-face>
ah , where ?
<two-face>
it is automated i think
<malc>
yes it is
<two-face>
i've never found the bindings in the CVS
<two-face>
it is dead
<two-face>
i have many chances to have a better design
<smkl>
i only could implement existentials using: (ex X)p(X) = ~(all x)~p(X), but i have to use an exception to eliminate (pattern match) them
gene9 has joined #ocaml
gene9 has quit ["Client Exiting"]
derfy has quit []
<two-face>
bye
two-face has quit ["Client Exiting"]
taw has left #ocaml []
gene9 has joined #ocaml
<gene9>
hmm...
<gene9>
[as@JESUS src]# uname -a
<gene9>
CYGWIN_NT-5.0 JESUS 1.3.10(0.51/3/2) 2002-02-25 11:14 i586 unknown
<gene9>
[as@JESUS src]# ocamlc -v
<gene9>
The Objective Caml compiler, version 3.05
<gene9>
Standard library directory: e:/usr/local/lib/ocaml
<gene9>
[as@JESUS src]# ocamlopt -v
<gene9>
Segmentation fault (core dumped)
<gene9>
[as@JESUS src]# gcc --version
<gene9>
3.0.4
<gene9>
[as@JESUS src]#
* gene9
is away: I'm busy
* eivuokko
is away, reading log.
* eivuokko
is back, determined that there was no point in recent discussion.
gene9 has quit ["Client Exiting"]
* malc
is determined that all finns should be at asm now
<eivuokko>
Why would you want to go there and smell sweat of nerds?