At 1:14 PM -0700 5/15/02, Brent Dax wrote: >Dan Sugalski: ># At 12:51 AM -0700 5/15/02, Brent Dax wrote: ># >-Parrot becomes Parrot_Interp ># >-Parrot_String is gone and the string_funcs.h functions are ># no longer ># >externally visible. -A few structures have been renamed. ># >-config.h has been rearranged so that INTVAL, etc. are now ># aliases for ># >Parrot_Int, etc. ># >-A few things that were accidentally made external no longer are. ># ># This isn't a problem with config.h. config.h should *never* be used ># by anyone embedding Parrot, either directly or indirectly. > >Why not? Some parts of Parrot's embedding system have to be set up by >Configure.
And those parts should go in embed.h. The bare minimum amount of stuff should go in there--the definitions of INTVAL, NUMVAL, Buffer, STRING (maybe), and the exported functions. A later phase of the build could probably set this up as well, as it'd have access to more information. Stuff like PMC definitions shouldn't go in it. PMC * should be typedef'd to void * in the embedding header. ># >I first noticed the problems with computed-goto when I found the ># >following line in test_main.c: ># > ># > #ifdef HAVE_COMPUTED_GOTO ># > ># >See the problem? ># ># Yes. test_main.c should never have to know about computed goto cores ># or whatnot. The define's likely something generally passed on the ># command line to all the parrot core bits, > >True. Still, the idea of a define like this not being fixed somewhere >scares me a bit. If someone tries to send us a copy of their config.h >so we can debug a problem, we can't tell if they have cgoto enabled. That's definitely a problem. That #define should be in config.h, and *is* a problem. >Actually, it should know that Parrot may support a computed-goto core >and the flag to enable it is X. It shouldn't have to know if this >particular copy of Parrot is built with that capability. (It probably >should be able to detect it, however, so that it can handle cases like >the one in test_main's -h handler.) Flag handling, or at least feature enabling, should probably be done by core code. We should provide a set_feature() function ># test_main.c should only use "parrot/embed.h", which shouldn't include ># any Parrot .h files > >I'm including three: > >-parrot/interpreter.h, which provides a forward definition of struct >Parrot_Interp and a full definition of enum Parrot_Interp_flag. We should have a typedef for Parrot_Interp to void * for embedders. >-parrot/warnings.h, which provides warning classes. Hrm, good point. >-parrot/config.h, which provides data like what a Parrot_Int (INTVAL) is >and what version of Parrot this is. > >All three are specifically crafted to expose as little as possible. >(Well, maybe not config.h, but it doesn't expose anything that isn't >prefixed. I should probably move most of the JIT stuff out of the >interface. In fact, I'll do that right now.) Cool. -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk