Re: The external interface for the parser piece

2000-12-14 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Dan Sugalski <[EMAIL PROTECTED]> wrote: > I was under the impression that ANSI C required that a void * be large > enough to store any pointer type in it. Whether that's true or not's > irrelevant at the moment, though we can work something out at some poi

Re: The external interface for the parser piece

2000-12-13 Thread Dan Sugalski
At 02:36 PM 12/13/00 +, Nicholas Clark wrote: >Ah. Digest system tells me some messages for me bounced. > > > From: Damien Neil <[EMAIL PROTECTED]> > > On Mon, Nov 27, 2000 at 05:29:36PM -0500, Dan Sugalski wrote: > > >int perl6_parse(PerlInterp *interp, > > >void *sour

Re: The external interface for the parser piece

2000-12-13 Thread Nicholas Clark
Ah. Digest system tells me some messages for me bounced. > From: Damien Neil <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: The external interface for the parser piece > Message-ID: <[EMAIL PROTECTED]> > Mime-Version: 1.0 > Content-Type: text/plain; cha

Re: The external interface for the parser piece

2000-11-30 Thread Chaim Frenkel
> "JH" == Jarkko Hietaniemi <[EMAIL PROTECTED]> writes: JH> On a related note: a wrapper not completely unlike JH> union sv_any_aligned_s { JH> IV iv; JH> NV iv; JH> PV pv; JH> void *vp; JH> int (*dummy)(void) *fp; JH> /* any others? */ JH> }; JH> should be used aroun

Re: The external interface for the parser piece

2000-11-30 Thread Tim Bunce
On Thu, Nov 30, 2000 at 04:15:24PM +, Nick Ing-Simmons wrote: > Nicholas Clark <[EMAIL PROTECTED]> writes: > > > >We're trying to make this an easy embedding API. > > Yes, and we are in danger of "premature optimization" of the _interface_. Amen. Tim.

Re: The external interface for the parser piece

2000-11-30 Thread Jarkko Hietaniemi
> > > Huh? You're not talking about using this union around, say, the IV slot in > > > a scalar, I hope... > > > >You hope in vain :-) If we still want to in perl6 to do (disgusting) > >things like (we do in perl5) > > > > - "intercast" pointers and integers > > - "intercast" integ

Re: The external interface for the parser piece

2000-11-30 Thread Dan Sugalski
At 10:54 AM 11/30/00 -0600, Jarkko Hietaniemi wrote: >On Thu, Nov 30, 2000 at 11:23:11AM -0500, Dan Sugalski wrote: > > At 10:20 AM 11/30/00 -0600, Jarkko Hietaniemi wrote: > > >On Thu, Nov 30, 2000 at 10:03:06AM -0600, Jarkko Hietaniemi wrote: > > > > On a related note: a wrapper not completely u

Re: The external interface for the parser piece

2000-11-30 Thread Jarkko Hietaniemi
On Thu, Nov 30, 2000 at 11:23:11AM -0500, Dan Sugalski wrote: > At 10:20 AM 11/30/00 -0600, Jarkko Hietaniemi wrote: > >On Thu, Nov 30, 2000 at 10:03:06AM -0600, Jarkko Hietaniemi wrote: > > > On a related note: a wrapper not completely unlike > > > > > > union sv_any_aligned_s { > > > IV iv

Re: The external interface for the parser piece

2000-11-30 Thread Dan Sugalski
At 10:20 AM 11/30/00 -0600, Jarkko Hietaniemi wrote: >On Thu, Nov 30, 2000 at 10:03:06AM -0600, Jarkko Hietaniemi wrote: > > On a related note: a wrapper not completely unlike > > > > union sv_any_aligned_s { > > IV iv; > > NV iv; > > PV pv; > > void *vp; > > int (*du

Re: The external interface for the parser piece

2000-11-30 Thread Jarkko Hietaniemi
On Thu, Nov 30, 2000 at 10:03:06AM -0600, Jarkko Hietaniemi wrote: > On a related note: a wrapper not completely unlike > > union sv_any_aligned_s { > IV iv; > NV iv; > PV pv; > void *vp; > int (*dummy)(void) *fp; > /* any others? */ > }; > > should be used ar

Re: The external interface for the parser piece

2000-11-30 Thread Nick Ing-Simmons
Nicholas Clark <[EMAIL PROTECTED]> writes: > >We're trying to make this an easy embedding API. Yes, and we are in danger of "premature optimization" of the _interface_. What we need to start with is a list of "what we need to know" - they may as well be separate parameters at this point - the

Re: The external interface for the parser piece

2000-11-30 Thread Nick Ing-Simmons
Nicholas Clark <[EMAIL PROTECTED]> writes: >> Counted strings should probably just have either a platform-native int in >> front, or a 32-bit int in network format, both of which should be doable on >> any platform that perl deals with. > >I agree it's do-able. >What seems to me a good idea not

Re: The external interface for the parser piece

2000-11-30 Thread Jarkko Hietaniemi
On a related note: a wrapper not completely unlike union sv_any_aligned_s { IV iv; NV iv; PV pv; void *vp; int (*dummy)(void) *fp; /* any others? */ }; should be used around SVs to ascertain that everything fits everywhere. -- $jhi++; # http://ww

Re: The external interface for the parser piece

2000-11-30 Thread Nicholas Clark
On Tue, Nov 28, 2000 at 04:47:42PM -0500, Dan Sugalski wrote: > At 09:05 PM 11/28/00 +, Nicholas Clark wrote: >>On Tue, Nov 28, 2000 at 03:35:37PM -0500, Dan Sugalski wrote: Not sure: Dan: > is treated as if it points to a stream of bytes, where the first four are > the length o

Re: The external interface for the parser piece

2000-11-30 Thread Dan Sugalski
At 07:29 AM 11/30/00 -0800, Dave Storrs wrote: >On Wed, 29 Nov 2000, Dan Sugalski wrote: > > > At 09:51 AM 11/29/00 -0800, Dave Storrs wrote: > > >I have a feeling this is a stupid question, but I have to ask anyway. > > > > > >Do we really need to pass in a PerlInterp pointer? Or can perl6_par

Re: The external interface for the parser piece

2000-11-30 Thread Dave Storrs
On Wed, 29 Nov 2000, Dan Sugalski wrote: > At 09:51 AM 11/29/00 -0800, Dave Storrs wrote: > >I have a feeling this is a stupid question, but I have to ask anyway. > > > >Do we really need to pass in a PerlInterp pointer? Or can perl6_parse > >just create one for itself if/when it needs one? I

Re: The external interface for the parser piece

2000-11-30 Thread Damien Neil
On Mon, Nov 27, 2000 at 05:29:36PM -0500, Dan Sugalski wrote: >int perl6_parse(PerlInterp *interp, >void *source, >int flags, >void *extra_pointer); Count me in with the people who prefer: int perl6_parse(PerlInterp *interp, Perl

Re: The external interface for the parser piece

2000-11-29 Thread Dan Sugalski
At 02:49 PM 11/29/00 +, Nicholas Clark wrote: >On Wed, Nov 29, 2000 at 09:38:44AM -0500, Dan Sugalski wrote: > > At 10:42 AM 11/29/00 +, Nick Ing-Simmons wrote: > > > >FILE * is not a good idea. PerlIO * is fine. > > > > The problem with that is we're potentially getting the filehandle fro

Re: The external interface for the parser piece

2000-11-29 Thread Simon Cozens
On Wed, Nov 29, 2000 at 09:51:07AM -0800, Dave Storrs wrote: > I have a feeling this is a stupid question, but I have to ask anyway. > Do we really need to pass in a PerlInterp pointer? Yes. Threads. There's a reason for all the PERL_EXPLICIT_CONTEXT anxiety. -- Old Japanese proverb: T

Re: The external interface for the parser piece

2000-11-29 Thread Dan Sugalski
At 09:51 AM 11/29/00 -0800, Dave Storrs wrote: >I have a feeling this is a stupid question, but I have to ask anyway. > >Do we really need to pass in a PerlInterp pointer? Or can perl6_parse >just create one for itself if/when it needs one? If created, it could of >course be kept around so that

Re: The external interface for the parser piece

2000-11-29 Thread Dave Storrs
I have a feeling this is a stupid question, but I have to ask anyway. Do we really need to pass in a PerlInterp pointer? Or can perl6_parse just create one for itself if/when it needs one? If created, it could of course be kept around so that it didn't need to be re-created later.

Re: The external interface for the parser piece

2000-11-29 Thread Chaim Frenkel
> "NC" == Nicholas Clark <[EMAIL PROTECTED]> writes: NC> But on the other hand I also liked Simon Cozen's argument that it should NC> be easy to embed somewhere else, in which case why do we want to make NC> the parser have a dependency on the IO library? I can't see anyway that the dependen

Re: The external interface for the parser piece

2000-11-29 Thread Nick Ing-Simmons
Tom Hughes <[EMAIL PROTECTED]> writes: >In message <[EMAIL PROTECTED]> >Dan Sugalski <[EMAIL PROTECTED]> wrote: > >> At 10:42 AM 11/29/00 +, Nick Ing-Simmons wrote: >> >> >FILE * is not a good idea. PerlIO * is fine. >> >> The problem with that is we're potentially getting the filehan

Re: The external interface for the parser piece

2000-11-29 Thread Nicholas Clark
On Wed, Nov 29, 2000 at 09:38:44AM -0500, Dan Sugalski wrote: > At 10:42 AM 11/29/00 +, Nick Ing-Simmons wrote: > >FILE * is not a good idea. PerlIO * is fine. > > The problem with that is we're potentially getting the filehandle from > something that isn't perl. Or so my thinking went at t

Re: The external interface for the parser piece

2000-11-29 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 10:42 AM 11/29/00 +, Nick Ing-Simmons wrote: > > >FILE * is not a good idea. PerlIO * is fine. > > The problem with that is we're potentially getting the filehandle from > something that isn't perl. Or so my

Re: The external interface for the parser piece

2000-11-29 Thread Dan Sugalski
At 10:42 AM 11/29/00 +, Nick Ing-Simmons wrote: >Dan Sugalski <[EMAIL PROTECTED]> writes: > >At 07:03 PM 11/28/00 +, Tom Hughes wrote: > >>In message <[EMAIL PROTECTED]> > >> Dan Sugalski <[EMAIL PROTECTED]> wrote: > >> > >> > The third parameter is the flags parameter, and it's

Re: The external interface for the parser piece

2000-11-29 Thread Nick Ing-Simmons
Dan Sugalski <[EMAIL PROTECTED]> writes: >At 07:03 PM 11/28/00 +, Tom Hughes wrote: >>In message <[EMAIL PROTECTED]> >> Dan Sugalski <[EMAIL PROTECTED]> wrote: >> >> > The third parameter is the flags parameter, and it's optional. If omitted >> > or set to PERL_CHAR_SOURCE, the secon

Re: The external interface for the parser piece

2000-11-28 Thread Bryan C. Warnock
On Tue, 28 Nov 2000, Dan Sugalski wrote: > >I also like the suggestion that rather than supply flags, we should > >follow the lead and supply a Perl* something that would return an > >appropriate bunch of text to the parser. > > I'd really rather not, since that would place the burden of knowing

Re: The external interface for the parser piece

2000-11-28 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Dan Sugalski <[EMAIL PROTECTED]> wrote: > Right, and I called my abstract stream "void *source". :) It isn't really abstract though as it only understand types of streams that the parser author had thought of. An abstract stream would have a vtable or som

Re: The external interface for the parser piece

2000-11-28 Thread Steve Fink
Dan Sugalski wrote: > > Sure. Suggestions? int perl6_parse(PerlInterp* interp, PerlIO* input); PerlIO* make_memory_stream(char* buf, ssize_t length); // length=-1 for nul-terminated int close_stream(PerlIO* stream); then if you read further, you'll eventually see: PerlIO* make_callback_stream(

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 04:23 PM 11/28/00 -0500, Chaim Frenkel wrote: >Err, this seems a little too Swiss Army Knife. > >This reads like a utility function. (i.e. A function that handles the >most common scenerio.) What it's supposed to be is the highest-level interface to the parser, and so it's supposed to handle

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 09:05 PM 11/28/00 +, Nicholas Clark wrote: >On Tue, Nov 28, 2000 at 03:35:37PM -0500, Dan Sugalski wrote: > > > > is treated as if it points to a stream of bytes, where the first > four are > > >I spy magic number.

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 03:15 PM 11/28/00 -0600, Jarkko Hietaniemi wrote: >On Tue, Nov 28, 2000 at 03:34:22PM -0500, Dan Sugalski wrote: > > At 01:25 PM 11/28/00 -0600, Jarkko Hietaniemi wrote: > > >On Tue, Nov 28, 2000 at 07:03:49PM +, Tom Hughes wrote: > > > > Applying the maxim that any software design problem

Re: The external interface for the parser piece

2000-11-28 Thread Jarkko Hietaniemi
On Tue, Nov 28, 2000 at 03:15:35PM -0600, Jarkko Hietaniemi wrote: > On Tue, Nov 28, 2000 at 03:34:22PM -0500, Dan Sugalski wrote: > > At 01:25 PM 11/28/00 -0600, Jarkko Hietaniemi wrote: > > >On Tue, Nov 28, 2000 at 07:03:49PM +, Tom Hughes wrote: > > > > Applying the maxim that any software

Re: The external interface for the parser piece

2000-11-28 Thread Chaim Frenkel
Err, this seems a little too Swiss Army Knife. This reads like a utility function. (i.e. A function that handles the most common scenerio.) Shouldn't a set of lower level visible API be visible? One that seems to pop out at me is some way of actually parsing a piece of code and ending up with a

Re: The external interface for the parser piece

2000-11-28 Thread Jarkko Hietaniemi
On Tue, Nov 28, 2000 at 03:34:22PM -0500, Dan Sugalski wrote: > At 01:25 PM 11/28/00 -0600, Jarkko Hietaniemi wrote: > >On Tue, Nov 28, 2000 at 07:03:49PM +, Tom Hughes wrote: > > > Applying the maxim that any software design problem can be solved > > > with sufficient levels of abstraction I'

Re: The external interface for the parser piece

2000-11-28 Thread Nicholas Clark
On Tue, Nov 28, 2000 at 03:35:37PM -0500, Dan Sugalski wrote: > > > is treated as if it points to a stream of bytes, where the first four are I spy magic number. > > > the length of the source to be read followed by the

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
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 para

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 01:25 PM 11/28/00 -0600, Jarkko Hietaniemi wrote: >On Tue, Nov 28, 2000 at 07:03:49PM +, Tom Hughes wrote: > > Applying the maxim that any software design problem can be solved > > with sufficient levels of abstraction I'd suggest that passing some > >A related warning sign is trying to cra

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 07:03 PM 11/28/00 +, Tom Hughes wrote: >In message <[EMAIL PROTECTED]> > Dan Sugalski <[EMAIL PROTECTED]> wrote: > > > 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-t

Re: The external interface for the parser piece

2000-11-28 Thread Tim Jenness
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 > o

Re: The external interface for the parser piece

2000-11-28 Thread Jarkko Hietaniemi
On Tue, Nov 28, 2000 at 07:03:49PM +, Tom Hughes wrote: > In message <[EMAIL PROTECTED]> > Dan Sugalski <[EMAIL PROTECTED]> wrote: > > > 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 sta

Re: The external interface for the parser piece

2000-11-28 Thread Tom Hughes
In message <[EMAIL PROTECTED]> Dan Sugalski <[EMAIL PROTECTED]> wrote: > 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 sec

Basic embedding [was: Re: The external interface for the parser piece]

2000-11-28 Thread Benjamin Stuhl
--- Steve Fink <[EMAIL PROTECTED]> wrote: > Dan Sugalski wrote: > > > >int perl6_parse(PerlInterp *interp, > >void *source, > >int flags, > >void *extra_pointer); > > Given that other things may want to be streamable in > similar f

Re: The external interface for the parser piece

2000-11-28 Thread Dan Sugalski
At 09:48 AM 11/28/00 -0800, Steve Fink wrote: >Dan Sugalski wrote: > > > >int perl6_parse(PerlInterp *interp, > >void *source, > >int flags, > >void *extra_pointer); > >Given that other things may want to be streamable in similar fash

Re: The external interface for the parser piece

2000-11-28 Thread Steve Fink
Dan Sugalski wrote: > >int perl6_parse(PerlInterp *interp, >void *source, >int flags, >void *extra_pointer); Given that other things may want to be streamable in similar fashion (eg the regular expression engine), why not have a Per

The external interface for the parser piece

2000-11-27 Thread Dan Sugalski
While I'm not sure of the structure of the internals of the parsing piece of perl at the moment (and, unfortunately, language parsers aren't one of my strong points), I am reasonably certain of the interface we'll present to the rest of the world and the other pieces of perl. So... comments? -