[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OCAML trouble



"unbound record field label" normally means you've forgotten to add a module 
prefix to one of your record fields: try changing "qr=" into "DP.qr=".

Note you only have to prefix one field: with modern ocaml the rest will then be 
inferred.

HTH,

Dave

On Aug 4, 2011, at 4:05 PM, "Eireann Leverett" <eireann.leverett@xxxxxxxxxx> 
wrote:

> Hi gurus,
> 
> I am trying to construct a dnspacket; and I just can't seem to get the
> typing right for this detail record.
> 
> The record structure looks like this inside dnspacket.ml:
> 
> type detail = {
>  qr: qr;
>  opcode: opcode;
>  aa: bool;
>  tc: bool;
>  rd: bool;
>  ra: bool;
>  rcode: rcode;
> }
> 
> So I am trying to construct one in my code like this:
> 
> module DP = Dnspacket
> 
> ...
> 
> let d:DP.detail = {qr = `Query; opcode = `Query; aa = false; tc = false;
> rd = false; ra = true; rccode = `NoError;} in
>    print_endline (detail_to_string d);
> 
> Which produces this error after the mir-unix-direct build:
> 
> Error: Unbound record field label qr
> 
> Now earlier I did an experiment to make sure qr had the right type, but
> printing our the qr_to_bool of q which worked fine. Somehow though however
> I massage it to produce the record I get an error. Can you help me Obi
> Wan?
> 
> Eireann
> 
> 
> 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.