cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
mikeX has quit ["leaving"]
<Optikal__> can you close a "let ... in" statement like in SML?
jwt_ has quit [zelazny.freenode.net irc.freenode.net]
desertbot has quit [zelazny.freenode.net irc.freenode.net]
flux has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
Nutssh has quit [zelazny.freenode.net irc.freenode.net]
tsuyoshi has quit [zelazny.freenode.net irc.freenode.net]
svenl has quit [zelazny.freenode.net irc.freenode.net]
love-pingoo has quit [zelazny.freenode.net irc.freenode.net]
ulfdoz has quit [zelazny.freenode.net irc.freenode.net]
z__z has quit [zelazny.freenode.net irc.freenode.net]
mbishop has quit [zelazny.freenode.net irc.freenode.net]
mrvn has quit [zelazny.freenode.net irc.freenode.net]
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
Demitar has quit [zelazny.freenode.net irc.freenode.net]
tsuyoshi has joined #ocaml
mbishop has joined #ocaml
ulfdoz has joined #ocaml
z__z has joined #ocaml
mrvn has joined #ocaml
tsuyoshi has quit [Client Quit]
tsuyoshi has joined #ocaml
pants1 has joined #ocaml
sourcerror has joined #ocaml
jwt_ has joined #ocaml
desertbot has joined #ocaml
flux has joined #ocaml
TaXules has joined #ocaml
Nutssh has joined #ocaml
svenl has joined #ocaml
twobitsprite has left #ocaml []
Demitar has joined #ocaml
Hadaka has joined #ocaml
<postalchris> Optikal: 'let ... in begin ... end"?
twobitsprite has joined #ocaml
<twobitsprite> where does one find documentation on the full Stream module? it seem the docs are leaving out some important parts...
b00t has joined #ocaml
benny_ has joined #ocaml
benny has quit [Read error: 110 (Connection timed out)]
G_ has joined #ocaml
G has quit [Connection timed out]
_blackdog has quit [Remote closed the connection]
<dark_light> (Unix.times()).Unix.tms_utime is specified in some unit or is just arbitrary? (I am using an tms_utime difference for comparing run time of algorithms)
<dark_light> it's like C's clock()?
* Smerdyakov learns of channel ##logic
<tsuyoshi> I assume it's in seconds
<tsuyoshi> yeah
<tsuyoshi> clock_t times(struct tms *buf);
<tsuyoshi> All times reported are in clock ticks.
<tsuyoshi> times() returns the number of clock ticks that have elapsed since an arbitrary point in the past. For Linux 2.4 and earlier this point is the moment the system was booted. Since Linux 2.6, this point is (2^32/HZ) - 300 (i.e., about 429 million) seconds before system boot time.
<tsuyoshi> ok, not seconds
<tsuyoshi> hmm but ocaml is giving it as a float
malune__ has joined #ocaml
malune_ has quit [Read error: 110 (Connection timed out)]
b00t has quit ["Leaving"]
b00t has joined #ocaml
the_dormant has joined #ocaml
LeCamarade has joined #ocaml
Optikal__ has quit [Read error: 104 (Connection reset by peer)]
<LeCamarade> @uptime
<desertbot> Uptime: 8 hours, 51 minutes and 32 seconds
<LeCamarade> Good.
<LeCamarade> @bot
<LeCamarade> @slap everyone in #ocaml
* desertbot kicks everyone in #ocaml madly.
<Smerdyakov> LeCamarade, not everyone agrees, but I think it is a breach of IRC etiquette to bring any bot into any channel without taking some sort of survey first to see who is in favor.
<LeCamarade> Smerdyakov: I can take him down right now. He is meant to work particularly with evaluating OCaml statements.
<LeCamarade> I am yet to add that plugin, though.
<LeCamarade> Because of the security considerations.
<LeCamarade> I figured it was fine with everyone to have a bot that could do for #ocaml what lambdabot does for #haskell. I could be wrong, in which case I'll take the bot to another channel, which we'd have to enter to evaluate statements.
<LeCamarade> Nobody had complained, though, so I assumed it was okay with everyone.
desertbot has quit [Remote closed the connection]
<Smerdyakov> Bot testing tends to eat up channel bandwidth while benefiting no one but the tester, who could just as well use a separate channel.
<Smerdyakov> But feel free to ignore me if others disagree.
<LeCamarade> Smerdyakov: I test on another channel and deploy here.
<LeCamarade> Smerdyakov: They don't necessarily agree. They just went along with the idea, and we were discussing ways to sandbox the expressions well not to cause security risks.
<mbishop> LeCamarade: btw, I hope "tobtresed" isn't desertbot's actual password :)
<LeCamarade> So, maybe until someone asks me about it. Meanwhile, I work on this statement evaluation module, and I'll be using it in a tutorial channel if I can't use it here.
<LeCamarade> mbishop: I just used ... no! You changed it?
<LeCamarade> By the way, the source has changed lots. The modules especially. And I added some trivial ones.
<LeCamarade> String.reverse "desertbot";;
* LeCamarade wishes the bot was around to evaluate that ... yes, it will have additional functions.
<LeCamarade> mbishop: You must be laughing at how crappy my code is, but I changed it a lot. :o)
<mbishop> actually, it was pretty nice
<ulfdoz> I wonder, whether lambdabot hasn't the better backend for this purpose, actually OCaml allows side-effects which in theorie could control global state.
<LeCamarade> ulfdoz: You mean to write our bot as a front-end to lambdabot?
<LeCamarade> And I don't doubt that lambdabot has a better back-end.
jwt_ has quit ["Ex-Chat"]
<ulfdoz> LeCamarade: No, but you have to consider a bit more in ocaml.
<LeCamarade> mbishop: It is overdosed on Haskell idioms, which simply don't work in many cases (treating strings as char list ? WTF?).
<LeCamarade> ulfdoz: I have the basic framework working. My biggest problem, at the moment, is how to evaluate statements safely. Maybe I can't escape inserting the statement in a file and evaluating that...
<ulfdoz> Actually you must reset all state keeping variables, when leaving scope of the evaluation of statement, else side-effects could influence the next one.
<LeCamarade> I don't think I'll have a running ocaml system to do the evaluations. I think every statement will incur startup overhead so as to have a fresh state and any necessary libs we may have written to make things easier (or for security).
<mbishop> Might want to check out how the SML guys do it with smlbot
<LeCamarade> I think it is what lambdabot uses too. (Never got lambdabot's source, though.)
<LeCamarade> mbishop: Aye.
<Smerdyakov> smlbot uses HaMLet, which is an interpreter that applies the language Definition literally.
<Smerdyakov> Completely safe. Ways out of the sandbox aren't even implemented.
<Smerdyakov> For those who don't know the Definition, what I mean is essentially that evaluation proceeds by applying operational semantics rules to syntax.
<LeCamarade> Smerdyakov: Wow. That's more work that we are willing to put in for a bot. :o) Since OCaml doesn't seem to ... can Campl4 be useful here?
* LeCamarade is nealry clue-less about campl4
<Smerdyakov> HaMLet was already implemented as a project of independent interest.
<Smerdyakov> OCaml doesn't even have a definition, so it's not even possible to contemplate creating a similar tool for it.
<mbishop> Smerdyakov: is smlbot's source available anywhere?
<Smerdyakov> I have no information on that. It's not exactly a community effort, as far as I know; just Andreas Rossberg's pet project.
bluestorm_ has joined #ocaml
<Smerdyakov> ...but I bet all the interesting stuff is in HaMLet, which is easy to find on the web.
* mbishop nods
Smerdyakov has quit ["Leaving"]
the_dormant has quit ["Au revoir"]
malune_ has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
LeCamarade has quit ["Boss has some work for me"]
malune__ has quit [Read error: 110 (Connection timed out)]
bluestorm_ has joined #ocaml
Ai_Itai has joined #ocaml
jlouis has quit [Remote closed the connection]
jlouis has joined #ocaml
sourcerror has quit ["Quit"]
sourcerror has joined #ocaml
G__ has joined #ocaml
G__ is now known as G
pants2 has joined #ocaml
pants1 has quit [Read error: 110 (Connection timed out)]
G_ has quit [Read error: 110 (Connection timed out)]
malune__ has joined #ocaml
Demitar has quit [Read error: 104 (Connection reset by peer)]
Demitar_ has quit [Read error: 104 (Connection reset by peer)]
Demitar__ has joined #ocaml
Demitar has joined #ocaml
malune_ has quit [Read error: 110 (Connection timed out)]
bluestorm_ has quit ["Konversation terminated!"]
<mrvn> Hehe, I just got a nice error:
<mrvn> try loop (); raise (Invalid_argument "loop")
<mrvn> Warning X: this statement never returns (or has an unsound type.)
kelaouchi has quit ["leaving"]
kelaouchi has joined #ocaml
love-pingoo has joined #ocaml
pants2 has quit ["Leaving."]
pants1 has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
_blackdog has joined #ocaml
Demitar__ has quit [Read error: 113 (No route to host)]
b00t has quit [Remote closed the connection]
kelaouchi has quit [zelazny.freenode.net irc.freenode.net]
flux has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
Nutssh has quit [zelazny.freenode.net irc.freenode.net]
svenl has quit [zelazny.freenode.net irc.freenode.net]
kelaouchi has joined #ocaml
flux has joined #ocaml
TaXules has joined #ocaml
Nutssh has joined #ocaml
svenl has joined #ocaml
ita|away is now known as ita
* ita wonders whiy Smerdyakov keeps advertising sml .. here
<love-pingoo> it's no use advertising here on #sml
<love-pingoo> s/here/it/
malune_ has joined #ocaml
<ita> love-pingoo: certainly
malune__ has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
dark_light has quit [Read error: 104 (Connection reset by peer)]
Demitar__ has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
Demitar is now known as Demitar_
gim_ has joined #ocaml
love-pingoo has quit ["Leaving"]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
postalchris has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
slipstream has joined #ocaml
moglum has joined #ocaml
pango_ has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
pango_ has joined #ocaml
moglum has quit []
Demitar__ has quit [Read error: 113 (No route to host)]
jlouis_ has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
moglum has joined #ocaml
jlouis_ has quit ["Leaving"]
jlouis has joined #ocaml
smimou has joined #ocaml
descender has quit ["Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - E. W. Dijkstra"]
LeCamarade has joined #ocaml
LeCamarade has quit ["ExitFailure 27"]
the_dormant has joined #ocaml
bluestorm_ has joined #ocaml
Demitar__ has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
cjeris has joined #ocaml
pango_ has quit [Remote closed the connection]
<flux> R.join (left inner @@ using g_host g_info ["host"]) g_host g_info - maybe not quite as pretty as SQL, I suppose..
pango_ has joined #ocaml
ygrek has quit [Remote closed the connection]
<flux> hmm.. given let (+) a ?b c = .., there's no way to actually fill in the b without using the (+)-version of the function?
<mrvn> How is a infix operator with 3 arguments supposed to work?
vital303 has joined #ocaml
<mbishop> I don't think Smerdyakov "advertises" it here, but it's pretty well known that he prefers SML over Ocaml
<mrvn> flux: Somehow I think optional arguments don't work with infix operators on a gramatical level.
<mrvn> flux: expr ::= expr { argument }+ <<-- can be label
<mrvn> | expr infix-op expr
<mrvn> An infix-op doesn't have an 'argument' so no labels.
gunark has quit [Remote closed the connection]
edwardk has joined #ocaml
Submarine has joined #ocaml
edwardk has left #ocaml []
love-pingoo has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<flux> infix operators with 3 arguments "work fine", like let (+) a b c = a + b + c (3 + 4) 2 ;-)
<flux> (albeit it might be a tiddy bit confusing..)
<bluestorm_> hm
<bluestorm_> sad we can't write 3 + 4 2 because of application precedence over operators
mrpingoo has joined #ocaml
<flux> yes. just think of the obfuscation possibilities!
<ita> but i want to add using a multiplication operator ?
<ita> !!
<ita> (profit)
<flux> well that you can do, now!
<flux> let (*) = (+) and (+) = (*)
<ita> yeah ? :-)
<flux> let (/) a b = if Random.bool () then b / a else a / b
<flux> bet haskell can't do that, uhhuh!
<ita> flux: i did not know that - awesome!
<ita> flux: you rule
<flux> totally
postalchris has quit [Read error: 110 (Connection timed out)]
<tsuyoshi> hahhaha
<tsuyoshi> do we have an ocaml obfuscation contest or something
<flux> fpls can get very confusing after some liberal usage of higher order functions
<tsuyoshi> fpls?
<flux> functional programming languages
<tsuyoshi> oh
<tsuyoshi> you can't redefine something in a module, can you?
<flux> you sure can, if by redefining you mean assigning a new meaning to a symbol, without changing any previous usages of the said binding
<flux> I wish that produced a warning..
<flux> (duplicate top-level definitions)
<tsuyoshi> so would let List.length l = Random.int max_int work?
moglum has quit []
<flux> no, that doesn't work
<flux> you can only change symbols when you're within the module's scope
<tsuyoshi> ok so you have to make a new module and replace the old one?
<bluestorm_> yes
<bluestorm_> open List let length l = Random.int List.length l
<bluestorm_> would work
<bluestorm_> [22:24:34] <flux> let (*) = (+) and (+) = (*)
<bluestorm_> actually
<bluestorm_> you can still use Pervasives.( + ) 2 3 for example
<bluestorm_> and actually let (*) = ... doesn't work :p
<tsuyoshi> it doesn't?
<bluestorm_> hm
<bluestorm_> try it and see
<bluestorm_> that's a pretty fun error
<ita> fun haha
<ita> how ..
<bluestorm_> :p
<ita> (recursive haha)
<bluestorm_> let rec haha () = haha () ?
<ita> haha
Submarine has quit ["Leaving"]
postalchris has joined #ocaml
<pango_> actually you can redefine List.length locally in a module
<pango_> module List = struct
<pango_> include List
<pango_> let length l = Random.int (List.length l)
<pango_> end ;;
<pango_> # List.length [1;2;3;4] ;;
<pango_> - : int = 2
<bluestorm_> hm
<pango_> by shading the whole List module
<bluestorm_> never tried it
<bluestorm_> :p
<tsuyoshi> pagno: yeah that's what I meant by "make a new module"
<pango_> s/shading/shadowing/
<ita> pretty useful for debugging purposes
<ita> pango_: your rule!!!!!!!!
the_dormant has quit ["Au revoir"]
ita is now known as ita|zzz
gim__ has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
gim_ has quit [Read error: 110 (Connection timed out)]
mrpingoo has quit ["Connection reset by pear"]
love-pingoo has quit ["Connection reset by pear"]
smimou has quit ["bli"]
cjeris has quit [Read error: 104 (Connection reset by peer)]
malune__ has joined #ocaml
malune_ has quit [Read error: 110 (Connection timed out)]
pants1 has quit ["Leaving."]
<twobitsprite> camlp4o foo.ml ... seems to just output giberish... I thought it should output parsed and formatted text..?
Ai_Itai has quit [Client Quit]