Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
status of some big "important" features?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-30 (21:42)
From: Chris Hecker <checker@d...>
Subject: Re: status of some big "important" features?

>> PS.  Minor question I thought of the other there any way to
>> write "nth" for tuples (as opposed to "fst", which is hard-coded to
>> 2-tuples)?
>Impossible in Camlp4, it is a typing problem.

Oh, I thought camlp4 had the types available to it.  I must have misunderstood the docs.

Hmm.  So similarly, you couldn't write an introspection thing like this in camlp4:

type foo = {bar:float; baz:int };;
let a = {bar = 1.;baz = 1};;
print_members_camlp4 a;;

Where print_members_camlp4 is hooked by camlp4 to iterate over the members of whatever record was passed to it (or error at compile time if it's not a record)?  That's not possible?