
Hi All. I'm experimenting a strange behavior. I've wrote in Haskell a tool to automatic generate C++ code. All works fine if I use GHCi or compile with GHC on WIndows, but I see the strange behavior if I use my program on MacOS X 10.6.4 In example, the portion of code here below createConstructor :: [String] -> String -> [String] createConstructor xs classname = ["\t\tpublic: " ++ classname ++ "()\n\t\t{"] ++ ["\t\t\t" ++ (snd (makePair x)) ++ " = nullptr;" | x <- xs] ++ ["\t\t}\n"] on Windows generate: public: DAT_CDM_Enum() { fileName = nullptr; filePath = nullptr; fileType = nullptr; } but on MacOS X 10.6.4 I have: public: DAT_CDM_Enum() { = nullptr; fileName = nullptr; filePath fileType = nullptr; } This is a very weird behavior to me. I'm using Haskell platform (ghc 6.12.1) on MacOS X and on Windows. Any idea? Luca

On Wednesday 16 June 2010 15:34:15, Luca Ciciriello wrote:
Hi All. I'm experimenting a strange behavior. I've wrote in Haskell a tool to automatic generate C++ code. All works fine if I use GHCi or compile with GHC on WIndows, but I see the strange behavior if I use my program on MacOS X 10.6.4
Any idea?
Does snd (makePair x) contain an '\r' character? That would explain it.
Luca

Hi Daniel. I solved the question writing a little function that remove from the input file all the \r chars and all the \n chars. So your first intuition seems be correct. Thanks. Luca. On Jun 16, 2010, at 3:51 PM, Daniel Fischer wrote:
On Wednesday 16 June 2010 15:34:15, Luca Ciciriello wrote:
Hi All. I'm experimenting a strange behavior. I've wrote in Haskell a tool to automatic generate C++ code. All works fine if I use GHCi or compile with GHC on WIndows, but I see the strange behavior if I use my program on MacOS X 10.6.4
Any idea?
Does snd (makePair x) contain an '\r' character? That would explain it.
Luca
participants (2)
-
Daniel Fischer
-
Luca Ciciriello