@@ -455,8 +455,8 @@ getInt _ = []
456strToInt :: IntTy -> [Const] -> Maybe Const
456strToInt :: IntTy -> [Const] -> Maybe Const
457strToInt ity [Str x] = case reads x of
457strToInt ity [Str x] = case reads x of
458− [(n,"")] -> Just $ toInt ity (n :: Integer)
458+ [(n,s)] -> Just $ if all isSpace s then toInt ity (n :: Integer) else I 0
459− _ -> Just $ I 0
459+ _ -> Just $ I 0
460strToInt _ _ = Nothing
460strToInt _ _ = Nothing
462intToFloat :: [Const] -> Maybe Const
462intToFloat :: [Const] -> Maybe Const
@@ -481,8 +481,8 @@ c_floatToStr :: [Const] -> Maybe Const
481c_floatToStr [Fl x] = Just $ Str (show x)
481c_floatToStr [Fl x] = Just $ Str (show x)
482c_floatToStr _ = Nothing
482c_floatToStr _ = Nothing
483c_strToFloat [Str x] = case reads x of
483c_strToFloat [Str x] = case reads x of
484− [(n,"")] -> Just $ Fl n
484+ [(n,s)] -> Just $ Fl (if all isSpace s then n else 0)
485− _ -> Just $ Fl 0
485+ _ -> Just $ Fl 0
486c_strToFloat _ = Nothing
486c_strToFloat _ = Nothing
488p_fPrim :: (Double -> Double) -> [Const] -> Maybe Const
488p_fPrim :: (Double -> Double) -> [Const] -> Maybe Const