Search the web
Sign In
New User? Sign Up
ocaml_beginners · Ocaml Beginners
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
Messages 2866 - 2895 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
2866
Hi ... Yes, I agree that there are some type related problems in that. At least, there obviously should be some special pattern type that could handle every...
code17
code_1977
Offline Send Email
Jan 1, 2005
5:35 pm
2867
Hi Thanks for your very clear answer. I think you are right. To conclude a bit: 1) The reason why we can't manage to do this is that pattern is not first class...
code17
code_1977
Offline Send Email
Jan 1, 2005
6:20 pm
2868
Hi, thanks ... Although not a universal solution, this is quite an interesting hack working for some purposes. It does help in a way that the user writes and...
code17
code_1977
Offline Send Email
Jan 1, 2005
6:55 pm
2869
Hi, thanks I'm not sure I've caught your meaning totally (I'm oriental :) ), but thanks for the long post. I will try to answer as I can. ... Yes, partly...
code17
code_1977
Offline Send Email
Jan 1, 2005
7:49 pm
2870
pattern matching can be implemented using recursive descent parsing, which is described in cousineau and mauny (using ocaml!). the idea is that you want to...
andrew cooke
andrew@...
Send Email
Jan 1, 2005
8:18 pm
2871
I'm a little unsure whats the best way to try and find 2 elements in a list that are next to each other. For example if I had a list [1;2;3;4;5] and I wanted...
rob_lyles
Offline Send Email
Jan 7, 2005
11:43 am
2872
... I'm fairly certain that the standard library doesn't contain any functions for considering adjacent elements. But it's easy enough to write your own! The...
Richard Jones
rwmjones
Offline Send Email
Jan 7, 2005
12:41 pm
2873
... When the function is corrected, this gives: val test_pairs : ('a -> 'a -> bool) -> 'a list -> bool = <fun> Rich. --...
Richard Jones
rwmjones
Offline Send Email
Jan 7, 2005
12:47 pm
2874
... I don't know if this is the "best way", but I guess it's not very bad either ocaml # let rec find_next l a b = match l with ... ;; val find_next : 'a list...
Cláudio Valente
claudiovalente
Offline Send Email
Jan 7, 2005
12:51 pm
2875
Thank you both for the help Robin ... bad either ... make...
rob_lyles
Offline Send Email
Jan 7, 2005
1:14 pm
2876
... It's correct but weird, why use List.tl when you are doing a pattern matching ? a better version would be: # let rec find_next l a b = match l with ... It...
Remi Vanicat
dl_ens
Offline Send Email
Jan 7, 2005
1:54 pm
2877
... you are right that was the one I ended up with after cleaning my previous version, so I agree with you. Would you care to try to solve my other problem. ...
Cláudio Valente
claudiovalente
Offline Send Email
Jan 7, 2005
4:02 pm
2878
how about: let sublist a b = let rec shared a b = match (a, b) with (_, []) -> true ... let rec step a = match a with [] -> false ... and sublist'...
andrew cooke
andrew@...
Send Email
Jan 7, 2005
5:44 pm
2879
... This is probaby the easier way to do this, but it is not the more efficient one. In fact it is an intersting problem, and probably the same as the search...
Remi Vanicat
dl_ens
Offline Send Email
Jan 7, 2005
5:48 pm
2880
Hi, If what you mean is advanced string matching algorithm like KMP in OCaml, I don't have idea either. As the simple algorithm, I think my solution is just...
code17
code_1977
Offline Send Email
Jan 7, 2005
5:57 pm
2881
[repost- original never showed up] ... When the function is corrected, this gives: val test_pairs : ('a -> 'a -> bool) -> 'a list -> bool = <fun> Rich....
Richard Jones
rwmjones
Offline Send Email
Jan 7, 2005
6:56 pm
2882
... don't they assume constant time access to characters (arrays)? this question is about linked lists. andrew -- ` __ _ __ ___ ___| |_____ work web site:...
andrew cooke
andrew@...
Send Email
Jan 7, 2005
7:04 pm
2883
... At first sight KMP doesn't seem to be easily adapted to linked lists, as you said. But I'm pretty sure it can be done for Rabin-Karp. I'll have to try...
Radu Grigore
radugrigore
Offline Send Email
Jan 7, 2005
7:25 pm
2884
On Fri, 7 Jan 2005 16:04:22 -0300 (CLST), andrew cooke ... Well, I haven't reread the KMP algorithm recently, but I remember that the idea is more or less to...
Remi Vanicat
dl_ens
Offline Send Email
Jan 7, 2005
8:11 pm
2885
ok, maybe i'm confusing my substring algorithms. i thought the important part of the "standard fast solution" (maybe i'm even wrong in thinking there is such...
andrew cooke
andrew@...
Send Email
Jan 7, 2005
8:53 pm
2886
On Fri, 7 Jan 2005 17:53:09 -0300 (CLST), andrew cooke ... KMP jump ahead in string we are looking for, not in the string we are looking into. And one can see...
Remi Vanicat
dl_ens
Offline Send Email
Jan 8, 2005
10:07 am
2887
Or you could copy the sublist into an array first, then you can use integer offsets on the sublist. Seems easier than storing references to sublists......
Aaron W. West
awilliamwest
Offline Send Email
Jan 8, 2005
2:00 pm
2888
... Sure. By the way I've tried to do what I meant, and the result can be find at teh follwoing url: http://aspellfr.free.fr/ocaml_things/. I've done two...
Remi Vanicat
dl_ens
Offline Send Email
Jan 8, 2005
4:26 pm
2889
... List walking and pattern matching will do it. You can match on multiple elements of the list simultaneously. Code like this should work: let rec...
Brian Hurt
bhurt42
Offline Send Email
Jan 8, 2005
4:57 pm
2890
... No surprises. Here is the code (not cleaned up, sorry): ===== exception No_match;; let rec pow_mod a b q = if b = 1 then a mod q else if b > 1 then (a *...
Radu Grigore
radugrigore
Offline Send Email
Jan 9, 2005
10:16 am
2891
thanks for the clarification - i obviously need to go back and look at this again. i'll have a look, but it will be in a few weeks i'm afraid, as i'm now away...
andrew cooke
andrew@...
Send Email
Jan 9, 2005
9:13 pm
2892
Hi, Has anyone come across the error "contains type variables which cannot be generalized"? If I try to compile the attached file (foo.ml, it 120 lines, too...
Ethan Aubin
ethan_aubin
Offline Send Email
Jan 10, 2005
4:16 am
2893
... Yes, that happens sometimes. This is because the compiler needs to know the type of something but it doesn't know it at the point it needs it. For instance...
Martin Jambon
BioMim
Offline Send Email
Jan 10, 2005
6:14 am
2894
How can i avoid the name conflicts of modules in different lib? For example, in lib canlendar there is a module called Printer. But i have another Printer...
tuzi737
Offline Send Email
Jan 12, 2005
4:55 am
2895
... Unfortunately the answer is "with difficulty". If you have source to the libraries, you could change the name of one or other of the modules. It may also...
Richard Jones
rwmjones
Offline Send Email
Jan 12, 2005
1:10 pm
Messages 2866 - 2895 of 9747   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2007 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help