Changeset 13658 for src/Pugs/Run

Show
Ignore:
Timestamp:
09/26/06 08:19:57 (2 years ago)
Author:
audreyt
Message:

* Pugs/Perl5 embedding overhaul:

Passing mutable Scalar, Hash, Array, Code, Pair and Handle objects
into Perl 5 land now creates the correct tie() SVs there.
( To pass in a scalar, use the "func(VAR($x))" syntax.)

* Native values (Undef, IV, NV, PV) from Perl 5 land now occurs in

Pugs land as native values, not doubly-boxed SV pointers.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Run/Perl5.hs

    r12871 r13658  
    4444foreign export ccall "pugs_PvToVal" 
    4545    pvToVal :: CString -> IO PugsVal 
     46 
     47foreign export ccall "pugs_UndefVal" 
     48    undefVal :: IO PugsVal 
    4649 
    4750askPerl5Env :: IO Env 
     
    9396    newSVval val 
    9497 
    95 newSVval :: Val -> IO PerlSV 
    96 newSVval val = case val of 
    97     PerlSV sv   -> return sv 
    98     VStr str    -> vstrToSV str 
    99     VType typ   -> vstrToSV (showType typ) 
    100     VBool bool  -> vintToSV (fromEnum bool) 
    101     VInt int    -> vintToSV int 
    102     VRat rat    -> vnumToSV rat 
    103     VNum num    -> vnumToSV num 
    104     _           -> mkValRef val 
    105  
    10698valToIv :: PugsVal -> IO CInt 
    10799valToIv ptr = do 
     
    140132    return ptr 
    141133 
     134undefVal :: IO PugsVal 
     135undefVal = mkVal VUndef 
     136 
    142137#endif