thanks a lot for all your explanations. I'm certainly going to use your Lazy suggestion San ... [Non-text portions of this message have been removed]...
13482
Gabriel Scherer
ga_sche
Apr 18, 2012 8:38 am
I think the simplest thing to do here would be to use mutable fields to "tie the knot". The advantage is that the type doesn't change (with the lazy or (unit...
13483
Vu Ngoc San
san.vungoc
Apr 18, 2012 4:06 pm
right, I can do it with mutable fields, thanks for the tip. I thought something nice and abstract like cyclic types should be easy to do in "pure" ocaml, but I...
13484
Lukasz Stafiniak
luk_stafi
Apr 18, 2012 4:29 pm
... This is one of the "few corners" where Haskell has upper hand....
13485
Francois Berenger
f_berenger
Apr 20, 2012 2:51 am
Hello, Is there some Kendall tau implementation out there in OCaml? I'm looking for something with better complexity than N^2, if that's possible, as I have a...
13486
Ray Song
emacsray
Apr 20, 2012 4:58 am
... Sort the pairwise elements between two lists with the first element as the key. Then employ a variation of merge sorting to count disconcordant pairs....
13487
narcoleptic1984
Apr 21, 2012 4:05 pm
Hi! I've just started taking Ocaml classes and I have assignment. A part of it is to make a functtion which will convert string into list of list of...
13488
Siraaj Khandkar
siraajibnfirnas
Apr 21, 2012 4:17 pm
... I would first split it on your target character (space, in this case), and then proceed to explode each of the strings in the resulting list. # Str.split...
13489
Gabriel Scherer
ga_sche
Apr 21, 2012 4:18 pm
I propose the following prototype: let explode_words str = let rec explode curr_word words pos = ... in explode [] [] (String.length str - 1) The idea is that...
13490
Trcol
narcoleptic1984
Apr 21, 2012 4:34 pm
i have to solve it without using Str.split and Str.regexp :/ That is my probelm.. ______ unicorns are people too [Non-text portions of this message have been...
13491
Siraaj Khandkar
siraajibnfirnas
Apr 21, 2012 5:36 pm
... OK, how about like this: # let explode str = let rec exp = function ... in exp ((String.length str)-1, []);; val explode : string -> char list = <fun> #...
13492
Siraaj Khandkar
siraajibnfirnas
Apr 21, 2012 7:51 pm
... Oh, and a finishing touch to get the exact output you wanted :) # List.map (List.rev) (List.rev lsts);; - : char list list = [['p'; 'r'; 'o']; ['b'; 'l';...
13493
Gabriel Scherer
ga_sche
Apr 21, 2012 7:58 pm
The exercise can be done in one pass, without having to use List.rev, as I demonstrated in my proposed code skeleton. Besides, I think Trcol was asking for...
13494
Siraaj Khandkar
siraajibnfirnas
Apr 21, 2012 8:49 pm
... How would you efficiently append without resorting to mutation? ... You're right. I apologize. I'm just a beginner myself, so I got a little keyboard-happy...
13495
Trcol
narcoleptic1984
Apr 21, 2012 8:51 pm
her poblem :) ty anyway, i won't use this exact solution, i think i'm getting it finaly. ______ unicorns are people too [Non-text portions of this message have...
13496
Gabriel Scherer
ga_sche
Apr 22, 2012 6:59 am
... The idea is to run the string from the end to the beginning, just as Trcol did for the first version of `explode`. If you push chars from the end, you get...
13497
Trcol
narcoleptic1984
Apr 22, 2012 3:59 pm
hi again! do you think it's possible to solve this problem with while and pointers? if anyone thinks it is could you tell me how? cause i'm trying but i got...
13498
Trcol
narcoleptic1984
Apr 22, 2012 5:50 pm
ok, do you think if this can be solved with while and pointers? i'm trying, but cannot find enough solved problems with pointers online and i have difficulties...
13499
Francois Berenger
f_berenger
Apr 23, 2012 1:20 am
... Maybe, but it's not fun. The recursive way is much more fun....
13500
Mihamina Rakotomandimby
rakotomandim...
Apr 23, 2012 6:47 am
... Well, first indication: think before write. You'll need to whatever is you level. -- RMA....
13501
Trcol
narcoleptic1984
Apr 23, 2012 7:14 am
I know that recursion are more fun, and I was thinking of using recursion, while and pointers for solving this problem :) But that's all I got, an idea :D So...
13502
Vu Ngoc San
san.vungoc
Apr 23, 2012 7:59 am
... maybe you could use some direct code in asm + a bit of functors (+ some proof in Coq, just to make sure) ;-) [Non-text portions of this message have been...
13503
narcoleptic1984
Apr 23, 2012 2:29 pm
hi! i know 'm boring with searching alternative solutions for this problem, but i've managed to do sth myself and now i'm stuck. when i say stuck, i mean...
13504
Duke Normandin
cgnormandin
Apr 23, 2012 2:54 pm
On Mon, 23 Apr 2012 14:29:24 -0000, "narcoleptic1984" ... I'm a noob too, but maybe you have a typo?? Should that not be downto ?? ^^^^^^ -- Duke...
13505
Trcol
narcoleptic1984
Apr 23, 2012 6:27 pm
yes it should :) ______ unicorns are people too [Non-text portions of this message have been removed]...
13506
Trcol
narcoleptic1984
Apr 23, 2012 6:36 pm
This is the error I'm getting and I have no idea why: "Error: Unbound record field label length " Does anyonw know? let rastavi str = let sublist = ref [] in ...
13507
Trcol
narcoleptic1984
Apr 23, 2012 7:02 pm
I have this now: let rastavi str = let sublist = ref [] in let list = ref [] in for i = ((String.length str)-1) downto 0 do if str.[i] != ' ' then (str.[i]...
13508
sayanta_mallick
Apr 26, 2012 12:47 pm
Dear Caml Expert, Is any good website where I can find video or e-learning tutorial on Ocaml. Thanks in advance Babai...
13509
Esther Baruk
surdinal09
Apr 26, 2012 1:03 pm
Try the following website : http://try.ocamlpro.com It's a good start ! Esther Baruk On Thu, Apr 26, 2012 at 2:47 PM, sayanta_mallick ... [Non-text portions of...
13510
sayanta_mallick
Apr 26, 2012 3:15 pm
Hi, Many Thanks for posting. But I'm still looking for video tutorial. If anyone know please share the link. Cheers Babai...