<tab1293>
I am trying to implement a function to check the periodic point of a function. There is a parameter p to this function that specifys the period, how can run the function parameter p times?
<tab1293>
so basically is it possible to apply a function p times?
lordkryss_ has quit [Quit: Connection closed for inactivity]
<bernardofpc>
tab1293: yes, but you'll have to build it for yourself
<bernardofpc>
say let rec power f p x = if p = 0 then x else power f (p-1) (f x) ;;
<tab1293>
bernardofpc: I understand that code, I am asking given a function "F" as a parameter and p=2 how can I run F(F(x))
thomasga has joined #ocaml
<tab1293>
Actaully I guess I kind of see how I can use the logic in your code to do what I want
q66 has quit [Remote host closed the connection]
q66 has joined #ocaml
tab1293 has quit [Quit: Page closed]
thomasga has quit [Quit: Leaving.]
jwatzman|work has quit [Quit: jwatzman|work]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
q66 has quit [Quit: Leaving]
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
talzeus_ has quit [Read error: Connection reset by peer]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
boogie has quit [Remote host closed the connection]
NoNNaN has quit [Remote host closed the connection]
tlockney_away is now known as tlockney
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
studybot_ has joined #ocaml
zpe has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
rta has quit [Ping timeout: 265 seconds]
ygrek has quit [Ping timeout: 246 seconds]
boogie has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
rta has joined #ocaml
rta has quit [Ping timeout: 240 seconds]
iorivur has joined #ocaml
zpe has joined #ocaml
tidren has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
rta has joined #ocaml
ygrek has joined #ocaml
tidren has quit [Remote host closed the connection]
rta has quit [Ping timeout: 240 seconds]
malvarez has quit [Quit: Leaving]
boogie has quit [Remote host closed the connection]
rta has joined #ocaml
nikki93 has quit [Remote host closed the connection]
yacks has quit [Ping timeout: 240 seconds]
yacks has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
claudiuc has quit [Remote host closed the connection]
nikki93 has joined #ocaml
siddharthv_away is now known as siddharthv
nikki93 has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
tlockney is now known as tlockney_away
michael_lee has joined #ocaml
bjkeller has joined #ocaml
michael_lee has quit [Max SendQ exceeded]
michael_lee has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
michael_lee has quit [Max SendQ exceeded]
hyperboreean has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
michael_lee has joined #ocaml
tidren has joined #ocaml
bjkeller has quit []
michel_mno_afk is now known as michel_mno
nikki93 has quit [Remote host closed the connection]
_5kg has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
ggole has joined #ocaml
axiles has joined #ocaml
nikki93 has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
_5kg has joined #ocaml
iorivur_ has joined #ocaml
iorivur has quit [Ping timeout: 240 seconds]
keen__ has joined #ocaml
the-gibson has quit [Ping timeout: 265 seconds]
keen_ has quit [Ping timeout: 264 seconds]
nikki93 has quit [Remote host closed the connection]
the-gibson has joined #ocaml
lordkryss_ has joined #ocaml
tidren has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
sgnb has joined #ocaml
AltGr has joined #ocaml
iorivur has joined #ocaml
iorivur_ has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
lordkryss_ is now known as lordkryss
Kakadu has joined #ocaml
ggherdov_ has quit [Changing host]
ggherdov_ has joined #ocaml
ggherdov_ has quit [Changing host]
ggherdov_ has joined #ocaml
Thooms has joined #ocaml
avsm has joined #ocaml
keen__ is now known as keen_
Simn has joined #ocaml
syntropy has joined #ocaml
<adrien_oww>
cmake
<adrien_oww>
just had to 'rm -rf *' to have it work
<flux>
git clean -d -x -f :)
<adrien_oww>
nah, I have valuable trash elsewhere
<adrien_oww>
and with cmake you have to
<adrien_oww>
mkdir build && cd build && cmake ..
rand000 has joined #ocaml
<adrien_oww>
so you can remove the build directory
iorivur has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
ggherdov_ is now known as ggherdov
AltGr has quit [Remote host closed the connection]
AltGr has joined #ocaml
avsm has joined #ocaml
ikaros has joined #ocaml
maattdd_ has joined #ocaml
elfring has joined #ocaml
<elfring>
I would like to store compiled files in a specific output directory directly. Do I overlook any parameter for the command "ocamlc -c" for this purpose?
<mrvn>
use a build system that supports out-of-tree builds
<adrien_oww>
elfring: ocamlbuild handles that; i.e. use oasis since it will use ocamlbuild as a backend
jbrown has joined #ocaml
<elfring>
Does the OCaml compiler store some generated files always in the same directory which was specified for their source files?
avsm has quit [Quit: Leaving.]
<Kakadu>
yes
iorivur has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
ollehar has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
NoNNaN has joined #ocaml
thomasga has joined #ocaml
steshaw has joined #ocaml
thomasga has quit [Quit: Leaving.]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
avsm has quit [Quit: Leaving.]
siddharthv is now known as siddharthv_away
<hcarty>
elfring: Regarding your cmake question - I have done some work with OCaml and cmake. It worked but was painful. Using oasis or ocamlbuild directly is a much better option if you have a choice.
studybot_ has quit [Remote host closed the connection]
<hcarty>
jpdeplaix: Do you use your monad-exn library regularly? How happy have you been with it?
<Kakadu>
I have noticed that ocaml branch safe-string was created. Where can I read more about it?
<jpdeplaix>
Kakadu: I think by asking damien :D
<jpdeplaix>
hcarty: not anymore :/
<jpdeplaix>
The main problem was that it requires all unsafe functions and libraries to be bind (or you can do it each time but it's painful)
<jpdeplaix>
I'm using BatteriesExceptionless now :D
yacks has quit [Ping timeout: 240 seconds]
<jpdeplaix>
And also, the other problem was that even if you have bind a function, you cannot be sure that it doesn't raise other exceptions than documented
<jpdeplaix>
for example, some stdlib functions doesn't document all their exceptions
steshaw has quit [Quit: Leaving.]
Nevor_ has joined #ocaml
<jpdeplaix>
my main usage was for Cervoise (see my github)
shinnya has joined #ocaml
<jpdeplaix>
I ended up thinking that it requires a full handling IN the language if you want to have things like that
yacks has joined #ocaml
avsm has joined #ocaml
<hcarty>
jpdeplaix: Ok, thanks.
<hcarty>
I've been using the Exceptionless modules in Batteries as well, so you answered my follow up question (is it worth switching)
<hcarty>
jpdeplaix: Thanks!
thomasga has joined #ocaml
thomasga has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
_andre has joined #ocaml
aurynj has quit [Ping timeout: 252 seconds]
watermind has joined #ocaml
Asmadeus has quit [Changing host]
Asmadeus has joined #ocaml
thomasga has joined #ocaml
<jpdeplaix>
hcarty: to be complete, I'm using BatteriesExceptionless + ocaml-monomorphic
<NoNNaN>
jpdeplaix: interesting, where can I access the monomorphic version of ocaml ?
<ebzzry>
How does the general OCaml community see core and utop? Are they de factor components?
<Hannibal_Smith>
companion_cube, yes I already uses that
<companion_cube>
Hannibal_Smith: it's a hard problem...
<Hannibal_Smith>
Thank you
<companion_cube>
ebzzry: that's a delicate subject. Some people use Core, others don't, and people often have strong opinion on the topic
<ebzzry>
companion_cube: Ok. I'm sorry if I have inadvertently touched that topic.
wwilly has quit [Quit: Ex-Chat]
<companion_cube>
ebzzry: that's fine :D
<companion_cube>
I just meant there's no clear cut
<ggole>
utop is just a toplevel interface, it won't affect your code
<ggole>
Use it if you find it is more pleasant than the alternatives, no big deal if you don't.
<companion_cube>
yes, utop is pretty good!
* ggole
declines to rant about the ocaml toplevel again
_5kg has joined #ocaml
<ebzzry>
Hmm. Thanks for the tips, guys.
<hcarty>
ebzzry: To be clear - utop is less controversial than library choices.
<hcarty>
utop is worth installing and trying. It has some nice features such as context-sensitive tab completion which make exploring the language easier.
<hcarty>
The Core vs (Batteries/ocamlnet/Lwt/etc) debate is something that probably should happen. It has not happened so far, at least not out in the open.
<hcarty>
It will likely be a heated discussion when it happens.
mort___ has quit [Ping timeout: 240 seconds]
<companion_cube>
such debates happened in other (small) open source communities
<companion_cube>
for instance the D language had similar problems
avsm has joined #ocaml
<ebzzry>
Hmm. Thanks for your insights.
michael_lee has quit [Quit: Ex-Chat]
mdenes has joined #ocaml
tidren has joined #ocaml
zpe has joined #ocaml
jonludlam has joined #ocaml
unknownmosquito has joined #ocaml
WraithM has joined #ocaml
<tautologico>
what is the rant about the toplevel? :)
<adrien>
hcarty: not sure
<adrien>
hcarty: there are important differences between the two
malvarez has quit [Ping timeout: 240 seconds]
<ggole>
tautologico: limited, partly broken printing facilities, no stepper, debugger or backtrace support, no way to inspect values, etc
<tautologico>
I see
ikaros has quit [Quit: Ex-Chat]
malvarez has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
<tautologico>
I just wish something else was the "standard library"
mreca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tautologico>
ocaml's standard library is barebones and not updated
<tautologico>
Core is very nice
<kerneis>
tautologico: barebones is correct, but not updated is plain wrong
<gargawel>
companion_cube: I was referred to you for a question regarding solvers. Is there any good option for mixed integer programming in OCaml ?
nikki93 has joined #ocaml
nlucaroni has joined #ocaml
<companion_cube>
I'm no expert on optimization problem, sadly (more on satisfiability issues)
thomasga has quit [Ping timeout: 240 seconds]
<gargawel>
companion_cube: Ok, thanks anyway :)
aurynj has quit [Ping timeout: 250 seconds]
pkrnj has joined #ocaml
Kakadu has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
q66 has joined #ocaml
tidren has quit [Ping timeout: 240 seconds]
jonludlam has quit [Ping timeout: 245 seconds]
q66 has quit [Ping timeout: 252 seconds]
q66 has joined #ocaml
q66 has quit [Changing host]
q66 has joined #ocaml
claudiuc has joined #ocaml
<Submarine>
Has anybody here got experience with OCamlJava?
<Submarine>
I'm curious how far it goes.
<Submarine>
gargawel, why not write into a file, call CPlex or Gurobi, and parse back?
<Drup>
OCamlJava 1 is available, but outdated, not even sure it's maintained
mdenes has joined #ocaml
<Drup>
OCamlJava is vaporware since a few years now
<Drup>
OCamlJava 2*
<Submarine>
gargawel, also, the 'opt' branch of Z3 has an optimizer, and there is a (not much working) OCaml binding for it
<Drup>
the opt branch is active on going work
<Drup>
don't even try to use it, it's breaking frequently
<Submarine>
yes, but basic Z3 does not do optimization
<Drup>
concerning the ml binding, there is a new version of the binding in the branch ml-ng
<Drup>
which is working
<Submarine>
yes, but does not support 'opt' so you'd have to merge the two ;-)
<Drup>
there is a fork from arie, and inside a branch in it called opti-z3
<Drup>
which is stable now
<Submarine>
it depends a lot on the kind of MILP problems that you wish to solve
<Submarine>
large-scale problems should be forked off to CPlex or Gurobi
<Drup>
probably
<NoNNaN>
Submarine: I have tried a last year worked more or less for small examples, but it was failed on larger examples, however the bug tracker looks active at: http://bugs.x9c.fr/
<Submarine>
Drup, yes, that's what Arie said to me testerday
pkrnj has quit [Quit: Computer has gone to sleep.]
malvarez has quit [Quit: Leaving]
pkrnj has joined #ocaml
<morolin>
Hey, I've been using "ocamlc" to generate bytecode on my projects, and I would like to switch to using ocamlopt for performance, but when I tried to just go ahead and do that (compile the same files using ocamlopt, or asking ocamlbuild to build the '.native' version for me), the code behaves differently.
<morolin>
Does anyone have a recommendation on where I should start looking to try to debug this?
<Drup>
morolin: what is your code doing ?
<mrvn>
hmm, that shouldn't happen.
<morolin>
Drup: it's a program analysis tool, basically goes through code and checks for a few correctness propertie
<morolin>
*properties
<morolin>
it uses a handful of hashtbls, which are my first area of suspicion, but I've never used the native code compiler, so I wasn't sure what might happen
<Drup>
how does it behave differently ?
<morolin>
The output is incorrect---it removes the while loops from the program it's analyzing
claudiuc_ has joined #ocaml
<morolin>
There are a handful of places in the code that might happen, but I was wondering if anyone here knew something I should be looking for before I dived in too deep
<morolin>
I couldn't find anything that might cause the execution differences when I was looking on Google
rta has quit [Ping timeout: 240 seconds]
<Drup>
well, it shouldn't happen, so if you find the incriminated piece of code, you can open a bug report about it.
<smondet>
morolin: you can look for places where the order of evaluation is unspecified, but your code still assumes a given order
<smondet>
there are differences there between bytecode and native code
<morolin>
oooh, that might happen.
<Drup>
indeed
<Drup>
stuff like side effects while List.map
claudiuc has quit [Ping timeout: 240 seconds]
<smondet>
or tuples (let x = one_thig, the_other)
<smondet>
or record creations
<morolin>
record creations?
<smondet>
or function arguments
<mrvn>
would be nice if the compiler would warn about them
<Drup>
let x = (foo(), bar())
<morolin>
ah, ok
<smondet>
mrvn: for that you need "non-purity" inference I think
<mrvn>
smondet: no
<mrvn>
drups example could simple warn
boogie has joined #ocaml
<smondet>
yes but we would end up removing the warning since many cases are OK
<mrvn>
smondet: so have it disabled by default
<Drup>
(I wouldn't be surprised if there was already such warning, actually)
pkrnj has quit [Quit: Computer has gone to sleep.]
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
tlockney is now known as tlockney_away
tidren has joined #ocaml
pkrnj has joined #ocaml
rta has joined #ocaml
pkrnj has quit [Client Quit]
<morolin>
smondet: Looks like that's what's happening. There's a couple of places where I assumed ordering without specifying it, and those seem to be where things are screwing up. Now to do some rewriting. Thanks!
Arsenik has quit [Remote host closed the connection]
<Drup>
morolin: in general, this is bad style to assume a specific order of evaluation when you can avoid it
<ToTheInternet>
It doesn't display the type of the functions, and also it doesn't display the right functions.
<companion_cube>
it should be omnicomplete
<ToTheInternet>
companion_cube: yes
<companion_cube>
first you should try to see whether merlin works at all : use \t on an identifier to show its type
<ToTheInternet>
companion_cube: ok, it doesn't work. I tried :TypeOf and it says there is no such command
darkf has joined #ocaml
<companion_cube>
I guess you're trying with a single file, for now?
<companion_cube>
you might need to write a few lines in .merlin for more complicated projects, but given a correct config merlin should work out-of-the-box on single files
<ToTheInternet>
companion_cube: yes, single file.
<ToTheInternet>
companion_cube: Merlin is loaded, :scriptnames shows /usr/local/share/ocamlmerlin/vim/plugin/merlin.vim
<companion_cube>
there's a python part
<companion_cube>
guess :SourcePath doesn't work either?
<ToTheInternet>
companion_cube: yup, doesn't work
<companion_cube>
so the python stuff isn't loaded
<ToTheInternet>
ok. let me see if i can find why that is. according to the read me all that needs to be done is configure, make and make install
<companion_cube>
I can't help you much further, but tomorrow you may ask def-lkb
<ToTheInternet>
companion_cube: you've helped me loads, thanks :)
<def-lkb>
re
<def-lkb>
merlin.vim is in scriptnames… What is your :set filetype?
<ToTheInternet>
def-lkb: ocaml
<def-lkb>
plugin/merlin.vim alone is not enough, you should have autoload/merlin.vim
<ToTheInternet>
def-lkb: yes, i have that one as well
<ToTheInternet>
and autoload/vimsyncbuf also
<ToTheInternet>
and syntax_checkers/ocaml/merlin.vim
<def-lkb>
ok, normally that's everything that is needed
<def-lkb>
try opening another ml file, and see if it's the same?
nojb has joined #ocaml
<def-lkb>
(and what is the value of :set omnicomplete?)
<ToTheInternet>
Hm... unknown function omnicomplete
<def-lkb>
sorry, omnifunc
<def-lkb>
:set omnifunc?
<ToTheInternet>
omnifunc=syntaxcomplete#Complete
<ToTheInternet>
i set this in my vimrc
<def-lkb>
is /usr/local/share/ocamlmerlin/vim/ftplugin/ocaml.vim also in scriptnames?
<ToTheInternet>
def-lkb: no
<ToTheInternet>
but i have /usr/share/vim/vim74/syntax/ocaml.vim
mrvn has quit [Ping timeout: 264 seconds]
tidren has quit [Remote host closed the connection]
<ToTheInternet>
def-lkb: the file is at /usr/share/vim/vim74/ftplugin/ocaml.vim on my machine. i tried adding set rtp+=//usr/share/vim/vim74/ftplugin to .vimrc but it's still not loaded
<def-lkb>
that's not the way to proceed, don't add this path
<def-lkb>
make sure you have
<def-lkb>
filetype plugin on
<def-lkb>
filetype indent on # this one is not mandatory
<def-lkb>
in your .vimrc
Hannibal_Smith has quit [Quit: Sto andando via]
<ToTheInternet>
def-lkb: yes! that worked :)
<ToTheInternet>
thanks a lot!
<def-lkb>
fine :), you're welcome
<ToTheInternet>
def-lkb: are you by any chance the author of the plugin?
<def-lkb>
I think so
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
boogie has quit [Remote host closed the connection]
<ToTheInternet>
thanks again, for the great work :) if you think the 'filetype plugin on' line should be in the wiki i can add it. not sure how pressing this is but it might just help some people
zpe has joined #ocaml
<def-lkb>
Yes, do it if it's not complicated, otherwise I'll add it tomorrow
boogie has joined #ocaml
boogie has quit [Remote host closed the connection]
<ToTheInternet>
alright. fair enough. i won't add anything then and you can decide. but note that if the wiki had this little information, it would have saved this channel a _lot_ of noise :)
<poarks>
ToTheInternet: I didn't mean to offend you btw
<poarks>
(I'm tired so I might come out as agressive, sorry)
<def-lkb>
(:D)
<ToTheInternet>
poarks: didn't take it that way. thats why i said "not sure how pressing this is" because i don't know a lot about vim so i can't judge how relevant this information is :)
<poarks>
maybe we can make things more explicit, I'm sure def-lkb will do it wonderfully
<poarks>
anyway, good night
<ToTheInternet>
good night and thanks again
<def-lkb>
slightly changed the phrase
claudiuc_ has quit [Ping timeout: 240 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
mrvn has joined #ocaml
claudiuc has joined #ocaml
claudiuc has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 252 seconds]
Scriptonaut has joined #ocaml
<Scriptonaut>
do you guys know where I could get some help using ml-lex
madroach has joined #ocaml
iorivur has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
<tautologico>
ocamllex ?
NoNNaN has joined #ocaml
hellome has joined #ocaml
<Scriptonaut>
no
<Scriptonaut>
well actually, most lex is the same right?
<Scriptonaut>
I just need somebody to explain how lex works
<Scriptonaut>
I'm having trouble understanding the states
<Scriptonaut>
and how lex scans the source file
<Scriptonaut>
I want to make sure it doesn't make matches for string literals
<whitequark>
do I take it correctly, that OCaml strings always have '\0' at index one past the end of string?