zhijie has quit [Read error: 110 (Connection timed out)]
marteo has joined #ocaml
dark_light has quit [Remote closed the connection]
<gildor>
(these slides will be available soon)
<Camarade_Tux>
:-)
ttamttam has joined #ocaml
<ski_>
mrvn : well, it's the unit of the direct sum operation on vector spaces
<ski_>
and as we all (should) know, "one shouldn't discriminate on zero" !
<schme>
Hrrm. Do any of you people know of a F#+linux support place / channel?
Associat0r has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
bogen has quit [Read error: 148 (No route to host)]
CcSsNET has joined #ocaml
bogen has joined #ocaml
Yoric has joined #ocaml
CcSsNET has quit [Remote closed the connection]
CcSsNET has joined #ocaml
<gildor>
schme: F# doesn't target linux at al, the fact that it can run on Mono is a "good" side-effect, but I doubt it is officialy supported
<gildor>
(there is some statement and howto on F# homepage, but maybe upcoming version won't support it...)
<schme>
gildor: I am aware of it not targetting linux. I am just interested in finding someone who can help me to actually get it to work on Mono here for me.
<schme>
I fire up the fsi and I get glorious sigsegv. :)
<Camarade_Tux>
tried an older version? something like one year-old?
<gildor>
Camarade_Tux: good idea
<schme>
Camarade_Tux: Thanks, I'll give that a go.
<gildor>
schme: there is also a mailing list about F#, but it has been very quiet since months
<schme>
gildor: Cools. I'll do some more googling for that :)
<mfp>
uh seems the ocamlfind package name is Sqlite3, so make that #require "Sqlite3";;
<gareth_0>
hmm, i got: No such package: Sqlite3
<mfp>
you can get the list of packages with ocamlfind list
<mfp>
it should be there (maybe it's sqlite3 after all)
Pimm has quit [Read error: 110 (Connection timed out)]
<gareth_0>
yup it is lowercase
<gareth_0>
thanks
* gareth_0
goes to look for docs on using ocaml libraries..
<mfp>
gareth_0: essentially, you need to compile with ocamlfind ocamlopt -package sqlite3 -c foo.ml
<mfp>
and then link with ocamlfind ocamlopt -package sqlite3 -o foo foo.cmx bar.cmx -linkpkg
<mfp>
that is, prefix with "ocamlfind", add -package comma,separated,pkg,list, and also -linkpkg when linking
<gareth_0>
heh, im trying to do this all using the eclipse plugin
Yoric has quit []
<mfp>
don't know eclipse, but it should be possible to specify the compiler ("ocamlfind ocamlopt") and the options somewhere
<suricator>
i am having trouble running ocamlbuild and ocamldoc with the same directory structure... anyone familiar with ocamldoc?
Yoric has joined #ocaml
<suricator>
I have files Lib.ml and Arith.ml. Lib.ml doesn't require any external files, but Arith.ml uses functions defined in Lib.ml. Everything is defined at the top-level in each file (no submodules). Both files are in a directory "src". I can compile fine using "ocamlbuild src/Arith.native". However, if I use "ocamldoc -latex src/Lib.ml src/Arith.ml" I get
<suricator>
File "src/Arith.ml", line 37, characters 28-39:
<suricator>
Error: Unbound value Lib.explode
<suricator>
1 error(s) encountered
<suricator>
Any ideas?
<suricator>
(And function "explode" is defined in Lib.ml -- it compiled with ocamlbuild.)
<gareth_0>
mfp, there is an option for "Libraries", which works as expected with the Graphics module, but not so with Sqlite3
<mfp>
suricator: try with -I src
<suricator>
ah... what's the -l?
<suricator>
is that capital i?
<mfp>
capital i
Olalalili has joined #ocaml
<mfp>
-I <dir> Add <dir> to the list of include directories
ulfdoz has joined #ocaml
<suricator>
it compiled! :-)... but the produced pdf only has the word "Contents" in it, and nothing else
<suricator>
do you use it? is it the one you prefer?
<mfp>
that's what I'm using, yes
<suricator>
cool!
<mfp>
it handles subdir dependencies and stuff much better than make
<suricator>
how does it compare to ocamlbuild?
<mfp>
and unlike ocamlbuild is fully documented
<suricator>
ah ok
<suricator>
i like the fact with ocamlbuild that you don't need to pay much attention to where the files are and such
<suricator>
as long as they reference each other correctly
<suricator>
i'll have a look at omake...
<mfp>
I have 2 main pbs with ocamlbuild: lack of documentation, and the inability to nest subprojects (= multiple myocamlbuild.ml plugins)
ikaros has joined #ocaml
<suricator>
i wasn't very happy with make
<suricator>
as i had to write too much
ulfdoz has joined #ocaml
<suricator>
ok, so that leads me to another thing... when i have several .ml files, it would make sense in my mind to group stuff as a module inside each file.
<suricator>
so, instead of having two ml files with top-level stuff inside
<suricator>
i would have two files each of which would start
<suricator>
module foo =...
<suricator>
but, for ex for ocamlbuild, the simple fact that they are in different files
<suricator>
already makes them modules
<suricator>
that's a bit confusing for me...
<mfp>
that's imposed by the compiler (ocamlc/ocamlopt), not ocamlbuild
<suricator>
so, if I define stuff as a module on one of those files, i would need to call functions with Foo.Foo.foo_function
<mfp>
there are some proposals for namespace management related to that
<mfp>
yes
<suricator>
which doesn't make any sense
<suricator>
:)
<suricator>
so now I'm defining everything at toplevel inside each file
<suricator>
it doesn't look pretty :)
<mfp>
why?
<mfp>
you can create a new module that includes the others if you want to group them: baz.ml -> include Foo include Bar
<mfp>
but this might just mean that it all belongs in a single file
<suricator>
well... it makes you having to decide on separate files or not from the start...
<suricator>
am I making sense?
<suricator>
(i am not sure that's the case, now that i've written it down...)
<mfp>
you mean regarding cross-refs amongst modules?
<suricator>
yes
<suricator>
if make a change
<suricator>
you have to change all your code
<mfp>
they're guaranteed to be in only one direction (otherwise they'd be mutually recursive)
<mfp>
so the difference is at most one open Foo
<mfp>
unless you choose to use the full module path all the time
CcSsNET has joined #ocaml
<suricator>
that's what i usually do, yes...
<suricator>
but maybe i should use more of "open"
<mfp>
there's no harm in defining a Foo module both in a.ml and b.ml, and then doing module Foo = module include A.Foo include B.foo end
<mfp>
that way you can use Foo.xxx to refer to both A.Foo.xxx or B.Foo.xxx
<suricator>
i don't like open that much for two reasons: (i) i need to keep track of what i've opened or not; (ii) i don't like to have stuff opened when not need; (iii) it takes out that functional beauty :)
<suricator>
ah, ok
<mfp>
yeah, open makes it harder to track what you're actually using
<suricator>
so, this Foo module above would be defined exactly the same in A.ml and B.ml?
<mfp>
you'd do module Foo = struct ... end in both a.ml and b.ml, with different contents
<suricator>
ah
<mfp>
then you can combine them into a new module named Foo if wanted
<suricator>
and then the Foo.xxx would contain all of them
<mfp>
yes
<suricator>
ok
<suricator>
that can lead to trouble, i guess, no? like duplicate names...
<mfp>
if you later decide that it's better to have just one Foo, you can extract the code from a.ml and b.ml, put in in foo.ml, and remove the module Foo = .... bit
<suricator>
ok
<mfp>
right, you cannot duplicate type/module names
<mfp>
as for regular values, the last one (in this case, B.Foo's, since it's included last) would be kept
<mfp>
in general, just using foo.ml = simplest and probably best, though
<gareth_0>
thanks mfp, got it working (i think!)
CcSsNET has quit [Remote closed the connection]
<suricator>
thanks!!
<suricator>
i have set up some shell commands to compile the documentation in html and latex to the directory i want...
<suricator>
i love it! :)
<suricator>
omake may be too complicated just for now...
<suricator>
i think i'll stick to ocamlbuild and then may revert if necessary
<suricator>
mfp: do you know if can i use the same exact sources with both?
<mfp>
the .ml and .mli?
<mfp>
the build sys should adapt to build them properly, not the other way around
<mfp>
the answer is yes unless you're doing unusual things in myocamlbuild.ml
<suricator>
ok, good to hear that :)
Snark has joined #ocaml
ski_ has quit ["Lost terminal"]
<suricator>
so, if you have a foo.ml file with a lot of stuff define, but then foo.mli only exports one function, shouldn't the documentation only show that one function?
thrasibule has joined #ocaml
Alpounet has joined #ocaml
ski_ has joined #ocaml
gareth_000 has joined #ocaml
gareth_0 has quit [Remote closed the connection]
CcSsNET has joined #ocaml
ulfdoz has quit [Remote closed the connection]
ulfdoz has joined #ocaml
Pimm has joined #ocaml
suricator has quit []
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz has joined #ocaml
Amorphous has quit [Operation timed out]
Olalalili has quit ["Leaving"]
_zack has quit ["Leaving."]
gareth_000 has quit [Remote closed the connection]
gareth_000 has joined #ocaml
Amorphous has joined #ocaml
<gareth_000>
hmm
<gareth_000>
if i make ocaml segfault, is it a bug?
<bogen>
I'm new to ocaml, but my opinion would be, yes, of course, it is a bug....
<flux>
gareth_000, bug, unless you've used its unsafe features
<flux>
even native code stack overflows should produce an exception these days..
<gareth_000>
its in the sqlite3 library
<flux>
perhaps the author of the bindings would be interested
<gareth_000>
il see..
<shazam>
flux, I've had native code overflow produce a segfault
<shazam>
about 9 months ago
shazam is now known as palomer
<flux>
palomer, well, I suppose it's a bug then :). maybe it segfaults when it happens to be in C code when it happens?
<palomer>
on 3.10.2
<palomer>
it was an ocaml only interpreter
<palomer>
pretty standard stuff
<palomer>
jacques garrigue said it only happens in linux
<flux>
my naive test case properly produces Stack_overflow
<Camarade_Tux>
//win 14
<Camarade_Tux>
bah ='(
suricator has joined #ocaml
jeddhaberstro has joined #ocaml
<gareth_000>
i tried the latest version but it wont compile :/
<Camarade_Tux>
what is the error?
<gareth_000>
segmentation fault when calling pragma table_info in sqlite3
<Camarade_Tux>
how old is your sqlite and do you know if the sqlite bindings are meant for your version?
<Camarade_Tux>
palomer: you could have done a local installation of tcl/tk, also everything doesn't need tcl/tk ;è)
CcSsNET has quit [Read error: 104 (Connection reset by peer)]
slash_ has joined #ocaml
zarvok has joined #ocaml
zarvok is now known as ccasin
marteo has quit [Read error: 131 (Connection reset by peer)]
ccasin has quit ["Leaving"]
suricator has quit []
suricator has joined #ocaml
ttamttam has quit ["Leaving."]
trasz has joined #ocaml
<trasz>
i think i need to learn some functional language, and i need to choose one. why should i choose ocaml instead of e.g. haskell?
<schme>
trasz: If your goal is to get emerged deeply into functional programming then haskell might be a better choice. It forces you to do it all functional nonstop. ocaml on the other hand easily lets you out of that restriction.
<trasz>
schme: well, i'm looking for a language that will be practical to use.
<trasz>
schme: so i guess forcing me to do anything is a drawback.
<schme>
trasz: Then ocaml seems a better choice imo.
<schme>
Though people seem to be doing amazing things with haskell. Like xmonad :) and the community is vibrant.
* schme
prefers ocaml.
Yoric has joined #ocaml
<schme>
trasz: You might want to look at both. And maybe erlang which has some functionalness to it.
<trasz>
schme: ok, thanks!
<schme>
making choices easier by offering more choices :D
thrasibule has quit [Connection timed out]
tab_ has quit [farmer.freenode.net irc.freenode.net]
tonyIII has quit [farmer.freenode.net irc.freenode.net]
noj has quit [farmer.freenode.net irc.freenode.net]
safire has quit [farmer.freenode.net irc.freenode.net]
Yoric has quit []
tab_ has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
noj has joined #ocaml
safire has joined #ocaml
tonyIII has joined #ocaml
safire has quit [SendQ exceeded]
noj has quit [Connection reset by peer]
safire has joined #ocaml
noj has joined #ocaml
valross has joined #ocaml
<trasz>
utf-8 strings work in a transparent way, or do i need to do anything strange to get them to work?
<gildor>
string in ocaml are byte array, if you want to manipulate UTF-8 char you'll have to look at Camomile (for example), which will provide functions to manipulate UTF-8
<gildor>
(but you can go a long way with simple byte array)
<gildor>
trasz: depends on what utf-8 strings means for you
<trasz>
gildor: well, strings that contain utf-8 characters. so e.g. string[offset] can return correct multibyte sequence that happens to be a character number 'offset' in that string.
<trasz>
gildor: i'll look at camomile.
<gildor>
trasz: If you need to take into account multibyte sequence -> Camomile, if you just use string as data buffer -> std OCaml string is ok
<gildor>
trasz: you can also have a look at extlib, AFAIK there are a simple, utf-8 only, string manipulation
<gildor>
functions
<gildor>
(you can consider String in ocaml just as like char * in C)
Yoric has joined #ocaml
Yoric has quit [Remote closed the connection]
_Jedai_3 has joined #ocaml
|Jedai| has quit [Read error: 60 (Operation timed out)]
suricator has quit []
patronus_ has quit [farmer.freenode.net irc.freenode.net]
patronus has joined #ocaml
slash_ has quit [Client Quit]
suricator has joined #ocaml
minddog has joined #ocaml
ikaros has quit [Remote closed the connection]
Associat0r has quit []
ofaurax has joined #ocaml
ofaurax has quit [Read error: 54 (Connection reset by peer)]
suricator has quit []
ofaurax has joined #ocaml
mattam has joined #ocaml
valross has quit [Remote closed the connection]
ofaurax has quit ["Leaving"]
Pimm has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
caligula__ has quit [Read error: 104 (Connection reset by peer)]
_unK has quit [Remote closed the connection]
caligula__ has joined #ocaml
ski_ has quit ["Lost terminal"]
pad has joined #ocaml
jknick has joined #ocaml
<pad>
let x = 1;;
<mrvn>
val x : int = 1
<pad>
xavierbot is not here :(
<julm>
let x = let rec f = function 1 -> 1 | n when n land 1 = 0 -> f (n / 2) | n -> f (3 * n + 1) in f max_int;;
<mrvn>
val x : int = 1
<mrvn>
julm: you should use a hard case.
<julm>
he overflow does not hurt =)
<mrvn>
julm: run it with f 0 :)
<julm>
bleh :P
<mrvn>
Has anyone proven yet that it always reaches 1?
<julm>
for any integer, not to my knowledge
rhCYdj0 has joined #ocaml
<rhCYdj0>
salut
rhCYdj0 has quit [Remote closed the connection]
<julm>
% whois 69.63.179.35 | grep OrgName
<julm>
OrgName: Facebook, Inc.
jeddhaberstro has quit [Client Quit]
thrasibule has joined #ocaml
caligula_ has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]