Changeset 5853

Show
Ignore:
Timestamp:
07/27/05 21:49:57 (3 years ago)
Author:
iblech
svk:copy_cache_prev:
7758
Message:

* t/subroutines/subroutine.t -- unEVAL.
* Pugs.Compile -- Emit &circumfix:<${ }> for Syn "${}" (and similar for

@{}, etc.) so I can implement the dereferencers in PIL2JS.

* PIL2JS: Prelude::JS::Ref -- Implemented ${}, @{}, etc.

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • perl5/PIL2JS/lib6/Prelude/JS/Ref.pm

    r5782 r5853  
    2525  })')($thing); 
    2626} 
     27 
     28sub circumfix:<${}>($thing) is primitive is rw { PIL2JS::Internals::generic_deref($thing) } 
     29sub circumfix:<@{}>($thing) is primitive is rw { PIL2JS::Internals::generic_deref($thing) } 
     30sub circumfix:<%{}>($thing) is primitive is rw { PIL2JS::Internals::generic_deref($thing) } 
     31sub circumfix:<&{}>($thing) is primitive is rw { PIL2JS::Internals::generic_deref($thing) } 
  • src/Pugs/Compile.hs

    r5721 r5853  
    357357    compile (Syn "\\[]" exps) = do 
    358358        compile (App (Var "&circumfix:[]") Nothing exps) 
     359    compile (Syn name@(sigil:"{}") exps) | (sigil ==) `any` "$@%&" = do 
     360        compile (App (Var $ "&circumfix:" ++ name) Nothing exps) 
    359361    compile (Syn "\\{}" exps) = do 
    360362        compile (App (Var "&circumfix:{}") Nothing exps) 
  • t/subroutines/subroutine.t

    r5770 r5853  
    3131ok(twice(5) == 10); 
    3232#if (&twice(5 - 3) == 4) { say "ok 4" } else { say "not ok 4" } 
    33 ok(eval 'twice(5 - 3) == 4'); 
     33ok(twice(5 - 3) == 4); 
    3434 
    3535my $_;