Re: [Caml-list] Interpreting a language with (sparse) arrays explicitly indexed

2011-10-19 Thread Diego Olivier Fernandez Pons
Gabriel, | Val_table of (value, value) Hashtbl.t It took me two days to understand that this actually solved the problem because it fulfils type erasure and induction on dimension, just like functions. Actually, that's the type of a reified curried function value - value - value - ...

Re: [Caml-list] Interpreting a language with (sparse) arrays explicitly indexed

2011-10-18 Thread Gabriel Scherer
What about hash tables ? | Val_table of (value, value) Hashtbl.t If you have caml closures in your values (not in Val_closure but in Val_primitive), it is maybe not appropriate to use the default hash function that would choke on them. You should rather define your own hashing function --but

[Caml-list] Interpreting a language with (sparse) arrays explicitly indexed

2011-10-17 Thread Diego Olivier Fernandez Pons
Caml-list, I have to write an interpreter for a language that has arrays explicitly indexed by anything that can be sequential (list, range, set) {string} airports = {ATL, JFK}; range index = 1 .. 2; tuple recordAirport { airport : string; id : int } {recordAirport}