Hi, When I run ocaml within emacs I am not able to #load properly (my own) object files (*.cmo). For example: # #load "/path/to/myfile.cmo";; # Myfile.myfun;; ...
citromatik
miguel.pignatelli@...
Dec 1, 2008 8:28 am
10449
... You can't do what you want to do. The representation of lists (as singly-linked lists) allows you to write: match xs with x :: _ -> x because that matches...
Hi, I am trying to print the values and types of the fields of a C struct. I use the below code (based on simplify.ml) to get the list of fields of a struct,...
... You might be better off asking on the CIL list. However it's my understanding that the information you want to print isn't available. CIL analyzes the...
Is there a way to leave a field in an object unbound? The following example code fails to compile: object val mutable (x : string) initializer x <- "hello...
... Can't be done. This is a feature: when you have a value of a type, you actually have a value of the type; there's no possibility that your program will...
If I use the second approach, how do I get/set the value of x? I managed to get a Stack Overflow error when I tried: # class test = object val mutable s = (fun...
... All these are good options, maybe we could even add another one. If your attributes have to be initialised through some computations, instead of using the...
Florent Monnier
fmonnier@...
Dec 3, 2008 6:49 am
10457
I'm trying to write an insertion sort, and I've got something working, but it seems horribly inefficient. It works as follows: - Keep a state variable to pass...
... Just to ask the obvious question: why are you writing an insertion sort? It's always going to have worse asymptotic runtime than your favorite O(n log n)...
-[ Wed, Dec 03, 2008 at 10:50:56PM -0500, Mac Mason ]---- ... The fact that an algorithm is demonstrably better on large and random data sets does not tells us...
Hi, I need to share an abstract type between 2 modules. I don't know if the best solution is to nest them, because they perform different tasks (one is for ...
citromatik
miguel.pignatelli@...
Dec 4, 2008 11:08 am
10461
... I see 2 solutions: - use a doubly linked list: http://ocaml-extlib.googlecode.com/svn/doc/apiref/Dllist.html - use an array, and do operation in-place...
... Indeed, my fault -- I was reading it with a non-syntax highlighting editor and skip the comment. Sorry for misinformation. Regards Sylvain Le Gall...
Hi all, Has anyone managed to get Oracaml working? I downloaded it, edited the Makefile with my ORACLE_HOME etc, but I can't compile it: $ make ocamlc -g -c...
gaius hammond
gaius@...
Dec 4, 2008 5:01 pm
10466
... I knew this question would come up. :) It's really just an exercise in trying to "think" in Ocaml, having come from a C++ background....
Given Ocaml's eager evaluation, I am having a bit of trouble understanding why I am able to define infinite circular data structures. ... And the following...
... Circular data structures are not incompatible with eager evaluation. You can obviously make them with refs or mutable record fields. OCaml also gives you a...
... Really your best bet is to use a single module (and file), and use a folding editor[1]. ... I don't know what you mean by "nesting both modules". If the ...
Hi, Thanks for your reply, ... Yes, that's what I thought, but I must be making something wrong. Please, consider this: iof.mli ... type t val get_t : unit ->...
citromatik
miguel.pignatelli@...
Dec 5, 2008 11:45 am
10473
... You hid the implementation of t, so ... ... ... in this case you need to use a private type: ...
... Well, I meant nesting Iof inside F (and making type t available for both): module F : sig type t module Iof : sig val get_t : unit -> t end val get_i :...
citromatik
miguel.pignatelli@...
Dec 5, 2008 12:53 pm
10475
I'm trying to get labltk working on my Redhat EL 4 box, and having trouble with the Tcl dependency. Redhat thinks I have the latest versions of the tcl and...
... It might be possible to use some specialized version of Huet's zippers (see <http://en.wikipedia.org/wiki/Zipper_(data_structure)>). Basically, the sorted...
I was working on a function that referenced a variable without first defining it. It took me a long time to find this error, because at some point during my...