From 33c374fb750c72d0129c808f64fd1d66b1388703 Mon Sep 17 00:00:00 2001 From: dons Date: Mon, 10 Apr 2006 00:25:00 +0000 Subject: [PATCH] Random name instead of 'v' --- src/System/Eval/Haskell.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/System/Eval/Haskell.hs b/src/System/Eval/Haskell.hs index a56f000..58fd19a 100644 --- a/src/System/Eval/Haskell.hs +++ b/src/System/Eval/Haskell.hs @@ -235,8 +235,8 @@ dynwrap expr nm mods = "module "++nm++ "( resource ) where\n" ++ concatMap (\m-> "import "++m++"\n") mods ++ "import AltData.Dynamic\n" ++ - "resource = let { v = \n" ++ - "{-# LINE 1 \"\" #-}\n" ++ expr ++ ";} in toDyn v" + "resource = let { yhjulwwiefzojcbxybbruweejw = \n" ++ + "{-# LINE 1 \"\" #-}\n" ++ expr ++ ";} in toDyn yhjulwwiefzojcbxybbruweejw" -- --------------------------------------------------------------------- -- unsafe wrapper @@ -245,8 +245,13 @@ wrap :: String -> String -> [Import] -> String wrap expr nm mods = "module "++nm++ "( resource ) where\n" ++ concatMap (\m-> "import "++m++"\n") mods ++ - "resource = let { v = \n" ++ - "{-# LINE 1 \"\" #-}\n" ++ expr ++ ";} in v" + "resource = let { yhjulwwiefzojcbxybbruweejw = \n" ++ + "{-# LINE 1 \"\" #-}\n" ++ expr ++ ";} in yhjulwwiefzojcbxybbruweejw" + +-- what is this big variable name? +-- its a random value, so that it won't clash if the accidently mistype +-- an unbound 'x' or 'v' in their code.. it won't reveal the internal +-- structure of the wrapper, which is annoying in irc use by lambdabot {- ------------------------------------------------------------------------