Show
Ignore:
Timestamp:
05/27/05 05:22:52 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
5515
Message:

* Perl 5 Array and Hash are now accessible from Perl 6.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Types/Hash.hs

    r3947 r3961  
    120120instance HashClass PerlSV where 
    121121    hash_iType = const $ mkType "Hash::Perl" 
     122    hash_fetchVal sv key = do 
     123        keySV   <- fromVal $ castV key 
     124        evalPerl5Sub "sub { $_[0]->{$_[1]} }" [sv, keySV] 
    122125    hash_clear _ = retConstError undef 
    123126    hash_store _ _ = retConstError undef 
    124     hash_storeVal _ _ _ = retConstError undef 
     127    hash_storeVal sv key val = do 
     128        keySV   <- fromVal $ castV key 
     129        valSV   <- fromVal val 
     130        evalPerl5Sub "sub { $_[0]->{$_[1]} = $_[2] }" [sv, keySV, valSV] 
     131        return () 
    125132    hash_storeElem _ _ _ = retConstError undef 
    126133    hash_deleteElem _ _ = retConstError undef