<everyonemines>
Is there better documentation for figuring that sort of thing out than the Library Reference?
edwin has joined #ocaml
<adrien>
it's more or less language-independant unix stuff so it's probably not going to be mentionned in language books, there a book for objective caml and unix but I can't remember the name
jamii has joined #ocaml
<everyonemines>
Unix stuff? It's supposed to work on windows too, though./
<everyonemines>
I guess you mean ocaml takes its conventions from unix.
<adrien>
"system" would be more appropriate than "unix" I guess, and that is shared between both (and more)
<zorun>
hello
jamii has quit [Ping timeout: 252 seconds]
<adrien>
everyonemines: http://ocamlunix.forge.ocamlcore.org/ , it covers unix stuff, which is a superset of what you can use with the stdlib/unix on windows
<adrien>
hi zorun
<everyonemines>
thanks
jamii has joined #ocaml
<everyonemines>
adrien: actually I think you need Filename.concat (Sys.getcwd ()) (Filename.dirname (Sys.argv.(0)));;
<everyonemines>
and then you need to remove the extra / in the middle
<everyonemines>
er nm, that's just a missing parenthesis
<everyonemines>
so I guess I wanted Filename.concat (Sys.getcwd ()) (Str.string_after(Filename.dirname (Sys.argv.(0))) 1);;
vivanov has quit [Ping timeout: 252 seconds]
jamii has quit [Ping timeout: 260 seconds]
everyonemines has quit [Ping timeout: 240 seconds]
zerny has joined #ocaml
zerny has quit [Remote host closed the connection]
ikaros has joined #ocaml
zerny has joined #ocaml
zerny has left #ocaml []
jamii has joined #ocaml
jamii has quit [Ping timeout: 250 seconds]
sku has quit [Ping timeout: 246 seconds]
sku has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 250 seconds]
jamii has joined #ocaml
jamii has quit [Ping timeout: 240 seconds]
jderque has joined #ocaml
jamii has joined #ocaml
eye-scuzzy has quit [Read error: Operation timed out]
hto has joined #ocaml
eye-scuzzy has joined #ocaml
andreas1 is now known as andreas
boscop_ is now known as boscop
tensai_cirno has joined #ocaml
_andre has joined #ocaml
jamii has quit [Ping timeout: 276 seconds]
jamii has joined #ocaml
vivanov has joined #ocaml
jamii has quit [Ping timeout: 260 seconds]
vivanov has quit [Read error: Connection reset by peer]
hto has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
DOUK has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
avsm1 has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 246 seconds]
sepp2k has joined #ocaml
redfire has joined #ocaml
<redfire>
hi
<redfire>
does anyone know how to build the following string : "foo\"bar" with the character '"' inside it ?
<redfire>
because the escape character '\' doesn't seem to work in Ocaml
<sgnb>
redfire: works for me
<sgnb>
redfire: or maybe you mean "\"foo\\\"bar\""
<redfire>
you're right...
<redfire>
stupid mistake...
<redfire>
thank you :-)
edwin has quit [Remote host closed the connection]
eye-scuzzy has quit [Quit: leaving]
ygrek has joined #ocaml
jamii has quit [Ping timeout: 250 seconds]
jamii has joined #ocaml
Truc[Akka] has joined #ocaml
jderque has quit [Quit: leaving]
mnabil has joined #ocaml
redfire has quit [Quit: leaving]
mnabil has quit [Ping timeout: 276 seconds]
tensai_cirno has quit [Quit: WeeChat 0.3.4]
mnabil has joined #ocaml
dnolen has joined #ocaml
crystal-cola has joined #ocaml
<crystal-cola>
type nat = Succ of nat ;;
<crystal-cola>
let rec nonnat = Succ nonnat in nonnat ;;
<crystal-cola>
why is this allowed?
<thelema>
why not?
<crystal-cola>
because it stops data types in ocaml being inductive types
<thelema>
it's needed to have cyclic immutable data structures
<crystal-cola>
it seems like, maybe this is more harm than good?
<crystal-cola>
I guess not
<thelema>
it's your own fault if you misuse it.
<crystal-cola>
hahaha
<thelema>
recursive values aren't too different fundamentally from recursive functions
<thelema>
and it's easy enough to fail to use recursion properly and make a broken program
<crystal-cola>
I see
dnolen has quit [Quit: dnolen]
zorun has quit [Read error: No route to host]
mnabil has quit [Ping timeout: 250 seconds]
ymasory has joined #ocaml
Poet_ has joined #ocaml
Znudzon has quit [Ping timeout: 252 seconds]
mnabil has joined #ocaml
Truc[Akka] has quit [Quit: Want to be different? Try HydraIRC -> http://www.hydrairc.com <-]
ftrvxmtrx has quit [Ping timeout: 252 seconds]
Associat0r has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
hto has joined #ocaml
happy4crazy has joined #ocaml
Oejet has joined #ocaml
mnabil has joined #ocaml
hto has quit [Ping timeout: 250 seconds]
happy4crazy has left #ocaml []
avsm1 has joined #ocaml
larhat has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
Poet_ has quit [Ping timeout: 264 seconds]
avsm1 has quit [Quit: Leaving.]
Associat0r has quit [Quit: Associat0r]
edwin has joined #ocaml
ymasory has quit [Read error: Connection reset by peer]
ymasory has joined #ocaml
sepp2k has quit [Ping timeout: 252 seconds]
sepp2k has joined #ocaml
EM03 has quit [Quit: EM03]
chegibari has joined #ocaml
<chegibari>
Hello
<chegibari>
I read that people use exceptions for flow control in ocaml (this is reflected by the lack of many function returning option typee, if compared to haskell or F#)
<chegibari>
why is it so? Are ocaml exceptions particularly lightweight?
<thelema>
yes, ocaml exceptions are quite lightweight
<chegibari>
thanks
<chegibari>
is "camomile" ok for processing unicode strings?
<thelema>
yes
<chegibari>
is there anything more standard?
<thelema>
no
<chegibari>
ok
<chegibari>
double thanks :)
<thelema>
you're welcome
oriba has joined #ocaml
<chegibari>
do people use reflection in ocaml?
eikke has joined #ocaml
<thelema>
not much reflection possible, as types are not present at runtime
<everyonemines>
I'm trying to install PCRE on OS X but I get
<everyonemines>
ocamlfind: dllpcre_stubs.so: No such file or directory
<everyonemines>
so I changed makefile.config to static linking
<everyonemines>
but now I get
<everyonemines>
ocamlfind: libpcre_stubs.a: No such file or directory
<hcarty>
everyonemines: You best bet may be to email the author, Markus Mottl - http://www.ocaml.info/
<hcarty>
everyonemines: There is often a lack of OSX folks around here
<everyonemines>
Mostly linux?
<hcarty>
Yes
<everyonemines>
The way apple is going I might end up going to linux.
<everyonemines>
It's improved, I understand.
<Smerdyakov>
Linux is great.
<Smerdyakov>
I rarely have any problems with it.
<hcarty>
And good
<everyonemines>
OS X has its advantages, though
<Smerdyakov>
Apple is pure evil, though.
<Smerdyakov>
With those programming language restrictions for iPhone apps
<hcarty>
everyonemines: (begin joking flame)No it doesn't!(end joking flame)
<everyonemines>
Well, I think Apple did a good job on the standard applications, like Mail. Yeah yeah, I know, I should be using a command line email program.
<avsm>
what version of ocaml, what version of macos x?
<everyonemines>
A lot of it, though, is because of the OS X developer community, which came from earlier mac versions.
<everyonemines>
avsm: 10.5 and 3.12
<avsm>
intel or ppc?
<everyonemines>
seriously? intel.
<everyonemines>
I don't think you can run 10.5 on ppc.
<avsm>
of course you can
<everyonemines>
huh
<avsm>
uname -m ? is it x86_32 or 64
<avsm>
it works fine for me out of the box
<avsm>
click-2:pcre-ocaml-release-6.2.2 avsm$ make
<avsm>
click-2:pcre-ocaml-release-6.2.2 avsm$ find . | grep so
<avsm>
./lib/dllpcre_stubs.so
<brendan>
fink's ocaml-pcre should work too
<avsm>
yup, and macports
ulfdoz has quit [Ping timeout: 252 seconds]
<everyonemines>
avsm: I don't grep that file.
<everyonemines>
Where did you dl from?
<everyonemines>
...do I have the windows version or something?
<everyonemines>
I entered find . | grep so and get nothing.
<everyonemines>
Just redownloaded from author's site.
<everyonemines>
I don't know what's up with that.
avsm has quit [Quit: Leaving.]
brendan has left #ocaml []
brendan has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
andreas has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
mnabil has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
philed has quit [Ping timeout: 246 seconds]
<everyonemines>
Now I messed something up with regular expressions, and even the library examples aren't working.
<hcarty>
Or Str.(split_delim (regexp " ") " abc ") if you want to play with 3.12 syntax
<everyonemines>
I had opened it before and didn't realize.
impy has quit [Quit: impy]
wuj has joined #ocaml
<hcarty>
everyonemines: The toplevel can bite you that way :-)
<everyonemines>
To be honest the documentation could probably be clearer.
<hcarty>
everyonemines: Which parts?
<hcarty>
OCaml's documentation is definitely lacking in some areas, but it's excellent in others
<hcarty>
The distinction is probably not well advertised
<everyonemines>
Well, in the library reference, examples would be more helpful than the -> 'a array -> unit type stuff.
<everyonemines>
Most of the functions have no examples.
<hcarty>
I agree that examples are useful, but the types provide a huge amount of information.
<hcarty>
More than a set of examples would
<hcarty>
They take a bit more to get used to
<hcarty>
than example code
<hcarty>
But once you know what they mean the type signature of a function is a useful and concise reference.
<hcarty>
All that said, the official OCaml distribution is sadly lacking in example code.
<everyonemines>
It could be on a separate page, or you could have links for pages for functions.
<hcarty>
My guess is that part of the reason there are few/no examples in the documentation is that users may be expected to understand the concepts behind the functions already
<everyonemines>
No I get the concepts, but which input is which is hard for me to figure out from the signature.
<hcarty>
everyonemines: Is there a function in particular you have in mind?
<everyonemines>
no
<everyonemines>
I'm not stuck on anything, it's just annoying.
Amorphous has quit [Ping timeout: 260 seconds]
<everyonemines>
I think a lot of people would get stuck, though.
<hcarty>
I'm used to it at this point, but I actually filed a bug report about this when I first started out with OCaml :-)
<hcarty>
Most, if not all, of the stdlib functions which have potentially mismatched arguments have short examples of how to call them
<everyonemines>
The other day I wanted to know how to find the process directory. Well you want Sys.argv but how should you know that?
<everyonemines>
"The command line arguments given to the process" isn't very clear.
<hcarty>
That is probably a C holdover
<everyonemines>
The way you add libraries in the compiler isn't very intuitive either. It would be better to automatically detect #load statements, wouldn't it?
<hcarty>
Not necessarily
<hcarty>
You can load different implementations of a library with the same module names, for example.
<hcarty>
And ocamlfind/findlib provides a nice way to load or link libraries
<everyonemines>
Yeah, but you need to know to look for them and then download and compile them.
<hcarty>
Batteries does a lot to help with discoverability of functions
<hcarty>
You could use GODI, which builds OCaml + libraries
<hcarty>
Beyond that, there is the oasis-db project (currently under heavy development) which will give the OCaml world a CPAN-like infrastructure
impy has joined #ocaml
<hcarty>
The OCaml community is smaller than the communities around many other languages (Perl, Python, Haskell)
<everyonemines>
Yeah, I realize that some of this is just # of developers available.
<everyonemines>
In terms of stuff / size ocaml is impressive.
<everyonemines>
There's also another benefit to size, which is that google will bring up people with your question.
<hcarty>
The combination of Batteries and ocamlfind and oasis-db will hopefully help lower the initial levels of frustration people feel with the language.
<everyonemines>
...I don't think newcomers will be installing stuff like that. Or are you saying it will be available prepackaged?
<hcarty>
Prepackaged for Debian and Fedora at least :-)
<everyonemines>
Anyway, I originally mentioned example code for the library functions. That doesn't take so long to make does it?
<hcarty>
Other operating systems would be up to volunteers using those OSs
<hcarty>
It doesn't take long to make, but people have other work to do
<hcarty>
There are several tutorials available
<hcarty>
And libraries like Batteries which extend the standard library and come with a large set of examples.
<hcarty>
The language authors don't have a lot of time to spend on OCaml so their focus tends to be on improving and extending the compiler itself.
Amorphous has joined #ocaml
<everyonemines>
well, it is a nice compiler
<everyonemines>
It also seems like there's some fragmentation, between SML, ocaml, F#
<everyonemines>
I'm not sure there's much point to that division.
<hcarty>
SML is from a different heritage, as I understand it. OCaml and SML share a common theoretical parent somewhere in their history, but they are and (always?) have been independent languages.
<hcarty>
F# is Microsoft's "embrace and 'extend'" take on OCaml
<everyonemines>
yeah, I know how MS is
<hcarty>
The SML world has a lot of different implementations, but at this point OCaml only has one implementation.
<hcarty>
From the outside, SML and OCaml look interchangable. From the inside, they look slightly less so.
<hcarty>
everyonemines: Have fun with OCaml, however you end up going about it.
<everyonemines>
what do you do with it?
vivanov has quit [Ping timeout: 264 seconds]
dnolen has joined #ocaml
wuj has quit [Ping timeout: 260 seconds]
lamawithonel has quit [Read error: Connection reset by peer]