[L]ink has quit ["Switch is the two front wheels."]
[L]ink has joined #ocaml
Axioplase has quit ["Lost terminal"]
composer_ has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
middayc has quit []
__me has joined #ocaml
jknick has left #ocaml []
|Raynes| has joined #ocaml
asabil has joined #ocaml
pumpkin has quit []
jknick has joined #ocaml
[L]ink has quit [Read error: 110 (Connection timed out)]
|Raynes| is now known as [L]ink
zerny has joined #ocaml
fschwidom has quit [Remote closed the connection]
fschwidom has joined #ocaml
halberd has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]>
hi
<__me>
hi
code17 has joined #ocaml
halberd has quit [kornbluth.freenode.net irc.freenode.net]
bla has quit [kornbluth.freenode.net irc.freenode.net]
halberd has joined #ocaml
bla has joined #ocaml
johnnowak has quit []
|Raynes| has joined #ocaml
[L]ink has quit [Read error: 60 (Operation timed out)]
seafood has quit []
Gionne has joined #ocaml
<Gionne>
hello. is there anywhere the inverse of the String.concat?
<flux>
gionne, so, split a string into one-element strings?
<Gionne>
or in shorter strings
<flux>
what kind of shorter strings?
<Gionne>
when found a separator
<Gionne>
like
<flux>
well, there is Str.split
<Gionne>
Abc.bcd.Def -> Abc
<flux>
and then there's package Pcre if you want to do more advanced stuff, or if you want to be thread safe (Str isn't thread safe even in the cases where it looks like it is)
<Gionne>
uhm
<Gionne>
thanx
<Gionne>
;)
<Yoric[DT]>
I believe we have a String.split in Batteries, too.
<Yoric[DT]>
I'm pretty sure of it, actually.
<Gionne>
Str.split is perfect
<Gionne>
nevermind if it isn't thread safe ;)
<Gionne>
i have just one thread i assume
<flux>
yoric[dt], hmm, but Batteries doesn't have regular expressions does it?
<Yoric[DT]>
nope
<Yoric[DT]>
Well, it has Str.
<flux>
I'd say that's actually quite a big minus. and to top of that, it'd be nice to support Ropes and UTF8 with it..
<Yoric[DT]>
And it will probably end up with PCRE, too.
<Yoric[DT]>
Well, that won't be for release 1.
<Yoric[DT]>
We have quite enough to do for the moment.
<flux>
:)
<flux>
has it been discussed?
<Yoric[DT]>
PCRE?
<flux>
regular expressions in Batteries
<Yoric[DT]>
Or support for Unicode regexps?
<flux>
actually regular expressions would go great with a syntax extension :)
<flux>
how was it, Regexp.match "hello" with /^(w+)-(d+)$/ as word, number -> (word, number) would return a string * int
Yoric[DT] has quit [Read error: 60 (Operation timed out)]
Yoric[DT] has joined #ocaml
dejj has joined #ocaml
Spiwack has joined #ocaml
Gionne has quit ["Leaving"]
mtrimpe has joined #ocaml
<thelema>
Yoric[DT]: what do you need the JS for in batteries documentation?
<Yoric[DT]>
thelema: that's assuming we want to merge already-generated ocamldoc API documentations.
|Raynes| is now known as [L]ink
<thelema>
yes, assuming that...
<Yoric[DT]>
Well, assuming that, we need the indexes (indices?) to be generated dynamically.
<Yoric[DT]>
Hence JS.
<thelema>
the left sidebar - some sort of merge sort?
<Yoric[DT]>
Something like this.
<Yoric[DT]>
There's also the issue of links referring back to Batteries itself.
<Yoric[DT]>
i.e. having [Enum.t] refer to Batteries' documentation of the [Enum] module.
* thelema
will think about this
<Yoric[DT]>
good
<Yoric[DT]>
det: ping
<Yoric[DT]>
I've suspended my work on Batteries for a few days, waiting for additional feedback on the non-hierarchy.
<Yoric[DT]>
So far, I've only had comments by Daniel and you.
<thelema>
I've noticed dev work on batteries has slowed. No biggie, as long as we can get it going again.
<Yoric[DT]>
Yep.
<Yoric[DT]>
I must admit I'm overworked and overtired, so a break was necessary.
<Yoric[DT]>
Gasp, I have a phone call to place.
<Yoric[DT]>
I'll be back.
ygrek has quit [Remote closed the connection]
<flux>
I'm feeling that the lack or response is due to silent acceptance of the suggestion
<flux>
one usually gets responses when others disagree ;)
<flux>
one option would be to use some web voting site for some informal guidance
<Yoric[DT]>
Well, silence was good, I needed that break :)
<Yoric[DT]>
(still do, I'm afraid)
willb has joined #ocaml
|Raynes| has joined #ocaml
_zack has quit ["Leaving."]
[L]ink has quit [Nick collision from services.]
|Raynes| is now known as [L]ink
_zack has joined #ocaml
<det>
Yoric[DT], hi
<Yoric[DT]>
hi
<Yoric[DT]>
Did you complete your test of OO-performance?
<det>
I have reached a conclusion that object methods dispatch is too slow :<
<Yoric[DT]>
:/
<Yoric[DT]>
In that case, would functions [Enum.of_object] and [Enum.to_object] be useful to you?
<Yoric[DT]>
(or something such)
<det>
yeah
<Yoric[DT]>
Ok, I'll add this to my TODO list.
<det>
Not terribly important though
<Yoric[DT]>
This shouldn't be too difficult.
<Yoric[DT]>
Well, barring any accident, this should be trivial.
<det>
A shame, I bet a whole program or jit compiler could optimize method dispatch to known function calls (same for the closure method)
<det>
That is the really awesome thing about MLton, you don't pay for abstraction.
<Spiwack>
you pay for MLton though
<Yoric[DT]>
I believe a OCamlTon could be written.
<Spiwack>
well
<Spiwack>
MLton has an ocaml frontend I believe
<Spiwack>
it's also kind of slow
<Yoric[DT]>
By adding rewriting rules (in the spirit of Camlp4, but with type information) between the typing and the code generation.
<det>
MLton does not have an OCaml front end
<Spiwack>
that's like haskell, you pay little for abstraction, and moads and such, but it's also generally slower
<Spiwack>
ah
<Yoric[DT]>
Actually, I was considering suggesting a SoC on the subject.
<Spiwack>
I'm sorry for the misinformation then
mfp has quit [Read error: 113 (No route to host)]
<Spiwack>
it sounds more than a little ambitious
<det>
I think that in Ocaml, even things like fold are significantly slower than writing the loop yourself.
mfp has joined #ocaml
<Yoric[DT]>
Spiwack: well, that's why I don't do it myself :)
<Spiwack>
clever boy :)
<flux>
I really wonder how ocaml objects and polymorphic variants would get translated into SML so that you get the performance advantage of mlton..
<flux>
I suppose whole-program-compiling simplifies the issue quite a bit, though
<flux>
(such as polymorphic variants can be assigned unique global identifiers)
<flux>
and virtual tables can be built for objects, no need for binary searches
<Spiwack>
well, you still have the dynamic linking issues...
<flux>
dynamic linking of what?
<flux>
I doubt mlton supports that?
<Yoric[DT]>
Well, you still need something a bit more complicated than virtual tables when you have completely dynamic dispatch.
<Spiwack>
if you export an object in something you want to dynamically load
<Yoric[DT]>
(or, in that case, multiple inheritance)
<Spiwack>
and so and so
<flux>
yoric[dt], would it be a lot different from, say, how c++ does it
<Spiwack>
mlton probably doesn't support dynamic linking
<Spiwack>
but that's sort of cheating
<Yoric[DT]>
flux: probably not.
<Yoric[DT]>
flux: oh, yeah, a little bit
<Yoric[DT]>
flux: C++ has classes, OCaml also has class-less objects.
<Yoric[DT]>
But that can probably be helped with whole-program static analysis.
<Spiwack>
java too :D they generate a random class-name for class-less objects :D
<flux>
I'm not sure if whole-program analysis is worth it
<flux>
I mean, you still need two compilers, one for developing and one for the final build
sporkmonger has joined #ocaml
<flux>
(but mlton-backend to ocaml does sound intriquing)
<flux>
or even haskell-backend :)
Gionne has joined #ocaml
<Yoric[DT]>
:)
<flux>
I wonder how sophisticated cross-language transformations would be possible with a camlp4-approach
<Yoric[DT]>
Spiwack: well, in that case, the problem is to optimize method dispatch for class-less objects.
<flux>
where are sml, haskell, c, c++ and java-quotations for camlp4?
<Yoric[DT]>
I've seen C quotations.
<flux>
I've heard of them, not seen
<Spiwack>
what's the back-end of 'em ?
<Yoric[DT]>
Fair enough, I've seen a blog about them.
<flux>
spiwack, I believe their purpose is to generate syntax-error free c code strings
<flux>
so you get to choose the way you compile them
sporkmonger has quit []
<mfp>
there's a SML parser in camlp4's tree (unmaintained); don't know how hard it'd be to turn in into a quotation
<Spiwack>
so it goes to an abstract syntax tree, then it is compiled back into strings...
<mfp>
(camlp4/unmaintained/sml)
alexyk has joined #ocaml
mfp has quit [Read error: 104 (Connection reset by peer)]
<det>
flux, I would expect a whole program compiler could do better than vtables
<Yoric[DT]>
Well, train to catch.
<Yoric[DT]>
See you.
<det>
Later
Yoric[DT] has quit ["Ex-Chat"]
|Raynes| has joined #ocaml
[L]ink has quit [Nick collision from services.]
|Raynes| is now known as [L]ink
<halberd>
ho
mfp has joined #ocaml
<Gionne>
how do i include the Str module? Error while linking parserLL1.cmo: Reference to undefined global `Str'
<Gionne>
make: *** [all] Error 2
<Smerdyakov>
Read the manual section for that library.
<Gionne>
open Str;; isn't enough?
<Smerdyakov>
[open] has no affect on module availability in OCaml.
<det>
alexyk, look in Sys module or Unix module documentation
<flux>
oh right, that too :)
<flux>
I think there are modules for OCaml that give shell-like commands
<flux>
such as ls
<flux>
but they don't come with OCaml..
<det>
Sys has "ls"-like funciton, it is just called something else :-)
mfp_ has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
mishok13 has joined #ocaml
<alexyk>
det: hunting for things you assume are somewhere is fun :)
<alexyk>
ah, readdir
<alexyk>
take that, you Unix veterans :)
<det>
Unix has readdir too, but it takes a "dir_handle" that you must open first.
<alexyk>
this division seems rather arbitrary: Sys.readdir vs. Unix.mkdir
<det>
Sys is probably more platform independant
<flux>
afaik Windows also has Unix. I'd say the division _is_ pretty arbitrary atleast for certain things. Unix.unlink, Sys.remove? although the Unix version does throw Unix-related errors..
<flux>
but, off to home
mtrimpe has quit [Read error: 104 (Connection reset by peer)]
mtrimpe has joined #ocaml
__me has left #ocaml []
pango has quit [Remote closed the connection]
threeve has joined #ocaml
halberd has quit ["This computer has gone to sleep"]
pango has joined #ocaml
[L]ink is now known as fsharpowns
fsharpowns is now known as [L]ink
mtrimpe has quit []
mtrimpe has joined #ocaml
marmotine has joined #ocaml
pumpkin_ has joined #ocaml
Gionne has quit [Connection timed out]
Gionne has joined #ocaml
<alexyk>
# "0" != "0";;
<alexyk>
- : bool = true (* huh?! *) Am I comparing strings right?
<flux>
no
<flux>
you're comparing object identities
<alexyk>
so -- is there a simple equality for strings, or do I have to use String.compare?
<flux>
"0" <> "0"
<alexyk>
flux: ok! is it a string-specific operator?
<flux>
no
<flux>
just use = and <> always for all comparisons, unless you wish to use a higher level meaning for equality (which may be the case for examples Sets: two structurally different sets may still .compare equal)
robocop has joined #ocaml
<robocop>
Hello.
_zack has quit ["Leaving."]
<robocop>
Do you know the name of the function to convert a char to a string ?
mfp_ has quit [Read error: 104 (Connection reset by peer)]
<jonafan>
actually, yes it is
<jonafan>
but is there a better way to do what i want
<jonafan>
which is to collect a list of packets
<vixey>
jonafan, by "is this a monad" you mean?
<vixey>
jonafan, There's a couple equations that should hold -- do you know them?
<jonafan>
i don't remember them
<jonafan>
but imagine that type asdf = int;; was type asdf = awesomeoutgoingpackettype;;
<jonafan>
i probably could have set this question up better
<vixey>
bind (return x) f = f x
<vixey>
bind x return = x
<vixey>
this notation is crap
mfp_ has joined #ocaml
<jonafan>
i think the equations hold up
<vixey>
There's another one but I can't bring myself to type it out in this notation
<jonafan>
i'm trying to make a interactive program with a socket
<jonafan>
i have it set up so a central thread receives Events from the UI and from the socket
<jonafan>
many functions in the central thread may result in a packet being sent out, and each packet must have a unique id
<jonafan>
so basically i have to pass around this id pretty much constantly
<jonafan>
i'm trying to eliminate that tiresome aspect, perhaps through the magic of monads
robocop has left #ocaml []
<jonafan>
another option is to use mutable data!!! gross!!!!
<jonafan>
unclean, unclean
<vixey>
jonafan, I'm not convinced that using mutation is much worse than not
<vixey>
jonafan, apparently 'pure functions are easier to reason about' but if proved an algorithm correct .. what can go wrong?
<Yoric[DT]>
Well, pure functions tend to be also easier to compose than impure ones.
<jonafan>
yeah, well, as long as it's contained well
<jonafan>
however, this is program is not about convenience
<jonafan>
it's exploration
Camarade_Tux has joined #ocaml
Gionne has quit ["Leaving"]
mtrimpe has quit []
mfp_ has quit [Read error: 110 (Connection timed out)]
sporkmonger has joined #ocaml
mfp_ has joined #ocaml
fy__ has quit [Read error: 131 (Connection reset by peer)]
fy__ has joined #ocaml
alexyk has quit []
ygrek has joined #ocaml
jlouis has joined #ocaml
polemon has joined #ocaml
<polemon>
well, hello there
<polemon>
I'm trying to make an SQL query...
<polemon>
this is how far I am
<polemon>
let db = Mysql.quick_connect ~user:"user" ~password:"password" ~database:"dbase" () in
<polemon>
let res = Mysql.exec db "SELECT password FROM udt WHERE dataf = 'user_pass' OR dataf = 'super_pass'"
<polemon>
now I'm trying to access the result:
<polemon>
while let array = Mysql.fetch res do
<polemon>
done
<polemon>
hello?
<vixey>
polemon, The type checker doesn't lookinside strings
threeve_ has joined #ocaml
<Smerdyakov>
You didn't ask a question.
threeve_ has quit [Remote closed the connection]
<Smerdyakov>
So I don't see why you expect a response.
tomh- has joined #ocaml
<flux>
polemon, well, the while -loop is not properly formed
<flux>
polemon, you will need to use references if you decide to use while. I would imagine Mysql would provide returning the results as a list or arrays or some such, though
<Smerdyakov>
polemon, try to avoid using loops in OCaml.
<polemon>
please people, just tell me how to execute and retreive data from MySQL
<polemon>
I don't get this language and I just have to use it for one single purpose
<polemon>
is the stuff abov the while loop correct, though
<polemon>
or is that a wrong approach as well?
<flux>
it's from inside a function?
<flux>
in that case let res = .. should end to an 'in'
<Smerdyakov>
polemon, I generally refuse to help people who are "just trying to get one thing done" and don't want to consult the language manual about syntax, etc..
<flux>
I do wonder how much help can we give anyway, short from you giving the problem description and us writing the code for that
<flux>
because there can be certain things to be taught that are better read from a material than explained over IRC
<polemon>
I totally consulted the language manual, but since the manual is hardly explanatory, I seek help here
<flux>
so you're trying that out?
<flux>
the compiler should be telling you you have a syntax error in the while loop
<flux>
and for the stuff before that, well, you should find quite fast what works and what doesn't..
<Smerdyakov>
polemon, OCaml is not the kind of language where there is "a way of making an SQL query."
<Smerdyakov>
polemon, we have general type and module systems, and the ways of using components tend to follow from their types and signatures.
<Smerdyakov>
polemon, thus, you should learn the language in general.
<polemon>
hmm, wait a second...
<polemon>
I jus founf out how to work-around my problem in other language...
<polemon>
thanks anyways...
polemon has left #ocaml []
pumpkin- has joined #ocaml
[L]ink has quit [Read error: 60 (Operation timed out)]