Fixed hashes, such as the return from stat() can be handled in the
compiler. (Ala perl5's pseudo hash.)

This could possibly be combined with the proposed direct pack/unpack
handling of structures. So that the stat buffer would be transformed
into a hash refering to a structure buffer. 

$stat{ino} could directly access the structure.
$stat{$field} would go via the hash interface.

<chaim>


>>>>> "SS" == Steve Simmons <[EMAIL PROTECTED]> writes:

>> =head1 IMPLEMENTATION

SS> I strongly support Damiens suggestion on a hashref, and would go so
SS> far as to say it should be a pseudo-hash, with all the attendant
SS> misspelling protections and speed obtained.

SS> Passing lists around can be expensive, manipulating hashes can be
SS> expensive.  I'd extend Damiens suggestion to allow the programmer
SS> to specify only the sub-data desired, eg:

SS>     # undef context, store results in passed hashref

SS>     my %data_wanted = \(mode => 0, nlink => 0);
SS>     stat( $filename,\$data_wanted);

SS> This could even be done in a list context, with a possible
SS> implementation suggested:

SS>     # List context, return only the two values requested in order

SS>     ($mode,$nlink) = stat($filename,\('mode','nlink'));


-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to