On Mon, 3 Sep 2007, James Keenan via RT wrote: > Here's an issue I hadn't previously spotted in config/inter/progs.pm -- > one that was revealed in the coverage analysis > (http://thenceforward.net/parrot/coverage/configure-build/config-inter-progs-pm.html). > > In this package's sub runstep(), there is the following code: > > # Find a working version of a program: > # Try each alternative, until one works. > # If none work, then set to null command. > # RT#43173 need config support for a null command. > my $null = 'echo'; > my $first_working = sub { > foreach (@_) { > `$_ -h 2>&1`; > return $_ if not $?; > } > return $null; > }; > > Neither $null nor $first_working is called at any point below this in > the sub or file. It does not appear to be invoked by any configuration > step. And since I don't know what its' for, I can't write a plausible > test for it.
> Does anyone know the purpose of this code? svn annotate indicates > jhoblitt and ptc have touched it. It's very old, but not used now. It was used to find the first working program from a set of ostensibly equivlent possibilities for bison and flex (e.g. first_working('flex', 'lex')). However, Parrot now assumes bison and flex and won't work with traditional yacc or lex, so the function isn't relevant anymore. For general purpose use, it's simply inappropriate. It assumes every function has a -h (or similar) flag. That issue was discussed at length in RT#41168: graceful "no compiler" error message? I'd say just delete it. -- Andy Dougherty [EMAIL PROTECTED]