flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
mort___ has quit [Quit: Leaving.]
alang has joined #ocaml
structuralist has quit []
weie_ has joined #ocaml
weie has quit [Ping timeout: 246 seconds]
ben_zen has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
Xom has joined #ocaml
weie has joined #ocaml
weie_ has quit [Ping timeout: 240 seconds]
Neros has quit [Ping timeout: 256 seconds]
travisbrady has joined #ocaml
travisbrady has quit [Ping timeout: 245 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
weie has quit [Read error: Connection reset by peer]
weie has joined #ocaml
skchrko has joined #ocaml
mort___ has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
q66 has quit [Quit: Leaving]
weie has quit [Quit: Leaving...]
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 248 seconds]
osa1_ has joined #ocaml
osa1_ has quit [Client Quit]
osa1 has quit [Ping timeout: 245 seconds]
shinnya has quit [Ping timeout: 268 seconds]
Drup has quit [Quit: Leaving.]
ygrek has joined #ocaml
justdit has joined #ocaml
justdit has quit [Read error: Connection reset by peer]
<xenocons> List.map f . List.map g = List.map (f . g) ? (* where . is composition *) in ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
mort___ has quit [Remote host closed the connection]
weie has joined #ocaml
darkf has joined #ocaml
Snark has joined #ocaml
introom has joined #ocaml
ggole has joined #ocaml
dnm has quit [Ping timeout: 268 seconds]
gnuvince has quit [Remote host closed the connection]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
<ygrek> not really if f or g has side-effects
weie_ has joined #ocaml
weie has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
mcclurmc has quit [Quit: Leaving.]
demonimin has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
zRecursive has left #ocaml []
arquebus has joined #ocaml
introom has quit [Remote host closed the connection]
arquebus has quit [Quit: Konversation terminated!]
zpe has joined #ocaml
ollehar has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
Simn has joined #ocaml
zpe has joined #ocaml
ben_zen has quit [Ping timeout: 268 seconds]
structuralist has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
mfp has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
gautamc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
Kakadu has joined #ocaml
gautamc has joined #ocaml
zpe has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 264 seconds]
caligula has quit [Ping timeout: 264 seconds]
caligula has joined #ocaml
zpe has joined #ocaml
x-s4nd3r has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc1 has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
x-s4nd3r has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
Agd_Scorp has joined #ocaml
<whitequark> does anyone know a library which can compute levenshtein distance between a string and a regexp?
<whitequark> I imagine that can be a nontrivial problem; I only need a very approximate solution
q66 has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
<kerneis> you mean the shortest distance between the string and the set of strings matched by the regexp?
<gasche> if you're doing that for error reporting purposes, that's overkill :-'
<whitequark> gasche: I sort of do
<whitequark> kerneis: yes
<gasche> how come you have a regexp isntead of a set of strings available in your environment?
<gasche> I implemented levensthein-based typo detection in the OCaml type-checker, and I just called levenstein on each identifier in the environment (works well enough for not needing anything more clever so far)
<whitequark> it's for an utility called filecheck which I stole from LLVM... it's best demonstrated by an example
<whitequark> the CHECK-DAG one
<whitequark> so I have a huge file as input and a regexp as a matcher, and nothing else really, since filecheck doesn't parse the file.
<whitequark> in fact I think I can solve this much much simpler
<gasche> so you want to suggest a fix to your hughe file
<gasche> that can be accepted by the regexp?
<whitequark> gasche: yes
<whitequark> the simpler solution would be to use Str.string_partial_match
<whitequark> that should be "good enough"
<gasche> looks like TRE support fuzzy-regexp-matching upto a maximum distance
<whitequark> it's a nice library, but as you've said, a little overkill here :)
librarian has joined #ocaml
testcocoon has quit [Ping timeout: 264 seconds]
osho0000 has joined #ocaml
<osho0000> hello, can i find help here for exam problems?
<osho0000> how can I check if in a bin tree the value of a parent is bigger that the values of childer?
<kerneis> osho0000: what kind of binary tree? any one, or a specific (balanced? binary search?) tree?
mcclurmc1 is now known as mcclurmc
<kerneis> oh, and do you mean of that the parent is larger than one child, both children, every descendant?
<kerneis> it would help if you gave a small code example with your datatype
<osho0000> both children..
<osho0000> type tree = Nill | Node of tree * int * tree;;
testcocoon has joined #ocaml
<osho0000> normal tree :)
<kerneis> well, you can use pattern matching:
<osho0000> i can show what i try..
<kerneis> sure
<kerneis> (the type of tree is important because you might have values at you leaves, for instance)
<kerneis> something like this should get you started: "match t with Node(Node(_, child1, _), parent, Node(_, child2, _) -> if ... then ... else ... | _ -> ..."
<osho0000> i used a pattern matching tree -> bool, but i dont know how to compare a node od the tree with it subtree..
<kerneis> you can nest patterns in pattern-matching
<kerneis> then in the if ..., use the variables child1, child2 and parent
<kerneis> (poorly named, obviously, sorry)
<osho0000> hm.. i try this but from here don't know how to go on
<osho0000> let rec check tree = match tree with Nill -> true |Node(Nill,n,Nill) -> true |Node(c1,n,c2) -> check l && check d |Node(l,v,d) -> false;;
_andre has joined #ocaml
<kerneis> well, you first two patterns look good
<kerneis> the last two are redundant (so the last one will never match)
<osho0000> the but in the third i really don't know..
<kerneis> you need to replace your third pattern by the one I gave you
<kerneis> that is to say, you need to pattern-match on "a node the children of which are also nodes"
<kerneis> not "a node the children of which could be anything"
<osho0000> ok I will try now
<osho0000> thanks
<osho0000> :)
<kerneis> (and then, ocaml will warn you that your pattern matching is not exhaustive, and give you an example, but you can fix it later)
<kerneis> (so focus on that case right now)
<osho0000> ok :)
Neros has joined #ocaml
introom has joined #ocaml
ccasin has quit [Ping timeout: 245 seconds]
<osho0000> kerneis ok i repair the code, but it returns me a Syntax error, dont konw where..
<osho0000> let rec check tree = match tree with Nill -> true |Node(Nill,n,Nill) -> true |Node(Node(_,c1,_),p,Node(_,c2,_)) -> if (p>c1 && p>c2) then (check Node(_,c1,_) && check Node(_,c2,_)) |Node(l,v,d) -> false;;
<Kakadu> osho0000: probably you need to add then ....
<Kakadu> to your If statement
<rixed> Kakadu: you mean "else" not "then" ?
<Kakadu> rixed: okay, you got me
<rixed> that wouldn't be a syntax error but a type error
<Kakadu> rixed: I agree but it's hard to me to read code written in a single line...
<Kakadu> Btw,
<Kakadu> I have created demo app of my slow parsers
<Kakadu> output is there: http://paste.in.ua/8591/raw/
<Kakadu> gasche, maybe you can say something useful
<Kakadu> gasche, also I thought about lablqt and I think that hacking Qt is more interesting than parsers.
introom has quit [Remote host closed the connection]
<osho0000> if anybody knows.. http://paste.in.ua/8593/
<rixed> osho0000: The error looks straightforward
<rixed> osho0000: it's not a syntax error, it's that you are using Nill without defining it (or prior to define it)
<osho0000> heh ups ok :)
<rixed> you migh also want to add parenth arround Node(...) when using it as parameter to check in the last line
<osho0000> ok i correct :) now it give me this error : Error: The constructor Node expects 3 argument(s), but is applied here to 0 argument(s)
introom has joined #ocaml
<rixed> osho0000: I don't get this. You probably introduced an error while copying it?
<rixed> osho0000: what are you trying to check anyway? That your tree is a heap with max values on top?
<rixed> osho0000: If that's the case you probably want to add a default match case which return false at the end (| _ -> false)
walter has joined #ocaml
<osho0000> the exercise want that i check in the parents are always bigger than children
<rixed> osho0000: what I said ; so you need to add the default case returning false
<osho0000> ok will try now thanks :)
<osho0000> not work.. http://paste.in.ua/8594/
structuralist has quit []
<kerneis> osho0000: write check (Node(...)) instead of check Node(...)
<kerneis> the later is parsed as (check) (Node) (...)
<kerneis> hence the "Node is applied to zero arguments" error
<kerneis> then, your function is accepted
<kerneis> btw, you can also use "as" in your pattern-matching:
<kerneis> |Node((Node(_,c1,_) as left),p,(Node(_,c2,_) as right)) when (p>c1 && p>c2) -> check left && check right
<osho0000> yes 0 errors :)
<osho0000> thanks
<kerneis> that way, you can introduce a variable and name only the parts you need
<osho0000> why if I write _ instead of a b c and d in my code it give me a error?
<osho0000> interestig!
<kerneis> on the left or on the right of the ->?
<osho0000> both
<kerneis> on the left, it shouldn't
<kerneis> (but then the variable will not be defined on the right)
yezariaely has joined #ocaml
<kerneis> on the right, _ does not make sense; _ means "bind this part to a variable, but in fact I don't care about this variable, so you can forget its name right now"
<yezariaely> someone here using/developing ocamlmerlin? I like the tool but it sometimes gives me a two abstract type :/
<yezariaely> I don't really understand why.
<kerneis> gasche is the one who wrote the announce
<yezariaely> e.g. let sigma = ref @@ Sigma.of_enum @@ BatList.enum [("a","q_a");("b","q_b")] in, then TypeOf for sigma return 'a
<asmanur_> it often means your code is not valid for merlin
<yezariaely> asmanur_: what are the specs for "valid"
<asmanur_> almost "valid for ocaml"
<yezariaely> well, it compiles correctly.
<yezariaely> and in the .annot file, the correct type is given.
<asmanur_> yezariaely: does merlin know about Sigma ?
<asmanur_> and BatList
<yezariaely> I don't know. How can I ask it? or tell it?
<gasche> Kakadu: my remark on Qt was not meant to downplay your work on Qt
<asmanur_> yezariaely: to use merlin properly, you should write a .merlin for your projects, telling what libraries you are using
<asmanur_> eg. for your case your .merlin would be something like
<asmanur_> PKG batteries
<asmanur_> PKG <findlib package containing sigma>
<gasche> (in fact I happen to have worked on my own ocaml-qt binding in the past, that was never released because it never got good enough to be useful, and I know it's very hard)
<yezariaely> ah I see. Is there any doc about that? I didn't find any?! (and :help merlin.txt, doesn't work, though :helpgrep merlin.txt works)
<asmanur_> there is the readme
<def-lkb> (:help merlin.txt does work ??)
<gasche> Kakadu: it's just that I personally don't like GUI programming, and am bad at binding issues, so I meant that I won't personally get very much involved in your Qt work
<def-lkb> (make sure you rebuilt tags, :Helptags)
<yezariaely> def-lkb: now it works, I had to rebuild helptags.
<yezariaely> yeah sorry ;) forgot to do that.
<gasche> while a combinators + parsing + ocaml performance discussion is in my comfort zone
<yezariaely> asmanur_: I read the readme, though it is not really helpful.
<asmanur_> yezariaely: https://github.com/def-lkb/merlin#merlin-project you want this section
<yezariaely> It does not even tell about <leader>t or such things
<gasche> yezariaely: merlin devs suck at writing documentation, feel free to send them a pull request for some of it, or at least point out what's missing on their issue tracker
<yezariaely> hehe ;-) Problem is that I do not understand how it works, so I can't write docs ;-)
<gasche> (this morning's obvious missing content was "an announce for the last release", so I did my share0
<gasche> yezariaely: that's the best time to write a doc
<gasche> list the question you have as a beginner
<gasche> send it in this form, or write down the answers where you can
<gasche> and voilà, you've got something better than what already exists
<kerneis> you can even start jotting something down here: https://github.com/def-lkb/merlin/wiki if you don't know where to put it
<kerneis> (although in plain text file might do the job just as well)
<yezariaely> gasche: I'll try.
<def-lkb> yezariaely: thx :)
<osho0000> kerneis i had to add two more patterns and now it wok :) http://paste.in.ua/8595/
<osho0000> thanks :)
<kerneis> osho0000: you're welcome
<osho0000> i have 20 more exercises to do till monday :D
<kerneis> note a last trick: you could merge your last two patterns into a single one
<kerneis> because they take the same variables and do the same thing
<kerneis> just not in the same place
<yezariaely> def-lkb: should $SHARE_DIR be defined in my environment by opam?
<kerneis> s/last two/next-to-last two/
introom has quit [Remote host closed the connection]
<kerneis> |Node((Node(_,c,_) as child),p,Nill) | |Node((Nill),p,(Node(_,c,_) as child)) when p > c -> check child
<kerneis> but it's really the icing on the cake
<kerneis> and you see now what I meant by "caml will warn you about a non-exhaustive pattern-matching"
<osho0000> waw elegant
<osho0000> brb launch :)
<kerneis> it works only when you have *exactly* the same variables in each case
<kerneis> see you
<def-lkb> yezariaely: with opam, share dir is probably ~/.opam/4.00.1/share but it is not exported in the environment
<yezariaely> def-lkb: I found it, was just confused that it was defined here and wondered if it should be.
<yezariaely> *not* defined here
<def-lkb> yes… it would be really nice if you took time to take note of all those confusing things :)… we should fix that, but it is really time consuming
ccasin has joined #ocaml
<kerneis> grr, the latest ocamlgraph with its broken Fixpoint API is available in opam
<kerneis> btw, anyone willing to upgrade the opam package?
<yezariaely> def-lkb: In what direction is the type shown approximated if it says (approx)?
<yezariaely> is it a subtype? supertype? or unspecified?
<def-lkb> if there is syntax or type errors
mcclurmc has quit [Remote host closed the connection]
<def-lkb> (merlin tries to recover, but it's just an heuristic, and a weak one at the time)
<yezariaely> def-lkb: so what does the heuristics do?
<def-lkb> yezariaely: so, it's neither a sub or supertype, its the type of the well-typed expression closest to the cursor
<gasche> Kakadu: I found the issue with your test
<Kakadu> gasche: I thought you are not here
<def-lkb> yezariaely: arguably quite weak, but it's just a quick'n'dirty fix, until we have a better way to recover from errors
* Kakadu is listening
weie has joined #ocaml
<gasche> the problem is that when the pretty-printer runs for the combinators
<yezariaely> def-lkb: e.g.: the type of 1 + 2.5 would be approximated to int because 1 + <some int> is approximated?
<def-lkb> yezariaely: yes
<gasche> lots of memory is in use, because the combinator parsed allocated a lot
<gasche> so the GC is slow
<gasche> (tracing passes have a lot of work)
<yezariaely> Thx
<gasche> hm
<gasche> in fact it's not the tracing
<gasche> it's the fragmentation that kills you
<gasche> so I added
<gasche> Gc.compact ()
<gasche> before "match ans with" in the right place
<gasche> and the time of pretty-printing is now back to 10s as with LR parsing
<Kakadu> I have tried Gc.compact only before executing parser combintaors
<Kakadu> Also, what do you mean by 'right place'?
<gasche> well before the right "match ans with" :]
librarian has left #ocaml []
weie_ has quit [Ping timeout: 240 seconds]
<gasche> after the parser combinators have run
mcclurmc has joined #ocaml
introom has joined #ocaml
<gasche> I know it is compaction, because using Gc.full_major () instead doesn't work
<gasche> note Kakadu that I think that is an artefact of the way you measure performances, by testing on a hughe input file
<gasche> if you did lots of iterations on a file of the same sizes you will use in practice, you probably wouldn't observesuch a difference
<Kakadu> gasche: Have you added it do TestHack.ml?
<osho0000> can someone tell me how to resolve this exercise please http://paste.in.ua/8598/
<gasche> Kakadu: TestWithAst only
<gasche> line 69
<gasche> hm
<gasche> and I removed your sync code because I freaked out when your program asked for my root password :p
<Kakadu> it was clearing-disk-cache-code
<gasche> of course
<gasche> but it's annoying and, I think, useless
walter has quit [Read error: Connection reset by peer]
<gasche> what is TestHack doing Kakadu?
<gasche> (what's the different between both TestFoo?)
walter has joined #ocaml
<Kakadu> Hack builds pretty printer immediately, without Ast
<gasche> ah
Agd_Scorp has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
<Kakadu> Nad my main question was why Hack is so slow
<Kakadu> And*
<gasche> so you've got your answer: you need a compaction step before the pretty-printing starts
<gasche> I think there is an alternate GC policy that changes the way the GC reacts when under compaction
<gasche> but I don't remember the details
<Kakadu> So
<Kakadu> my combintaors have eaten a lot of memory and when pretty-printer are building runtime allocates a lot because memory is not compacted?
<gasche> it's a fragmentation issue
<gasche> not really an "amount of memory use" issue
<gasche> the major heaps fragments over time, and then it gets harder and harder to find large enough blocks
<gasche> so the GC spents lots of time looking for large blocks in the free list
<gasche> (because there are lots of small block allocated all over the place)
<gasche> I don't remember when compaction is trigerred automatically by the GC, but in your case it didn't happen while your workflow needed it
<gasche> hm
<gasche> I just tried the alternative allocation policy
<gasche> OCAMLRUNPARAM="a=1"
<gasche> (man ocamlrun)
<gasche> it cuts down the second pretty-printing time from 60 seconds to 33s
<gasche> not bad, but not as good as an explicit Gc.compact
<gasche> again, as I said, the fragmentation issue is likely to be caused by an unrealistic use-case in the first place
<Kakadu> I think, I have understood you
<Kakadu> thanks
Agd_Scorp has joined #ocaml
ygrek has joined #ocaml
<osho0000> can someone give me some indication how to resolve this exercise please http://paste.in.ua/8598/
<Kakadu> you should write function which compares two arrrays
<Kakadu> let 2nd array is shorter than 1st
<Kakadu> let your substring starts from symbol 0
<Kakadu> let a= 1st array and b = 2nd array
<osho0000> how i can compare with a for loop?
<Kakadu> you should check that a.(0) = b.(0), a.(1*jump) = b.(1), a.(2*jump) = b.(2), etc
<Kakadu> I think better to use fold, not loop
<Kakadu> You can start from writing function int -> char array -> char array -> bool
<Kakadu> f j a b
<Kakadu> which checks that b is subarray of a with jump = j
<osho0000> hm ok
<osho0000> but how to use this fold? i never hear of it
<Kakadu> Do you know fold for lists?
<osho0000> fold_left i used
<osho0000> is a higher order function
<Kakadu> yeah
<Kakadu> Array have fold_left too
<Kakadu> oops
<Kakadu> probably fold is not best option, but it is possible
<Kakadu> maybe for loop is better
<Kakadu> yeah, loops are beter
<osho0000> it applies a function on tle members of the list
<osho0000> aha ok
<osho0000> :)
<osho0000> i will try now, thanks
weie_ has joined #ocaml
weie has quit [Ping timeout: 276 seconds]
smondet has joined #ocaml
Simn has quit [Quit: Leaving]
Kakadu has quit [Quit: Konversation terminated!]
tane has joined #ocaml
<osho0000> for 4 exercises i need all day, on monday i will have only 90 min :D
ben_zen has joined #ocaml
Drup has joined #ocaml
<kerneis> github unavailable, just when I want to install merlin
<kerneis> gasche, I see what you did here
<chris2> is it possible to print values in merlin?
<Drup> values ? like executing some piece of code ?
<chris2> yes
<Drup> then no.
<chris2> that would be nice
<rks`> kerneis: merlin is in opam
<rks`> why do you need github?
<chris2> also, where is ac-complete-merlin defined?
<asmanur_> chris2: at ac-define-source ... in merlin.el
<chris2> i see
<chris2> i didnt load that thing yet
<gasche> hm
<gasche> I should have mentioned "opam install merlin" in the announce
* chris2 wonders why the face doesnt appear
<gasche> could any of the actual devs post that additional remark?
<rks`> gasche: it's not to late
<rks`> yes sure, I'll do it
<asmanur_> what face chris2 ?
<chris2> the merlin-locked-face
<chris2> should be blue?
<asmanur_> y
<asmanur_> it is disabled by default since 1.1 iirc
<chris2> oh
<asmanur_> if you want to have it though you have to do smtg like (setq merlin-display-lock-zone '(highlight))
<kerneis> rks`: opam installs from github
<kerneis> (at least for merlin)
<chris2> asmanur_: thanks
<kerneis> they use the github release mechanism
<rks`> kerneis: oh yeah, that's true :D
<rks`> I should know, I wrote the package...
<asmanur_> kerneis: i thought opam had a cache ?
<kerneis> is it because I use my own clone of opam-repository then?
<kerneis> I don't know
<kerneis> it's back anyway
yezariaely has quit [Quit: Leaving.]
ben_zen has quit [Ping timeout: 256 seconds]
osa1 has joined #ocaml
tane has quit [Quit: Verlassend]
<osho0000> can someone tell me where i m wrong in this function http://paste.in.ua/8602/
<ousado> osho0000: what's the error?
<ggole> (+) and (-) the wrong way around
<ggole> The when clauses are also a bit silly, you'd usually just use the literals directly
<osho0000> ousado it give me -6 not 18
Agd_Scorp has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
<osho0000> instead of 10 +12 -4 does 10 -12 -4
<ousado> osho0000: ggole answered all your questions, and more :)
travisbrady has joined #ocaml
<osho0000> ok i will try now :)
<kerneis> :let s:ocamlmerlin=substitute(system('opam config var share'),'\n$','','') . "/ocamlmerlin"
<kerneis> execute "set rtp+=".s:ocamlmerlin."/vim"
<kerneis> execute ":set rtp+=".s:ocamlmerlin."/vimbufsync"
<kerneis> 30 minutes of infuriating reading of vimscript doc later…
<def-lkb> "opam config var share", didn't know about this one, thanks :)
<rks`> that's nice kerneis
<kerneis> bug reported
<rks`> kerneis: I don't think $SHARE_DIR was to be taken literally.
<kerneis> well, it confused some users above
<rks`> right
<rks`> We'll update the readme
<kerneis> and is extremely annoying to hardcode when you switch compilers
<rks`> yeah...
<rks`> (I actually never thought about it, as I never installed it through opam)
<rks`> We'll update the readme
zachrab has joined #ocaml
<kerneis> no problem
zachrab has quit [Read error: Connection reset by peer]
zachrab has joined #ocaml
<gasche> (it's not Gabriel "fasta" Kerneis)
<kerneis> :-p
<rks`> ? :D
<kerneis> never been there, sorry http://fr.wikipedia.org/wiki/Fasta_%C3%85land
<kerneis> okay, but it still doesn't work
<rks`> kerneis: what doesn't ?
<kerneis> hmm, nothing, even :help merlin.txt
redfire has joined #ocaml
<kerneis> i'm looking for bugs in my vimrc
<rks`> kerneis: I don't think :help merlin.txt will work if you just used "set rtp+="
<kerneis> arg
<rks`> you might want to look at how pathogen regenerate the doc for vim
<rks`> sorry :/
zachrab has quit [Read error: Connection reset by peer]
<rks`> If there's an easy way, we'll include it in the readme as well
zachrab has joined #ocaml
contempt has quit [Ping timeout: 246 seconds]
<rks`> so I guess what you want is something looking like "execute 'helptags' <path/to/doc/dir>" ?
<kerneis> maybe I should install pathogen
<kerneis> now my vim looks like emacs
contempt has joined #ocaml
<osho0000> i repired but there are some problems with the resultat http://paste.in.ua/8603/
<def-lkb> kerneis: I would like emacs to have something like omni-completion
<kerneis> I thought the power of emacs-lisp gave you that kind of stuff easily
<rks`> you wish.
<kerneis> and C-X C-O is not too annoying on bépo (although not ideal)
<def-lkb> kerneis: I remaped it to c-space on bépo :p
<avsm> Switch to first-fit allocation.
<kerneis> nice
<rks`> kerneis: I also use bepo, but use Supertab :)
n06rin has joined #ocaml
<n06rin> hi all
<kerneis> I avoid plugins as much as possible
<kerneis> merlin is really an exception
<rks`> your choice :)
<kerneis> but it looks so convenient I’ll probably stick with it
<rks`> but then yes, just rebind omnicompletion to whatever you like :)
<n06rin> at the beginnig of real world OCaml book exist a string
<n06rin> "# open Core.Std;;" and when a put in interpreter i see a syntax error. What I do wrong?
<rks`> you don't want to put the "# "
<def-lkb> the # is not part of the code :)
<thizanne> do you put the # too ?
<ggole> Or the "!
<n06rin> obliviusly no
<rks`> :D
<n06rin> n06rin@netbook:~$ ocaml
<n06rin> Objective Caml version 3.12.1
<n06rin> # open Core.std;;
<n06rin> Error: Syntax error
<rks`> .Std
<ggole> Core.Std Core.std See the difference?
<rks`> not std
* companion_cube suggests using rlwrap to make the ocaml toplevel more bearable, as a side note
<ggole> (Man, that's a bad error message.)
<rks`> companion_cube: bad suggestion
<rks`> he should be using utop.
<companion_cube> or using utop
<companion_cube> right
<rks`> ggole: yeah :/
<n06rin> oh, I see. Thanks guys. Maybe I need some sleep
<ggole> Hardly a difficult error to make.
zachrab has quit [Remote host closed the connection]
<kerneis> def-lkb: cannot remap it to c-space, this trick doesn't seem to work: http://stackoverflow.com/questions/7722177/how-do-i-map-ctrl-x-ctrl-o-to-ctrl-space-in-terminal-vim
<kerneis> any hint?
Simn has joined #ocaml
<kerneis> I wont try to undestand that piece of code…
<rks`> :D
dnm has joined #ocaml
<kerneis> in fact, it's almost readable when syntax highlighted
<def-lkb> kerneis: it depends on your terminal…
<def-lkb> you can try :inoremap <Nul> <C-x><C-o>
<def-lkb> it works on my current desktop, not on the previous one… I can't tell why :)
jbrown has quit [Remote host closed the connection]
<osho0000> i simplified more the code but the result isnt still correct.. http://paste.in.ua/8604/
Agd_Scorp has joined #ocaml
<thizanne> osho0000: 1 - 2 - 3 does 1 - (2 - 3)
<thizanne> you want a - to be computed only with the next number, not the whole following expression
<osho0000> ohh thanks
<osho0000> let see :)
travisbrady has quit [Quit: travisbrady]
walter has quit [Quit: This computer has gone to sleep]
<osho0000> thizanne have some idea maybe?
<thizanne> I'm not sure giving you the solution is the best way to help
<thizanne> maybe if you have a more precise question I can answer
shinnya has joined #ocaml
<osho0000> hm.. don't know how to write the next number not all the expression
<thizanne> you already wrote the following things :
<thizanne> Nil, a Number n followed by Nil, a Number n follow by an operator followed by an expression
<thizanne> then you want to wrote a Number n followed by an operator follow by another number n [and then stuff]
<osho0000> you are saying that i must add more patterns..
<thizanne> not necessarily
kaktus has quit [Remote host closed the connection]
<thizanne> your pattern managing the '-' case is obviously wrong, so you have to modify it
<thizanne> (before going further, do you plan to manage * and / ?)
travisbrady has joined #ocaml
ulfdoz has joined #ocaml
travisbrady has quit [Client Quit]
<osho0000> thizanne no, only + and - :)
<osho0000> in the - case maybe i must nest more patterns?
<thizanne> that's a solution
<thizanne> when you encounter a number then a '-', you know that you need to get the number following the - instead of the whole expression
<thizanne> goind one step further in the pattern would give you this number
<osho0000> ok i will try now
<osho0000> thanks
<osho0000> hm i can nest another expression but then the same problem appears in the next expression :)
<thizanne> you don't need to nest another expression
<thizanne> you only need to get the next number
mcclurmc has quit [Quit: Leaving.]
<osho0000> i tried like this : Number(n,Oper('-',Number(g,h))) -> n - g + ovrednoti h
<thizanne> something like | Number (n, Oper ('-', Number (p, expr))) -> ...
<thizanne> ok
<thizanne> then why "+ overdnoti h" ?
<thizanne> maybe h starts with a -
<osho0000> yes that s the problem
<thizanne> and obviously you cannot nest it again
demonimin has quit [Ping timeout: 246 seconds]
<thizanne> so what do you do when you must compute 1 - 2 + 3 ?
<osho0000> i must put a + or a -
ben_zen has joined #ocaml
<thizanne> your pattern is good
demonimin has joined #ocaml
<thizanne> you cannot solve your problem by going one step further again, you would only shift it
introom has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 256 seconds]
introom has joined #ocaml
<osho0000> yes but don t know how.. i add a pattern |Oper(i,j) -> ovrednoti j but but for negative numers don't know.. because the same problem will arise..
<mrvn> osho0000: negative numbers need a unary operator
<mrvn> or 0 - a
nlucaroni has quit [Ping timeout: 245 seconds]
<thizanne> osho0000: when you want to compute 1 - 2 + 3, you can compute 1 - 2, and replace this expression by the result
<thizanne> so eval (1 - 2 + 3) is eval (-1 + 3)
<mrvn> osho0000: You should change your code to type expr = Number of int | UnaryOp of char * expr | DualOp of char * expr * expr
introom has quit [Ping timeout: 264 seconds]
<thizanne> mrvn: actually he only wants to manage + and -
<mrvn> 1 - 2 + 3 --> DualOp('+', DualOp('-', Number 1, Number 2), Number 3)
<osho0000> mrvn I cant.. is a exercise of the exam
<mrvn> The type is given?
<osho0000> jp
<mrvn> And what is the semantic? Is Number(10,Oper('+',Number(12,Oper('-',Number(4,Nil))))) --> 10 + (12 - 4)?
<mrvn> From the type definition I would read that with parens like that.
<mrvn> Number(10,Oper('-',Number(12,Oper('-',Number(4,Nil))))) --> 10 - (12 - 4) --> 10 - 8 --> 2. Your code is correct.
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
<osho0000> no is (10+12)-4
<mrvn> osho0000: That would not be expressable by your type
<osho0000> are you telling me that I can do it?
<mrvn> No, just the type definition is stupid
<osho0000> ah ok :)
<mrvn> Your type definition is right associative (iirc that is the correct phrase) and you want left associative.
<osho0000> yes!
travisbrady has joined #ocaml
<osho0000> in 3 hours i still dont find the solution..
<mrvn> osho0000: you can do this with 2 recursive functions. The first gets an accumulator and expression, the other an accumulator, an operator and expression.
<mrvn> And ovrednoti then takes the expression, extracts the first number and calls the first recursive function with it and the remaining expression
<osho0000> ok.. i me tired now.. i thought that i can do it with modifaing my code but.. :)
<osho0000> thanks :)
Xom has joined #ocaml
<mrvn> or a bit simpler: http://paste.debian.net/25950/
<osho0000> waw great!
<osho0000> i would never find it out :)
<osho0000> thanks :)
<mrvn> osho0000: Alternatively you could first reverse the expression and then use your code
<osho0000> ow yes, i sould turn the list
<osho0000> waw genius :)
<osho0000> mrvn can you give me only a intuition how to resolve that?
<osho0000> with a for loop?
<mrvn> that is one way.
travisbrady has quit [Quit: travisbrady]
<mrvn> I would use recursion, easier to abort
<osho0000> hm
<osho0000> with List.hd, List.tl?
<ggole> Never!
<ggole> (Almost) always pattern matching.
asmanur_ has quit [Ping timeout: 268 seconds]
<osho0000> aha ok
samebchase has quit [Quit: leaving]
<osho0000> ggole btw why not with List.hd..?
<ggole> Makes it easy to have bugs.
<ggole> Pattern matching will give you exhaustiveness checking at compile time, while List.hd will fail at runtime.
<osho0000> ok get it :)
Agd_Scorp has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
<mrvn> might be more readable with for loops and exceptions
<mrvn> or Array.iter
<mrvn> One wonders why the execrise uses char arrays instead of strings
asmanur has joined #ocaml
<mrvn> I think for that exercise I would make an obscure solution. Build a list of all subarrays arrays of all jumps of the right length of the second string and then use List.mem or something.
<osho0000> why max = ly / lx?
<mrvn> osho0000: because step can't be more than ly / lx
<osho0000> o yes
<osho0000> but is difficult this exercise :)
<mrvn> s/step/jump/ I mean
<mrvn> yeah, sounds so easy but is complex.
<osho0000> thanks a lot, i will study you code :)
darkf has quit [Quit: Leaving]
<mrvn> osho0000: try to write your own first
<osho0000> ok
asmanur has quit [Ping timeout: 245 seconds]
Agd_Scorp has joined #ocaml
Agd_Scorp has quit [Changing host]
Agd_Scorp has joined #ocaml
<ggole> http://ocaml.nopaste.dk/p58456 My first attempt
ulfdoz has quit [Ping timeout: 256 seconds]
Agd_Scorp has quit [Quit: i'll be back in a moment, just gotta do some stuff...]
ollehar has quit [Ping timeout: 246 seconds]
<osho0000> uff difficult :)
<ggole> Hmm, buggy
<osho0000> yes but at exam with no pc and 25 min..
<osho0000> thanks
wmeyer has joined #ocaml
<osho0000> with for loops is more difficult?
<wmeyer> hello
<mrvn> osho0000: no. but it needs exceptions
<mrvn> or refs
<osho0000> ok
<osho0000> will try :D
<ggole> http://ocaml.nopaste.dk/p58457 off-by-one bug (and thinko, wrong variable in first call to loop in is_jump_sub)
<ggole> Good chance that it is still broken. :(
<mrvn> ggole: mine is kind of wrong to because "aaa" matches "xax" with jump -1
<mrvn> s/to/too/
<ggole> Hmm
<ggole> That's a valid solution in a sense
<mrvn> but "aaa" doesn't match "a" with jump -1
<wmeyer> ping
<wmeyer> adrien:
n06rin has quit [Quit: Leaving.]
ggole has quit []
asmanur has joined #ocaml
ccasin has quit [Ping timeout: 245 seconds]
nlucaroni has joined #ocaml
ben_zen has joined #ocaml
smondet has quit [Remote host closed the connection]
travisbrady has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
zpe has quit [Remote host closed the connection]
transfinite has joined #ocaml
wmeyer` has joined #ocaml
blinky- has joined #ocaml
wmeyer has quit [Ping timeout: 260 seconds]
Agd_Scorp has joined #ocaml
blinky- has left #ocaml []
testcocoon has quit [Ping timeout: 264 seconds]
testcocoon has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
<travisbrady> Anyone have experience or recommendations regarding netmulticore or shared-memory-ring?
zpe has joined #ocaml
tane has joined #ocaml
<companion_cube> no, sorry
structuralist has joined #ocaml
testcocoon has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 248 seconds]
pkrnj has joined #ocaml
osa1 has quit [Ping timeout: 240 seconds]
testcocoon has joined #ocaml
tani has joined #ocaml
tane has quit [Read error: Operation timed out]
hto has joined #ocaml
_andre has quit [Quit: leaving]
skchrko has quit [Quit: Leaving]
wmeyer`` has joined #ocaml
wmeyer` has quit [Ping timeout: 260 seconds]
Agd_Scorp has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
osho0000 has quit [Ping timeout: 250 seconds]
osa1 has joined #ocaml
wmeyer`` has quit [Remote host closed the connection]
yacks has quit [Read error: Connection reset by peer]
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 264 seconds]
Snark has quit [Quit: leaving]
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
Xom has joined #ocaml
osa1 has quit [Remote host closed the connection]
yacks has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
Myk267 has quit [Quit: Myk267]
yacks has quit [Quit: Leaving]
yacks has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
travisbrady has joined #ocaml
travisbrady has quit [Quit: travisbrady]
redfire has quit [Quit: WeeChat 0.4.1]
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 248 seconds]
Simn has quit [Ping timeout: 268 seconds]
walter has joined #ocaml
weie_ has quit [Read error: Connection reset by peer]
weie has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
weie has quit [Read error: Connection reset by peer]
weie has joined #ocaml
tani has quit [Quit: Verlassend]
walter has quit [Quit: This computer has gone to sleep]