I am trying to understand how to use the Arg module. In the following code the string parameters work as I expected it, but not the switches: ...
Johann Spies
jspies@...
Feb 3, 2003 1:15 pm
795
... this is not a function. It take no argument. This compute (immediately) if !ver then begin print_string "Version 1.0"; print_newline() end which value is...
... Thanks Remi. It seems that I am a slow learner. I have made this mistake before. Regards. Johann -- Johann Spies Telefoon: 021-808 4036 ...
Johann Spies
jspies@...
Feb 3, 2003 2:53 pm
797
Hello, I want to read a file into a list. ######################################### type read_file = Line of string | ENDE let rec ap chan li = let res = try ...
oliver@...
Feb 4, 2003 8:15 pm
798
... You can try this : let rec input_lines chan = try let l = input_line chan in l::(input_lines chan) with _ -> [] ;; Note that you may run out of stack space...
Michel Quercia
michel.quercia@...
Feb 4, 2003 8:57 pm
799
... Well it is not the only reason. The fact that the result of the recursive call is the tail of the new list is the other one. Remark that the original...
This is rather embarassing but I have found myself unable to produce a function that would give me a list of lists which are all available permutations of...
Le Wed, 05 Feb 2003 13:48:11 -0000 "mtikilia <mt99@...>" ... You can use something like this : (* insert x at all positions into l and return the list...
Michel Quercia
michel.quercia@...
Feb 5, 2003 6:23 pm
802
Just sort with a random compare predicate and you get an unordered list. I asked a professor on algorithms, and he said that the worst that could happen is...
Mattias Waldau
mattias.waldau@...
Feb 5, 2003 8:20 pm
803
Hi guys, I'm new to Ocaml. I was trying to code something just for becoming confident with Ocaml and I was wondering why some function that apply to lists has...
... I guess the reason is that before you can build an array, you have to know its size. That is, you need to have performed the filtering. So, basically the...
Re: permutations of a list: Thanks for everyone's help, it was very useful. I've also managed to battle out a different solution, which I thought was also...
If I am not completelty wrong, your algorithm is O(n^2). It looks like some kind of backwards insertion-sort. If you do not want to use my trick with the...
Mattias Waldau
mattias.waldau@...
Feb 7, 2003 8:10 am
807
Hi all, my problem is this: let r = let a= ("b" , "c") in let f = ref "" in let g = ref "" in f:= fst a; g:= snd a; !f,!g;; val r : string * string = "b", "c" ...
pame_la@...
Feb 8, 2003 6:16 pm
808
Le Sat, 8 Feb 2003 19:16:01 +0100 "pame_la@..." ... let u,v = a in f := u; g := v;; -- Michel Quercia 23 rue de Montchapet, 21000 Dijon ...
Michel Quercia
michel.quercia@...
Feb 8, 2003 6:45 pm
810
Hello list, I have driven myself into a stupor trying to get a simple PXP example to _compile_. I guess it is a schoolboy error but I have so far spent a day...
I have solved the issue by inserting in the makefile a sed 's/\.\.\///g' | sed 's/usr\/share\/pixmaps/\/usr\/share\/pixmaps/g' command that strips all "../"s ...
Hello, I have successfully compiled ocaml with CygWin and MingW. Now it is possible to optimise my ocaml sources with the MingW gcc compiler as linker. The...
Hello all, Sorry for the silly question, but I have just started with OCaml (and after all I haven't found any pre-beginner ocaml list :). Why can't I do this?...
Flavio
FlavioGrossi@...
Feb 12, 2003 5:35 pm
815
... Why not? ;-)) # class aClass = object (self) val x = 1 val mutable y = 1 method showX = x method showY = y method setY = (y <- (x + 1)) initializer self...
... Ok, thanks. So instead of: # class twoButtons ?packing ?show () = object (self) val vbox = GPack.vbox ?show ?packing () val button1 = GButton.button ~show:...
Flavio
FlavioGrossi@...
Feb 13, 2003 10:09 am
817
... If you're working with Gtk, you don't need to write everything at class level. Moreover, in case you want to write everything at class level, you should do...
... I would write it that way : class twoButtons ?packing ?show () = let vbox = GPack.vbox ?show ?packing () in let button1 = GButton.button ~show: true...
... One can believe to be good style for the interface to use the same paradigm than the library used for the interface. Gtk is object so... ... Absolutely...
... Foreword: I know that mlglade builds classes like this. However, I don't consider it as a "clean" practice, because encapsulation of structure and data is...
On Thu, 13 Feb 2003 13:01:53 +0100 Remi VANICAT ... Sure, it was just an example class. In the real program (well, just an excercise for learning) I'm trying...
Flavio
FlavioGrossi@...
Feb 13, 2003 2:12 pm
822
... First, don't forget that if an application have any interested, it have a big probability to evolved. SO a class created in it is not a "use once and...
... My point is a paedagogic one. My first purpose is that Flavio and whoever else (including me) can start: to start, I think that things would rather be made...
... Well, in this case, it seem that Flavio wanted to put every thing in a container class. As it seem good style for me (and not so difficult), I stayed to...