valross has quit [Read error: 110 (Connection timed out)]
maskd has quit [verne.freenode.net irc.freenode.net]
wm_eddie has quit [verne.freenode.net irc.freenode.net]
jlouis has quit [verne.freenode.net irc.freenode.net]
infoe has quit [verne.freenode.net irc.freenode.net]
wm_eddie_ has joined #ocaml
jlouis has joined #ocaml
infoe has joined #ocaml
Yoric has joined #ocaml
valross has joined #ocaml
valross has quit [Remote closed the connection]
manju has joined #ocaml
dmentre has joined #ocaml
mjsor has joined #ocaml
Yoric has quit []
Associat0r has joined #ocaml
ikaros has joined #ocaml
mjsor has quit ["Leaving"]
mfp has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Client Quit]
caligula__ has joined #ocaml
mfp_ has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
mfp has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
maskd has joined #ocaml
ski_ has joined #ocaml
struktured has joined #ocaml
_andre has joined #ocaml
rwmjones_lptp has joined #ocaml
_zack has joined #ocaml
Alpounet has quit [Read error: 104 (Connection reset by peer)]
alp_ has joined #ocaml
mfp_ is now known as mfp
tmaeda is now known as tmaedaZ
ikaros has quit [Remote closed the connection]
mehdid has quit ["leaving"]
mehdid has joined #ocaml
<Camarade_Tux>
I never know, does ocaml expect that you order the libs properly when linking?
<mrvn>
yes
rwmjones_lptp has quit ["This computer has gone to sleep"]
<Camarade_Tux>
ok, bug found in equeue's META in godi
<Camarade_Tux>
:)
<Camarade_Tux>
hmmm, trying to use a module which hasn't been installed with godi with one that has been is a no-go, right?
_unK has joined #ocaml
munga_ has joined #ocaml
sgnb has quit [Remote closed the connection]
sgnb has joined #ocaml
<Camarade_Tux>
I can't manage to get ocamlfind to tell ocamlopt to link against a module I just installed, it adds the -I paths but not the .cmx or .cmxa files
<Camarade_Tux>
the META is pretty simple and has: archive(native) = "gWebKit.cmxa"
<Camarade_Tux>
any idea?
sgnb has quit [Remote closed the connection]
sgnb has joined #ocaml
<thelema>
Camarade_Tux: are you compiling with threads?
<Camarade_Tux>
thelema: yes, I tried to use archive(native,mt) instead of archive(native) but it's the same
<thelema>
hmmm
<Camarade_Tux>
actually right now, I'm not using threads but both behave exactly the same: I try with 'ocamlfind opt -package lablwebkit -verbose -linkpkg '
<Camarade_Tux>
ok, I tried to overwrite my META file with caml2html's and it picks up the .cmxa files
<Camarade_Tux>
.... typo in the META file...
tmaedaZ is now known as tmaeda
<mfp>
Camarade_Tux: you can use dynamic linking ;)
<Camarade_Tux>
mfp: well, I plant to but for now, I'm trying something simple, I'll increase the complexity once this is working
<Camarade_Tux>
btw, the typo was arcihve instead of archive ('h' and 'i' swapped), ocamlfind should probably have complained about that
<mfp>
(it's not more complex really; you build with -shared and without -linkpkg, and then run with ld_ocaml prog.cmxs)
<mfp>
Camarade_Tux: not really, since you can use arbitrary predicates
<mfp>
unless you add a typo detector "did you mean xxx?"
<Camarade_Tux>
hmmm, I wasn't aware that you could add arbitrary predicates
munga_ has quit [Read error: 113 (No route to host)]
<Camarade_Tux>
also, does anyone know where lablgtk2 says it has to be linked with '-ccopt -lgtk-x11-2.0'? obviously not in the META so it has to be stored in one of the .cm* files
<mfp>
I know .cma files hold this sort of info
<mfp>
so it's likely cmxa also do
<thelema>
I was just reading about how OCaml3 brough the ability for the .cmx files to hold the needed linker options.
<mfp>
ocamlobjinfo ld_util.cma > File ld_util.cma Force custom: no Extra C object files: -lld_util ...
drunK_ has joined #ocaml
<Camarade_Tux>
hmmm, at least, it seems it uses my libgWebKit_stubs.a, but it doesn't use -lwebkit, I'll see that later, I have to go now =/
_unK has quit [Read error: 110 (Connection timed out)]
jimmyb2187 has left #ocaml []
drunK_ has quit [Remote closed the connection]
_unK has joined #ocaml
jimmyb2187 has joined #ocaml
zarvok has joined #ocaml
_unK has quit [Remote closed the connection]
th5 has joined #ocaml
ikaros has joined #ocaml
albacker has joined #ocaml
<th5>
I was wondering if there is a polymorphic contains. I realize Pervasives.compare is written in C and uses low-level information about the run-time. Is there something similar out there to say that one algebraic data-type is contained in another? Would it be possible to write using calls to compare (I don't think so but maybe I'm wrong)?
<thelema>
th5: give an example
<thelema>
like record containment?
<thelema>
or like a small array of ints is contained in a larger array of ints?
<th5>
for instance an arbitrary algebraic datatype is part of another
<th5>
like a subtree
<thelema>
well, it wouldn't be difficult to search the representation for one value for a particular pointer representing the second value.
<thelema>
but on the type level... you can't do this at runtime.
<mrvn>
With prefix types you could do that
<th5>
ex: type t = N of t * t | L1 | L2 contains (N L1 L2) (N (N L1 L2) L1) = true
<th5>
easy to write for some specific type t but wondering about arbitrary types
<mrvn>
th5: Hmm, different to what I thought.
<thelema>
hmm... that'd be possible, but not particularly efficient.
<thelema>
It'd be a modification of (=) to check at every sub-position
<th5>
yes
<mrvn>
You could write code that checks if the memory representation of something is part of another. But that would have flase positives.
<thelema>
You'd have to modify the C
<th5>
i think it just have max m*n comparisons where m, n are the sizes of the terms
<mrvn>
Or some camlp4 code that writes a "contain" function for every type.
<thelema>
each comparison takes O(n) time
<th5>
would work like compare now but if false would call again on subterms
<thelema>
so you're looking at O(n^2)
<th5>
by comparison i mean if two constructors/values are same/different - not their subterms
<th5>
yeah - should be quadratic
<th5>
m * n
<th5>
because at each step you can have up to size of smaller term nubmer of comparisons
<th5>
and you can that for each spot on the larger term
<thelema>
Can be done. What do you want it for?
<thelema>
value sharing?
<th5>
well i wanted to do it for a particular case that just has a ton of different datatypes - thought it would be a pain to write manually
<thelema>
to optimize memory usage by sharing substructures?
<th5>
no - just to find cases where something occurs
<th5>
nothing fancy
<th5>
i've never dove into the function in C in the stdlib - are they pretty readable?
<th5>
i guess i'd have to know more about how the run-time works
<mrvn>
You can do it in ocaml with Obj magic.
<th5>
really? how is that?
<thelema>
You'd still have to know about runtime representations
<th5>
oh ok
<mrvn>
The Obj module has access to the runtime representations
<th5>
have to cast everything to their actual representation and then compare those
<mrvn>
No, you look at the representation
albacker has quit [Remote closed the connection]
<thelema>
You can inspect the representation by using the functions in the Obj module
<th5>
why isnt compare written in ocaml ?
<mrvn>
speed
ikaros_ has joined #ocaml
<th5>
thinking about it - Pervasives.compare is a pretty incredible function
<th5>
thanks for the info
jonafan_ is now known as jonafan
gdmfsob has joined #ocaml
ikaros has quit [Connection timed out]
ikaros_ is now known as ikaros
ski_ has quit ["Lost terminal"]
<orbitz>
th5: jaen st seems to dislike it
mishok13 has quit [Read error: 110 (Connection timed out)]
alp_ has quit [Read error: 54 (Connection reset by peer)]
Alpounet has joined #ocaml
lutter has joined #ocaml
th5 has quit []
dmentre has quit ["Leaving."]
ski_ has joined #ocaml
ttamttam has quit ["Leaving."]
albacker has joined #ocaml
jonafan_ has joined #ocaml
jonafan has quit [Read error: 60 (Operation timed out)]
jonafan_ is now known as jonafan
animist has joined #ocaml
julm has quit [Remote closed the connection]
julm has joined #ocaml
jcaose has quit [Connection timed out]
_zack has quit ["Leaving."]
jcaose has joined #ocaml
Submarine has joined #ocaml
_zack has joined #ocaml
animist has quit ["leaving"]
animist has joined #ocaml
jcaose has quit [Read error: 110 (Connection timed out)]
tmaeda is now known as tmaedaZ
Waleee has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
jcaose has joined #ocaml
tommyd3mdi has joined #ocaml
brendan has quit [Remote closed the connection]
brendan has joined #ocaml
Yoric[DT] has joined #ocaml
_andre has quit ["*puff*"]
ttamttam has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
myst has joined #ocaml
DaveS has joined #ocaml
<DaveS>
when a function is name blah' or blah'' what is that usually denoting?
<DaveS>
helper functions?
<myst>
yes
<myst>
just like in math
<myst>
or (maybe, it depends) a drivative
<myst>
s/dr/der/
<myst>
btw, the site seems to be down
<myst>
anyone experience it too?
<Camarade_Tux>
which website? caml.inria.fr?
<Camarade_Tux>
and down for me, unfortunately it's down pretty often
<Submarine>
robocop, They teach caml in terminale now!?
<Submarine>
but anyway
<robocop>
Submarine: no no
<Submarine>
(1--5) is not normal Caml syntax
<Submarine>
you're using some kind of extension of caml
<robocop>
I've got batteries installed
* Submarine
installs batteries
<robocop>
it's very strange
<Submarine>
mmmh
<Submarine>
are you sure this is not a lazy enumeration?
<robocop>
# (1--5) **> List.of_enum;;
<robocop>
Error: This expression has type int Extlib.Enum.t
<robocop>
but an expression was expected of type 'a -> 'b
<robocop>
# List.of_enum (1--5);;
<robocop>
- : int list = [1; 2; 3; 4; 5]
<robocop>
why operator **> does'nt work ?
<Camarade_Tux>
robocop:what does this show: (**>)
<Submarine>
what is it supposed to do?
<Camarade_Tux>
?
<robocop>
Camarade_Tux: no reponse...
<robocop>
# (**>);;
<robocop>
<Submarine>
( **> ) ;;
<robocop>
# (**>);;
<robocop>
Interrupted.
<robocop>
very strange
<Camarade_Tux>
thelema: ping ^^
<robocop>
Enum are lazy Camarade_Tux ?
<Submarine>
# ( **> );;
<Submarine>
- : ('a -> 'b) -> 'a -> 'b = <fun>
albacker has quit ["Leaving"]
<robocop>
ho, whith space, it's works...
<Submarine>
I said "type ( **> *)"
<Submarine>
you typed (**>
<Submarine>
token recognized (* open comment
flx_ has joined #ocaml
<Camarade_Tux>
hehe :P
<Submarine>
I confirm: enums are lazy.
<Submarine>
Just experimented.
tab_ has quit [verne.freenode.net irc.freenode.net]
tonyIII has quit [verne.freenode.net irc.freenode.net]
noj has quit [verne.freenode.net irc.freenode.net]
safire has quit [verne.freenode.net irc.freenode.net]
bzzbzz has quit [verne.freenode.net irc.freenode.net]
<robocop>
okey, thanks for your help :o
<Submarine>
If I were you I'd not do i/o side effects in a "map".
bzzbzz has joined #ocaml
noj has joined #ocaml
tab_ has joined #ocaml
safire has joined #ocaml
tonyIII has joined #ocaml
flux has quit [Read error: 104 (Connection reset by peer)]
<robocop>
yes Submarine, it's just for doing the more shortly code :o
<Camarade_Tux>
shorter is not always better :P
<robocop>
yes :p
* Submarine
encourages robocop to go to maths sup
<Submarine>
even though they do camllight
<robocop>
yes, I will go
tommyd3mdi has quit []
sramsay has joined #ocaml
ttamttam1 has joined #ocaml
<Submarine>
robocop, non-lazy enumerations would be very very bad in terms of memory usage, I think
<Submarine>
think of it, a loop around 1 million stuff would allocate a 4 megabyte array just to store the indices
<Submarine>
the problem with lazyness is that it schedule side effects at often difficult to predict times
<robocop>
hum yes
<robocop>
I don't understand all of the concept of lazy
<Submarine>
lazy means you compute when you need it
<Camarade_Tux>
which quite doesn't fit side-effects
<Submarine>
a lazy sequence is a sequence you compute one piece at a time, when you need the next piece
<robocop>
for exemple, in haskell, I see this code : take 10 (sort [1..10000000000])
<robocop>
very fun :p
Pepe__ has joined #ocaml
<robocop>
Prelude> take 10 [1..]
<robocop>
[1,2,3,4,5,6,7,8,9,10]
<Submarine>
ocaml is a eager language - by default it computes everything at once, starting from arguments to functions etc.
<robocop>
yes
<Submarine>
but you can simulate lazy evaluation in caml using various devices
<Submarine>
such as writing (fun () -> stuff) instead of stuff
<robocop>
ha ! yes
<robocop>
I see
Pepe_ has quit [Read error: 60 (Operation timed out)]
<robocop>
Streams are lazy ?
<Submarine>
from what I remember about ocaml streams, yes
ttamttam has quit [Read error: 110 (Connection timed out)]
<robocop>
okey
<robocop>
let n = read_int **> print_endline "Nbr de notes : " in let l = map (fun x -> Printf.printf "note n°%d : " x; read_int()) (1--n) in float_of_int (reduce (+) l) /. float_of_int n;;
<robocop>
I just want to show the superiority of ocaml compared to other langages :D
<robocop>
for a friend
<Camarade_Tux>
if he writes C, just compare the number of buffer overflows in both languages :P
<robocop>
yes, he writes c :p
<Submarine>
well, Python is probably shorter for what you wrote
<robocop>
sure ?
<robocop>
I'm in 173 caracteres
<robocop>
# String.length "let n = read_int **> print_endline \"Nbr de notes : \" in (float_of_int **> reduce (+) **>map (fun x -> Printf.printf \"note n°%d : \" x; read_int()) (1--n)) /. float_of_int n";;
<robocop>
- : int = 173
<Camarade_Tux>
python has a lot of syntactic sugar which will help here
<Submarine>
python has autocast, so no float_of_int and stuff
<robocop>
oh, yes
<Submarine>
it has untyped print
<robocop>
probably
<Submarine>
it also has map and sum and stuff
Narrenschiff has joined #ocaml
Pepe__ is now known as Pepe_
<Submarine>
Narrenschiff, the fools' nave?
<Narrenschiff>
Only at the weekends, pal.
<Submarine>
I meant, the meaning of your pseudonym on IRC.
<robocop>
okey, I have to go. Thanks a lot for your help !
<Camarade_Tux>
btw, I made a mistake with stashes and lost one, I recovered it as a file ( http://vpaste.net/FlmTe? ), how can I apply it back? (my git-fu still sucks)
<julm>
am
jcaose has quit [Read error: 104 (Connection reset by peer)]
Submarine has quit ["Leaving"]
thieusoai has joined #ocaml
<thieusoai>
hi, is there a function that allows me to trim the last character of string ? e.g., trim "this string\n" gives "this string"
<Camarade_Tux>
that should do it: String.sub yourstring 0 ((String.length yourstring) - 1)
sgnb has quit [Read error: 54 (Connection reset by peer)]
sgnb has joined #ocaml
ertai_ has quit [Read error: 104 (Connection reset by peer)]
ertai has joined #ocaml
munga_ has joined #ocaml
mbishop has quit [Read error: 110 (Connection timed out)]
_unK has quit [Remote closed the connection]
_zack has quit ["Leaving."]
munga_ has quit ["Ex-Chat"]
ertai has quit [Read error: 131 (Connection reset by peer)]
ertai has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
<Leonidas>
is there something like groupby (like in sql or python) in ocaml?
Yoric[DT] has quit ["Ex-Chat"]
Waleee has quit []
tmaedaZ is now known as tmaeda
thrasibule has joined #ocaml
mbishop has joined #ocaml
sramsay has quit ["Leaving"]
tmaeda is now known as tmaedaZ
prince has joined #ocaml
prince has quit [Client Quit]
tmaedaZ is now known as tmaeda
tmaeda is now known as tmaedaZ
zhijie has quit ["Leaving."]
ski_ has quit ["Lost terminal"]
valross has joined #ocaml
zhijie has joined #ocaml
thieusoai has quit ["Page closed"]
manju has left #ocaml []
tmaedaZ is now known as tmaeda
<thelema>
Leonidas: what do you want to groupby?
Levon has joined #ocaml
Levon has left #ocaml []
thrasibule has quit [Read error: 110 (Connection timed out)]
ski_ has joined #ocaml
valross has quit [Read error: 145 (Connection timed out)]
jonafan_ has joined #ocaml
spicey has joined #ocaml
<spicey>
i've got a method that i've not yet written, "method tick time -> ()", but compiling complains that it has no idea of the type of time. How can I tell the compiler that it's gonna be a float and that's fine that it's unused?
ttamttam has joined #ocaml
jonafan has quit [Read error: 113 (No route to host)]