Dan -- > >That brings up an interesting issue. The Ix registers initialize to > >zero, as do the Nx registers. These are valid values for those > >register types. However, the Sx registers initialize to NULL, which is > >not treated elsewhere (such as print_sc) as a valid string value. > > The registers shouldn't be assumed to initialize to anything. (I'll start > stuffing 0xDEADBEEF in there if I have to... :) Only the PMC registers > should go to a value, and that's only because it'll cause the GC fits if > they don't.
What, then, are the specifications for clear_[insp]? Are they going to "initialize to some random value you had better not care about" (in which case, why bother with clear_i, since if any value will do, so will the current value), or are they going to "initialize to some known good value", in which case 0 and 0.0 seem reasonable for _i and _n, and '' (not NULL) seems reasonable for _s. That is, unless all string stuff is going to treat NULL as if it were '' and autovivify real strings in registers if needed. > >Now, I'm not sure what you mean when you say "Parrot should know > >about" these. Are you referring to special treatment in the > >assembler? Are you suggesting every const_table be initialized with > >these values? > > Basically these are constants that are known and provided to you by the > interpreter. (So we can avoid people hand-rolling pi and e, amongst other > things) > > I think we might end up with a get_manifest_constant opcode that takes a > register and a known named constant, like so: > > get_manifest_constant N3, pi > > and looks up the constant from the table we build into parrot. Might want > to hide that so that: > > set N3, pi > > automagically does the conversion. Is 'pi' a string to be looked up in a table at assemble time and converted to an "intrinsic constant table index", or is it a string to be looked up at load/interpretation time and converted to a value then? If we look them up late, we could have a mechanism for libraries to export new ones and 'pi' would be an short for 'CORE::pi' or something. Regards, -- Gregor _____________________________________________________________________ / perl -e 'srand(-2091643526); print chr rand 90 for (0..4)' \ Gregor N. Purdy [EMAIL PROTECTED] Focus Research, Inc. http://www.focusresearch.com/ 8080 Beckett Center Drive #203 513-860-3570 vox West Chester, OH 45069 513-860-3579 fax \_____________________________________________________________________/