dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
lmbdwr has quit ["Leaving"]
ayrnieu has joined #ocaml
<ayrnieu> FYI, ocaml seems to work fine on OpenBSD/zaurus
Leonidas has quit ["An ideal world is left as an exercise to the reader"]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
mikeX has quit ["zzZZ"]
fab__ has joined #ocaml
fab_ has quit [Read error: 110 (Connection timed out)]
ziggurat has quit ["Leaving"]
Smerdyakov has joined #ocaml
mauke has quit ["no bus no"]
chessguy has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
datrus has quit ["Lost terminal"]
b00t has joined #ocaml
Smerdyakov has quit ["Leaving"]
<crack_head> hello
<crack_head> anyone here know how to convert a "123" to an int in sml?
<crack_head> I've tried using Int.fromString("123") but this returns SOME 123
<ayrnieu> int_of_string "123"
<ayrnieu> oh, SML.
<crack_head> :)
<ayrnieu> what don't you like about the SOME?
<crack_head> well...I don't really know what it is
<ayrnieu> crack - ah. Learn SML. And then write a function that strips the SOME in a pattern match and throws an error in the other case.
<crack_head> actually...Int.fromString("123"); returns val it = SOME 123 : int option
<crack_head> what is an "int option"
<ayrnieu> yes.
<Mr_Awesome> it can either be none or some int
<Mr_Awesome> so if it fails, you get none
<Mr_Awesome> and if it succeeds, you get some int
<crack_head> aaaah
m3ga has joined #ocaml
<crack_head> hmm....so how do I get the int from it?
<ayrnieu> crack - pattern matching, as I said.
<Mr_Awesome> let SOME x = Int.fromString("123") maybe?
<Mr_Awesome> i dont know sml syntax
<Mr_Awesome> i guess youd just get an error if it was none
<crack_head> hmmm
<crack_head> ayrnieu : sorry....I'm just unsure about the pattern matching
<ayrnieu> learn SML. And then ask in #SML
<crack_head> noone is alive in #SML
<crack_head> :(
<ozzloy> in the ocaml shell, is there a way i can just hit "up" and go back in history?
<crack_head> this is part of the learning process for me
<Mr_Awesome> not in bash it would turn out
<Mr_Awesome> in windows' command prompt it works fine though
<ayrnieu> ozzloy - no. You can use a nice mode in Emacs, or you can wrap ocamltop with a readline-providing-program, which exist.
<ozzloy> ayrnieu: that would require learning emacs... maybe i should do that
<ozzloy> what's a readline-providing-program?
<ozzloy> apt-cache search readline?
<ozzloy> i see ocamlmktop, is that the same as ocamltop?
<Mr_Awesome> no
<Mr_Awesome> ocamltop is the program run by the command ocaml
<ayrnieu> ozzloy - what you call 'the ocaml shell' is a program such as produced by ocamlmktop
<ozzloy> ah
<ayrnieu> ozzloy - try rlwrap
<ozzloy> can you tell me what it means to be a readline providing app?
<Mr_Awesome> it keeps a history of entered lines so you can recall them with the up arrow
<Mr_Awesome> do you have ocamlbrowser?
<Mr_Awesome> it has a shell with that functionality
<ayrnieu> ozzloy - look at rlwrap, as I said.
<ozzloy> ayrnieu: SWEET
<ozzloy> thanks
<ozzloy> ayrnieu Mr_Awesome thank you thank you
<Mr_Awesome> np
Kzzch has quit ["The computer fell asleep"]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- State of the art IRC"]
m3ga_ has joined #ocaml
m3ga_ has quit [Client Quit]
dibblego has joined #ocaml
<ozzloy> what is the range of integers in ocaml?
<ayrnieu> ozzloy - dependent on machine numbers, probably; perhaps minus a few bits. ocaml documentation will say. If you want bignums, it offers them.
<ayrnieu> it also has Int32 and Int64 types.
<ozzloy> i just tested it to be 2^30
<ozzloy> positive
<ayrnieu> uh, OK.
<ozzloy> thanks again though
<dan2> wow, I've need rlwrap for quite some time
<dan2> ayrnieu: thanks
<dan2> ;)
m3ga has quit ["disappearing into the sunset"]
<Mr_Awesome> does no one realize that ocamlbrowser has this?
shawn has quit [Read error: 110 (Connection timed out)]
shawn has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
Mr_Awesome has quit ["and the Awesome Level drops"]
Snark has joined #ocaml
rillig has joined #ocaml
pango_ has quit [Remote closed the connection]
yondalf has joined #ocaml
yondalf_ has joined #ocaml
pango_ has joined #ocaml
yondalf has quit [Read error: 145 (Connection timed out)]
b00t has quit [No route to host]
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
Leonidas has joined #ocaml
b00t has joined #ocaml
bluestorm has joined #ocaml
YankeeWhite has joined #ocaml
<YankeeWhite> Objective Caml room? wow!
<YankeeWhite> downloading like 30 University of Washington ML language lectures and i think it's all OCaml
<YankeeWhite> <3
dibblego has quit ["Leaving"]
yondalf__ has joined #ocaml
yondalf_ has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Yankee|White has joined #ocaml
pango has quit [Remote closed the connection]
YankeeWhite has quit [niven.freenode.net irc.freenode.net]
ppsmimou has quit [niven.freenode.net irc.freenode.net]
Yankee|White is now known as YankeeWhite
pango has joined #ocaml
yondalf has joined #ocaml
yondalf__ has quit [Read error: 145 (Connection timed out)]
ppsmimou has joined #ocaml
yondalf has quit [Read error: 131 (Connection reset by peer)]
yondalf has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
yondalf has quit [Read error: 145 (Connection timed out)]
yondalf has joined #ocaml
triple_ has joined #ocaml
yondalf_ has joined #ocaml
yondalf has quit [Read error: 145 (Connection timed out)]
<ozzloy> what are the ocaml math functions?
yondalf_ has quit [Connection timed out]
<smimou> ozzloy: what do you mean ?
<smimou> you can do 3+2, 5/4, etc.
<smimou> even sin 3.
<ozzloy> thanks pango_
<ozzloy> and smimou
love-pingoo has joined #ocaml
<pango_> there's also support for rational numbers, complex numbers, large numbers,... when people say "math function" they often mean "transcendantal function", but there's more to math than that...
Leonidas has quit ["An ideal world is left as an exercise to the reader"]
<ozzloy> pango_: from the parameters of the assignment, they want real rational numbers only
<ozzloy> pango_: is it 5 am where you are?
<pango_> more like 2pm :)
<ozzloy> so you're in europe?
<pango_> yes
<ozzloy> france maybe? that'd be cool
<ozzloy> cuz ocaml has french connections somehow, yes?
<pango_> well, the inria is a french institution, yes
<pango_> I'm not sure the advantage for learning ocaml is as big as you make it... While some resources are only available in french, there's sufficient resources in english, japanese, etc... by now it seems
<pango_> and when I was at uni, over ten years ago, I barely used ocaml... I (re)learned about the language mostly by myself since then
b00t has quit [No route to host]
<ozzloy> pango_: oh i wasn't thinking of it like that
<ozzloy> just the france idea being related to ocaml
<pango_> you could say it's related to the british too... http://en.wikipedia.org/wiki/Robin_Milner... and many more... Languages, and ideas in general, usually do not appear out of void
<ozzloy> cool
<TFK> Is there anything built-in to convert a string to a list?
<pango_> a list of what
<TFK> a list of chars, for example
<pango_> not in standard lib
<TFK> And a list of ints?
<pango_> of ints ?
<TFK> You implied that some string->list conversions do exist.
<pango_> yes, like Str.split to split string in a string list, given a delimiter
<TFK> Oh, I see.
<pango_> but to access characters, the most straightforward way in ocaml is s.[index], much like arrays
<pango_> that said, a char list can be convenient, sometimes
<pango_> writing a string_to_char_list function isn't that difficult
<TFK> True.
<TFK> How come strings weren't made a class?
<pango_> what for ?
<TFK> str#length is shorter than String.length str, no?
<bluestorm> hum
<bluestorm> TFK:
<bluestorm> open String;;
<bluestorm> print_int (length str);
<TFK> And polute my the top namspace?
<bluestorm> hum
<TFK> -my
<bluestorm> i don't do that
<bluestorm> but you may want to
<bluestorm> if you find String.x too long to write
<TFK> Nah. But I wonder why OO wasn't taken advantage of in this case.
<bluestorm> hum
<bluestorm> i don't see the advantage of OO here
<bluestorm> string is something static
<bluestorm> a module is good
<bluestorm> no need for inheritance or delayed name resolution or something like that
<TFK> hum indeed.
<pango_> to continue bluestorm idea, let sl = String.length ... print_int (sl str)
<pango_> not that I use String.length often enough to care either ;)
<TFK> True.
<TFK> But I wonder: would it have been possible to make, for example, a unified iteration protocol for lists, strings, arrays with OO?
<bluestorm> hm
<pango_> like, what you get with HoF already ?
<pango_> or functors ?
<bluestorm> this would have needed some kind of underlying generalisation
<TFK> What's HoF?
<pango_> high order functions
<bluestorm> TFK: ocaml native data are lower level than that, i think
<TFK> pango_, but there is List.map and Array.map and whatnot.
<bluestorm> a unified iteration protocol require you to think the access of your data structure in a very general way
<bluestorm> how can you unify array and list ?
<bluestorm> they do not have the same use
<pango_> TFK: yes, of course
<TFK> You can access them by index (O(n) for lists, but still possible).
<pango_> TFK: and then when you know that the different datastructures have different complexities for access, etc, using a generic access on top of that is just feeding lies
<pango_> extlib API on the other hand provides enumerations to iterate over the different kinds of sets it implements...
<TFK> No, it's just adding another abstraction, which might leak. But all abstractions leak.
<pango_> it's specially bad for datastructures that are supposed to be basic
<pango_> because you usually know why you're using a list over an array, or the reverse
<TFK> Still, it would be nice to accept "just an iterable" once in a while.
<TFK> Or not :-)
<bluestorm> hum i think the way it's actually handled is good
<bluestorm> the function ask for the datastructure it should use
<bluestorm> and if you have something different, just convert it by hand
<pango_> use functorization... it's not plain luck that List.map and Array.map have the same name ;)
<mellum> What's the problem with "fold"? It does just that.
<TFK> BTW, you guys might be interested in http://www.spoj.pl/, OCaml (among many other good languages) is severely underrepresented there.
<TFK> I'm practicing my OCaml on http://www.spoj.pl/problems/NEG2/ :-)
<bluestorm> hum
<bluestorm> "how, cows, sounds like USACO"
<bluestorm> :p
<TFK> o_O;
dark_light has joined #ocaml
<bluestorm> (yay, some ocaml code founded on google code search !)
smimou has quit [Read error: 110 (Connection timed out)]
<dark_light> bluestorm, link?
smimou has joined #ocaml
slipstream-- has joined #ocaml
<bluestorm> http://www.google.com/codesearch?q=+file:.*%5C.ml&start=30&sa=N
<bluestorm> (hum, even some ocaml code in KDE (kalzium) ! )
slipstream has quit [Read error: 110 (Connection timed out)]
smimou has quit [Read error: 110 (Connection timed out)]
<buluca> only 300 files? :-|
khaladan_ has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
<dark_light> wow, it uses.. regex.. first time i saw a google search that uses regex.. i wonder if they will allow this in regular google in future :E
Smerdyakov has joined #ocaml
YankeeWhite has quit ["Who is John Galt?"]
smimou has joined #ocaml
TaXules has quit [Remote closed the connection]
khaladan_ has joined #ocaml
khaladan- has joined #ocaml
TaXules has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ has quit [Read error: 110 (Connection timed out)]
khaladan- has quit [Connection timed out]
chessguy has joined #ocaml
Snark has quit ["Leaving"]
bluestorm is now known as bluestorm_aw
postalchris has joined #ocaml
ayrnieu has quit [Read error: 104 (Connection reset by peer)]
Kzzch has joined #ocaml
postalchris has quit [Read error: 101 (Network is unreachable)]
fab__ has quit [Remote closed the connection]
ayrnieu has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- Try something fresh"]
<TFK> LablGTK is the prefered GUI toolkit for OCaml, right?
Foxyloxy has quit ["Sausages!"]
<smimou> TFK: yes
<bluestorm_aw> hum
<bluestorm_aw> btw
<bluestorm_aw> do you think there is some people doing ocaml interested by Qt ?
<buluca> bluestorm_aw: maybe...
<buluca> bluestorm_aw: butthere should be someone interested in writing bindings for qt!
<TFK> I think more people may be more interested in wxWidgets, but I gather that the existing binding is kinda on a proof-of-concept level.
<buluca> first I will try to use lablgtk2
<buluca> btw, it would be useful to have libraries that read glade files run-time
<buluca> currently it's only possible to compile them to ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
<TFK> What's the recomended OCaml editor/IDE?
<ayrnieu> tfk - 'the'? Emacs.
<TFK> And the second best? ;-)
<ayrnieu> Ask a better question.
<TFK> OK. What is a recomended OCaml editor/IDE, which is neither emacs nor vim?
<ayrnieu> If you mean "what OCaml IDEs does #OCaml recommend other than emacs or vi?", I don't recommend any. Someone else may answer you.
<TFK> I have time :-)
<ayrnieu> why don't you try some of the IDEs that people have made for O'Caml, then, and determine their suitability yourself?
<dark_light> TFK, i use gedit for real editing and vi to quick edits or remote edits
<TFK> Well, I'm trying to use Camelia (currently in editor-only capacity), and trying to figure how to copmile Cameleon2 on Windows. Maybe it'll even work ;-)
<dark_light> and i am very happy with gedit :)
<TFK> I might have been, had I been using Linux... I'm also looking at SciTe, if its website ever loads o_O
<ayrnieu> oh, windows? I suggest UltraEdit to such people, as an alternative to emacs+vi.
<TFK> lol @ "such people"
<TFK> But thanks, will look into it
<buluca> I only use Emacs + Tuareg
<ayrnieu> I'd never assume that someone uses !unix; it's rude.
<buluca> windows? ohh... sorry
<TFK> Mmm, shareware?
<TFK> ayrnieu, I think most of the world's PC users use !unix, so rude or not, it's pretty probable.
RSi_ is now known as RSi
<ayrnieu> tfk - I don't care about "most of the world's PC users".
<TFK> Then your target audience is very narrow.
<ayrnieu> sure, supposing that I had one.
<ayrnieu> My non-assumption remains.
<TFK> You don't have one? Don't you write software?
<TFK> Or do you write only for private usage?
<Kzzch> I think you can use emacs under cygwin
<TFK> emacs works quite well in a "pure" Windows environment.
<Kzzch> i'd have to second bulucas suggestion though. i'm using aquamacs with taureg, i love it
ceztko has joined #ocaml
<ceztko> hi!
<TFK> hulo
<ceztko> ALL: is it fleasible to use ocaml shared objects in C/C++ projects? Thanks
<bluestorm_aw> ceztko:
<bluestorm_aw> using the ocaml/C bindings ?
<abez> yah the ocaml C interface isn't too bad
<bluestorm_aw> hum
<bluestorm_aw> i have a question too : why isn't standard ocaml source code indented by more than 2 spaces ?
<bluestorm_aw> ocaml is the only langage i know with a so little identation generalized
<bluestorm_aw> is it a rest of old unreadable-LISP roots ? are there good reasons ?
<abez> I dunno I just use emacs and ctrl-q
<abez> A good reason to avoid a lot of identation is that scope can get pretty deep
<ceztko> bluestorm_aw: thanks! ocaml looks good!
<pango_> the language doesn't enforce any specific indentation (in fact no indentation at all)
<bluestorm_aw> of course pango_
<bluestorm_aw> but, for example
<bluestorm_aw> the translating tools from camlp4r
<bluestorm_aw> does have a 2 spaces indent
<bluestorm_aw> and every ocaml code i see (but mine) have a such little indent
<bluestorm_aw> (btw, do you have a opinion about "revised syntax" ?)
<pango_> in places it's better than usual syntax, in other places it's worse, so I'm not using it
<bluestorm_aw> hm
love-pingoo has quit ["Connection reset by pear"]
bluestorm_aw has quit [Remote closed the connection]
bluestorm has joined #ocaml
ayrnieu has quit [Remote closed the connection]
bluestorm has quit ["Konversation terminated!"]
shawn has quit ["This computer has gone to sleep"]
ceztko has quit [Read error: 104 (Connection reset by peer)]
shawn has joined #ocaml
ayrnieu has joined #ocaml
smimou has quit ["bli"]
<crack_head> anone here know how to match on a char " in sml? I've tried #""" but that doesn't seem to work
<Kzzch> anyone tried installing ocamlode?
<ayrnieu> no, I don't know about SML. In O'Caml you'd match on '"'