develooper Front page | perl.perl6.internals.api.parser | Postings from November 2000

Re: The external interface for the parser piece

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
November 28, 2000 12:36
Subject:
Re: The external interface for the parser piece
Message ID:
5.0.1.4.0.20001128153427.0243b500@24.8.96.48
At 09:10 AM 11/28/00 -1000, Tim Jenness wrote:
>On Mon, 27 Nov 2000, Dan Sugalski wrote:
>
> > ---------------
> >
> >    int perl6_parse(PerlInterp *interp,
> >                    void *source,
> >                    int flags,
> >                    void *extra_pointer);
> >
>
> > The third parameter is the flags parameter, and it's optional. If omitted
> > or set to PERL_CHAR_SOURCE, the second parameter is treated as a standard
> > null-terminated string. If set to PERL_COUNTED_SOURCE, the second 
> parameter
> > is treated as if it points to a stream of bytes, where the first four are
> > the length of the source to be read followed by the source. If set to
>
>Since you have a fourth argument couldn't that be used for the length
>of the byte stream rather than embedding that length into the byte stream
>itself? Makes more sense to me to separate the bytes from the length.

I'd rather the stream be self-contained, rather than needing an extra 
argument for the length. Counted strings aren't uncommon outside of C, and 
there's no reason a Fortran or COBOL (or Java, or...) program can't embed perl.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About