Changeset 17177

Show
Ignore:
Timestamp:
07/30/07 17:02:08 (16 months ago)
Author:
masak
Message:

[Prim/Code.hs]
* <anon> coderefs are now treated properly
* I have no idea what I am doing, am not a Haskell programmer, I just play one on TV. Code review appreciated

Files:
1 modified

Legend:

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

    r17149 r17177  
    55import Pugs.AST 
    66import Pugs.Internals 
     7import qualified Data.ByteString.Char8 as Char8 
    78-- import Pugs.Pretty 
    89 
     
    2425op1CodeName v = do 
    2526    code <- fromVal v 
    26     return . VStr $ "&" ++ cast (subPackage code) ++ "::" ++ tail (cast (subName code)) 
     27    return . VStr $ case Char8.unpack(subName code) of 
     28        "<anon>"  -> cast $ subName code 
     29        _         -> "&" ++ cast (subPackage code) ++ 
     30                     "::" ++ tail (cast (subName code)) 
    2731 
    2832op1CodeArity :: Val -> Eval Val