Permalink
Browse files

strcat.

  • Loading branch information...
marcotmarcot committed Oct 4, 2012
1 parent d66b1f1 commit cf9754220bb9a25578215dc3ecf89b5f0f00c7de
Showing with 6 additions and 0 deletions.
  1. +6 −0 Scilab/Interpreter.hs
View
@@ -148,6 +148,8 @@ eval (ECall "sci2exp" [e])
String v
| V.length v == 1 -> V.head v
| otherwise -> T.pack $ show $ V.toList v
+eval (ECall "strcat" [e])
+ = String <$> V.singleton <$> T.concat <$> V.toList <$> getStrVec <$> eval e
eval (ECall var [ix])
= do
(Number typeVec v) <- readVar var
@@ -264,3 +266,7 @@ instance Valuable Bool where
isDouble _ = False
instance Valuable Int
+
+getStrVec :: Value -> V.Vector T.Text
+getStrVec (String v) = v
+getStrVec _ = error "getStrVec _"

0 comments on commit cf97542

Please sign in to comment.