Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
silkwood has quit [Ping timeout: 252 seconds]
oriba has quit [Quit: oriba]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
ahokaomaeha has quit [Ping timeout: 245 seconds]
tac-tics has quit [Quit: Page closed]
tac has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
TDJACR has joined #ocaml
ben_zen has quit [Quit: leaving]
zen_ben has joined #ocaml
zen_ben is now known as ben_zen
parlancho has quit [Ping timeout: 260 seconds]
ManAmongHippos has joined #ocaml
justdit_ has joined #ocaml
justdit_ has quit [Client Quit]
yacks has joined #ocaml
ben_zen has quit [Read error: Operation timed out]
zen_ben has joined #ocaml
zen_ben is now known as ben_zen
ben_zen_ has joined #ocaml
silkwood has joined #ocaml
groovy2shoes has joined #ocaml
ben_zen_ has quit [Quit: leaving]
ManAmongHippos has quit [Ping timeout: 255 seconds]
groovy2shoes has quit [Quit: Computer has gone to sleep]
andreypopp has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
andreypopp has quit [Quit: sleep]
andreypopp has joined #ocaml
mye_ has joined #ocaml
mye has quit [Ping timeout: 255 seconds]
mye_ is now known as mye
yacks has quit [Quit: Leaving]
darkf has quit [Quit: Leaving]
darkf has joined #ocaml
darkf_ has joined #ocaml
darkf_ has quit [Read error: Connection reset by peer]
hcarty has quit [Remote host closed the connection]
andreypopp has quit [Quit: sleep]
osa1 has joined #ocaml
<osa1>
what does Lexing.empty_token mean ? I mean, why lexer throws that exception ?
<pippijn>
your rules are not exhaustive
<osa1>
hmm
<pippijn>
maybe you're missing the eof rule
<osa1>
pippijn: that was exactly the case
<osa1>
thanks
malc_ has joined #ocaml
ttamttam has joined #ocaml
malc_ has left #ocaml []
Cyanure has joined #ocaml
andreypopp has joined #ocaml
dabd_ has quit [Read error: Operation timed out]
gour has joined #ocaml
andreypopp has quit [Quit: sleep]
djcoin has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Yoric has joined #ocaml
ftrvxmtrx_ has joined #ocaml
andreypopp has joined #ocaml
jave has joined #ocaml
yacks has joined #ocaml
ontologiae has joined #ocaml
AltGr has joined #ocaml
Cyanure has joined #ocaml
cago has joined #ocaml
cdidd has joined #ocaml
cyball has joined #ocaml
mika1 has joined #ocaml
mye has quit [Ping timeout: 244 seconds]
<osa1>
does OCaml have id function in it's standard ?
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<adrien_oww>
'a -> 'a ? no
<osa1>
yes
<flux>
it curiously does have compiler support for one, but doesn't expose it in the standard library
ontologiae has quit [Ping timeout: 244 seconds]
<osa1>
do we have a place to search in standard library by name or type ?
ttamttam has quit [Remote host closed the connection]
<adrien_oww>
ocamlbrowser; it's a labltk application
<adrien_oww>
there's also something on godi's websiet
<osa1>
adrien_oww: what is godi's website ?
f[x] has joined #ocaml
<adrien_oww>
look it up :P
<adrien_oww>
something camlcity :P
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
hkBst has quit [Ping timeout: 260 seconds]
osa1 has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
RagingDave has joined #ocaml
thomasga has joined #ocaml
Yoric has joined #ocaml
ontologiae has joined #ocaml
ocp has joined #ocaml
_andre has joined #ocaml
ocp has quit [Client Quit]
ocp has joined #ocaml
ontologiae has quit [Client Quit]
ttamttam has joined #ocaml
hkBst__ has joined #ocaml
hkBst_ has quit [Read error: Connection reset by peer]
hkBst__ is now known as hkBst
answer_42 has joined #ocaml
mcclurmc has quit [Ping timeout: 248 seconds]
ontologiae has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
osa1 has joined #ocaml
<osa1>
does anyone here remember pottier's "modern eye on ml type inference" paper ? did he published last 2 chapters of it ?
Yoric has quit [Ping timeout: 276 seconds]
yacks has joined #ocaml
rossberg has joined #ocaml
yacks has quit [Ping timeout: 255 seconds]
erlangonxen has quit [Ping timeout: 245 seconds]
RagingDave has quit [Quit: Ex-Chat]
chambart has joined #ocaml
yacks has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
fab_ has joined #ocaml
mcclurmc has joined #ocaml
<fab_>
i declared the type (type label = string;;), in a function instead of returns (label*int) returns (string*int) how can i change the result type?
<flux>
("hello":label), 42
<flux>
if of course won't help with anything but error messages and interactive type retrieval
<fab_>
i have to do this for all the entries?
<flux>
well, you can have a function do it for you
<flux>
if you want to prevent accidental operating as string, you need to either hide the type: module Label : sig type t val mk_label : string -> label val string_of : label -> string end = struct type t = string let mk_label x = x let string_of x = x end
<flux>
..or add a constructor: type label = Label of string
<fab_>
let rec comp_exp e = match e with True->[("",1)] |False->[("",0)]
<flux>
from the ocaml's point of view label is just another name for string, or that string is just another name for label
<fab_>
the functions is something like this
<fab_>
but with more lines
<flux>
with this: let mk x y = ((x : label), y) you can do True -> [mk "" 1]
<flux>
you could annotate the whole function
<flux>
let rec comp_exp e : (label * int) list = ..
chambart has quit [Remote host closed the connection]
<fab_>
ok works just putting "":label on the first, than it induces the type
<fab_>
thanks
<fab_>
all the ocaml ide are so ackwards
hkBst has quit [Read error: Connection reset by peer]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
<fab_>
awkward*
fab_ has left #ocaml []
Yoric has joined #ocaml
hkBst has quit [Ping timeout: 260 seconds]
parlancho has joined #ocaml
chambart has joined #ocaml
yacks has quit [Remote host closed the connection]
mye has quit [Quit: mye]
ontologiae has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
yacks has joined #ocaml
tac has joined #ocaml
<flux>
that Datalog module seems pretty interesting (announced in the ocaml list), now all I need is problems that are suitable for prolog to solve :)
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
Anarchos has joined #ocaml
gour_ is now known as gour
silkwood has quit [Ping timeout: 276 seconds]
leoncamel has joined #ocaml
Itewsh has joined #ocaml
paintcan has joined #ocaml
dabd_ has joined #ocaml
ahokaomaeha has joined #ocaml
darkf has quit [Quit: Leaving]
rwmjones has quit [Read error: Operation timed out]
q66 has joined #ocaml
mcsquiggedy has quit [Ping timeout: 245 seconds]
Snark_ has joined #ocaml
mcsquiggedy has joined #ocaml
Snark_ is now known as Snark
osa1 has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
ttamttam has quit [Quit: ttamttam]
cago has left #ocaml []
jamii has joined #ocaml
tac has joined #ocaml
parlancho has quit [Read error: Connection reset by peer]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
cyball has quit [Ping timeout: 252 seconds]
mika1 has quit [Quit: Leaving.]
gnuvince has quit [Ping timeout: 252 seconds]
ftrvxmtrx_ has quit [Quit: Leaving]
tac has quit [Ping timeout: 245 seconds]
ttamttam has joined #ocaml
ahokaomaeha has joined #ocaml
cyball has joined #ocaml
RagingDave has joined #ocaml
jknick has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
thomasga has quit [Quit: Leaving.]
clan_ has quit [Remote host closed the connection]
hkBst has quit [Quit: Konversation terminated!]
smondet has joined #ocaml
ahokaomaeha has quit [Ping timeout: 255 seconds]
andreypopp has quit [Quit: sleep]
osa1 has joined #ocaml
Pantoufle has joined #ocaml
ttamttam has quit [Quit: ttamttam]
tac has joined #ocaml
cyball has quit [Remote host closed the connection]
samposm has left #ocaml []
Cyanure has joined #ocaml
jbrown__ has joined #ocaml
|jbrown| has quit [Ping timeout: 276 seconds]
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
ocp has quit [Quit: Leaving.]
Submarine has joined #ocaml
ttamttam has joined #ocaml
chambart has quit [Ping timeout: 276 seconds]
tane has joined #ocaml
cyball has joined #ocaml
parlancho has joined #ocaml
ro_ has joined #ocaml
<ro_>
Hello.
<ro_>
I'm a total newbie trying to lear ocaml, and I got the impression that it could be somewhat desirable to use oasis as a build system.
<ro_>
I'm trying to use the batteries library, but I can't get past the linking stage: I keep getting those "Reference to undefined global `BatNum`" every time I try to compile my simple projet.
<orbitz>
-linkpkg
<mcsquiggedy>
There isn't really a build system that works smoothly and consistently; I spent a couple days of wasted effort trying to get oasis to work on my machine. omake is a little better, but that could just be me.
<orbitz>
I just use makefile's :)
<gour>
anything else besides those?
<mcsquiggedy>
Either way, prepare to have the build infrastructure for your project work on exactly one machine. Two if you're lucky.
<orbitz>
ocamlmakfile from mark mottul
<ro_>
mcsquiggedy, that will surely be a disappointement later, but since I'm only trying to learn even working on exactly one machine, mine, would be "good enough" :)
<orbitz>
i used that initially
<orbitz>
it works good for simple well defined things
<orbitz>
Actually given my current workflow i could probably switch back to it if I wanted
<mcsquiggedy>
If you do go with omake, know that you run the possibility of voodoo errors coming out of nowhere. Just this morning, I had sexplib throwing errors on modules that didn't even use it. Then, when I literally copied every file in the directory into a new directory, it all worked.
<mcsquiggedy>
I still don't know what was going wrong.
<ro_>
I'm trying to write a simple lexer/parser with a simple CLI around it, and maybe a few external dependencies (like batteries). What would you advise me to use ?
ottbot has quit [Ping timeout: 260 seconds]
<mcsquiggedy>
I have yet to successfully use batteries for anything. My advice would be to consult the google gods, and use whichever has been used and documented by another developer.
andreypopp has joined #ocaml
<ro_>
mcsquiggedy, That's what I tried to do, but I may not know enough about the ocaml ecosystem to find relevant information, or it is simply not there...
<ro_>
mcsquiggedy, when you say "successfully", do you refer to the build complexity, or to the quality of the library/API itself ?
<mcsquiggedy>
OCaml... doesn't really have an ecosystem.
<gour>
??
<mcsquiggedy>
I was referring to the building process. OCaml code is usually very well-behaved. Building is quirky on a good day.
ottbot has joined #ocaml
travisbrady has joined #ocaml
<gour>
considering there is attempt to improve situation with 'batteries', then OPAM package manager, it would be nice to have stable/robust build system
<ro_>
Honestly, it is really cheering me up to get so much support here, but I find it somewhat "scary" that noone here seems to agree on a "canonical" or "default" build system...
<jbrown>
what, like there is for C? :-)
<ro_>
jbrown, good point :)
<jonafan>
ocamlbuild <--
<Qrntz>
my vote goes to ocamlbuild
<companion_cube>
+1
* thelema_
recommends ocamlbuild
<ro_>
Could I paste a simple source file, if anyone can help me build it ... I'm surely making a stupid mistake, either in the source code or while trying to build it.
<thelema_>
I have a bad feeling you're not doing anything wrong, one sec
<ro_>
Or with ocamlbuild and a _tags file: ocamlbuild -use-ocamlfind test.native
<thelema_>
n/m, not that problem
<ro_>
Error: No implementations provided for the following modules: BatNum referenced from test.cmx
<adrien_oww>
add -linkpkg
<thelema_>
adrien_oww: ocamlbuild should apply liknpkg already
<thelema_>
*linkpkg
<ro_>
Should I install batteries 2.0 ?
<adrien_oww>
hmm, I shouldn't try to say anything when I don't even see right :P
<thelema_>
ro_: yes, but I doubt it will fix your problem
<thelema_>
ro_: the `ocamlfind ocamlc -package batteries -linkpkg test.ml` command compiles a trivial test.ml on my system that contains just "open BatNum"
<thelema_>
ro_: can you test this on your system?
<ro_>
Thank you, this works.
<thelema_>
ok, now's the time to pastebin your code
<thelema_>
that's how I'd write it, but I think what you've written is allowed
<ro_>
Thank you, but it does not solve my "Reference to undefined global BatNum" error
<thelema_>
you're saying it works for you with just "open BatNum", but fails on this input file?
<ro_>
Exactly.
<thelema_>
odd. It works for me with batteries 2
jpdeplaix has quit [Quit: WeeChat 0.3.7]
<ro_>
I've got exactly the same result with ocaml4 - batteries 1.5 on gentoo and ocaml 3.12 - batteries 1.4.3 on ubuntu
jpdeplaix has joined #ocaml
<ro_>
I'll try with batteries 2 and let you know what happens :)
<thelema_>
It's possible there's a problem with batteries 1.5's num; there's been a few problems found with it
jpdeplaix has quit [Client Quit]
jpdeplaix has joined #ocaml
thomasga has joined #ocaml
<ro_>
No problem with batteries 2
yacks has quit [Quit: Leaving]
<thelema_>
I guess there is a problem with batNum in 1.5; I'll have to release new version to fix this
Snark has quit [Quit: Quitte]
<ro_>
I think it also exists in 1.4, since that's what I have
<ro_>
(on the Ubuntu machine)
<thelema_>
yes, <=1.5
<ro_>
Thank you for your precious help, I would have given up long before if it wasn't for you.
<ro_>
thelema_, is the only way to build BatNum's from strings representing floating point values to use of_float (float_of_string value) ?
<thelema_>
num_of_string exists, but is deprecated
<thelema_>
val of_string : string -> num
<thelema_>
hmm, I guess it only works on integer values
<ro_>
thelema_, I've seen this function, but it seems to accpet only integer and ratio representations.;
<thelema_>
If you write a function to take a float string, split it on the decimal point, and compute the rat from the two halves, I'll add it to batteries
ottbot has joined #ocaml
<thelema_>
i.e. iprt.fprt -> iprt + (fprt/10^(length fprt))
_andre has quit [Quit: leaving]
<ro_>
Challenge accepted
ski has quit [Ping timeout: 245 seconds]
ski has joined #ocaml
lusory has quit [Ping timeout: 255 seconds]
ontologiae has joined #ocaml
lusory has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
mcclurmc has quit [Ping timeout: 252 seconds]
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
thomasga has quit [Quit: Leaving.]
Cyanure has quit [Read error: Connection reset by peer]
Cyanure has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
ttamttam has left #ocaml []
mcclurmc has joined #ocaml
<ro_>
thelema_, It took me a long time, but it was a fun exercise
<ro_>
Fourth: is there a power operator for integers ?
<thelema_>
in batteries, yes
<thelema_>
val pow : int -> int -> int
<thelema_>
In BatInt
<thelema_>
but you don't want that, you want pow for Num
<thelema_>
val pow : num -> num -> num
<ro_>
Is there an "apply" function ? For example, I might be tempted to use something like that : apply BatNum.pow (List.map BatNum.from_int [10; String.length fprt_str])
<thelema_>
eww
<orbitz>
ro_: that woudln't make much sense in Ocaml