From: Ian T Zimmerman <itz@rahul.net>
To: caml-list@inria.fr
Subject: Re: lexing__get_next_char ?
Date: Mon, 21 Oct 1996 09:55:53 -0700 [thread overview]
Message-ID: <199610211655.JAA26218@kronstadt.rahul.net> (raw)
In-Reply-To: Xavier Leroy's message of Mon, 21 Oct 1996 16:30:50 +0200 (MET DST)
In article <199610211430.QAA11843@pauillac.inria.fr> Xavier Leroy
<Xavier.Leroy@inria.fr> writes:
>
> > In the caml-light sources, in src/runtime/lexing.c, the primitive
> > get_next_char is defined as follows:
> >
> > struct lexer_buffer {
> > value refill_buff;
> > value lex_buffer;
> > value lex_abs_pos;
> > value lex_start_pos;
> > value lex_curr_pos;
> > value lex_last_pos;
> > value lex_last_action;
> > };
> >
> > value get_next_char(lexbuf) /* ML */
> > struct lexer_buffer * lexbuf;
> > {
> > mlsize_t buffer_len, curr_pos;
> >
> > buffer_len = string_length(lexbuf->lex_buffer);
> > ...
> >
> > How can this work, when lexer buffers are ML records on the heap, as
> > the following piece of src/lib/lexing.ml seems to show
>
> Viewed from C, Caml records are arrays of elements of type "value".
> So, we're basically casting a pointer to a "value" array to a pointer
> to a struct with all fields having type "value".
But don't they have the header word in front??
--
Ian T Zimmerman <itz@rahul.net>
Days spent working only for oneself are twice wasted;
it would have been better not to work at all.
prev parent reply other threads:[~1996-10-22 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-10-18 3:40 Ian T Zimmerman
1996-10-21 14:30 ` Xavier Leroy
1996-10-21 16:55 ` Ian T Zimmerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199610211655.JAA26218@kronstadt.rahul.net \
--to=itz@rahul.net \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox