At 10:52 AM 10/1/2001 -0400, Gregor N. Purdy wrote: >Dan -- > > > Here's a list of manifest constants I think Parrot should know about. > > Anyone care to add to the list? > > > > '' (empty string) > > 0 > > 1 > > undef > > NaN > > pi > > e > > epsilon (maybe) > >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. >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. Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk