On Fri, 18 Jul 2008, James Keenan via RT wrote:

> On Fri Jul 18 08:22:48 2008, doughera wrote:
> 
> > 
> > Oh yes -- I did remember one other.  Configure.pl currently offers you
> the 
> > opportunity to specify different sizes for opcode_t and INTVAL.  However, 
> > parrot itself assumes they are the same size.  (See [perl #56810] for a 
> > little more background.)
> > 
> 
> This is outside my area of competence, but I suspect the relevant code
> is this part of config/inter/types.pm:
> 
> sub runstep {
>     my ( $self, $conf ) = @_;
> 
>     my $intval   = $conf->options->get('intval')   || 'long';
>     my $floatval = $conf->options->get('floatval') || 'double';
>     my $opcode   = $conf->options->get('opcode')   || 'long';
> 
>     if ( $conf->options->get('ask') ) {
>         $intval   = prompt( "\n\nHow big would you like your integers to
> be?", $intval );
>         $floatval = prompt( "And your floats?",                        
>        $floatval );
>         $opcode   = prompt( "What's your native opcode type?",         
>        $opcode );
>         print "\n";
>     }
> 
>     $conf->data->set(
>         iv       => $intval,
>         nv       => $floatval,
>         opcode_t => $opcode
>     );
> 
>     return 1;
> }
> 
> Would you care to submit a patch?  Thanks.

I just had something trvial in mind, perhaps like this (completely 
untested).  It still allows the choice via command line options (which 
need a reworking, so I didn't touch them) but defaults to using the same 
size for both.

--- prompt.orig 2008-07-21 08:46:34.000000000 -0400
+++ prompt.new  2008-07-21 08:46:24.000000000 -0400
@@ -3,17 +3,15 @@
 
     my $intval   = $conf->options->get('intval')   || 'long';
     my $floatval = $conf->options->get('floatval') || 'double';
-    my $opcode   = $conf->options->get('opcode')   || 'long';
 
     if ( $conf->options->get('ask') ) {
         $intval   = prompt( "\n\nHow big would you like your integers to
 be?", $intval );
         $floatval = prompt( "And your floats?",                        
        $floatval );
-        $opcode   = prompt( "What's your native opcode type?",         
-       $opcode );
         print "\n";
     }
+    my $opcode   = $conf->options->get('opcode')   || $intval;
 
     $conf->data->set(
         iv       => $intval,


More generally, I was just making my usual rant that prior to extensive 
refactoring or testing of any file, it makes sense to consider whether the 
existing behavior is even worth refactoring or testing.  (Specifically, 
I'm thinking about the auto/pack.pm stuff.  This opcode_t stuff is more 
subtle, but it came up recently in another context, so I thought I'd 
mention it.)

 -- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to