Show
Ignore:
Timestamp:
09/29/06 03:47:40 (2 years ago)
Author:
audreyt
Message:

* Make interpolating <<$x>> behave a bit more like <<literal>>:

my $x = 'foo';
<< $x >>; # Str('foo')
<< $x $x >>; # Seq(Str('foo'), Str('foo'))

It used to be that it produces a list no matter what, but that
wasn't the behaviour for noninterpolating literals.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/Match.hs

    r13710 r13718  
    185185        True -> do 
    186186            strs <- mapM fromVal rv 
    187             return (VList $ map VStr strs) 
     187            return $ case strs of 
     188                [str]   -> VStr str 
     189                _       -> VList $ map VStr strs 
    188190        _ | isSlurpyCxt cxt -> do 
    189191            return (VList rv)