
8 Nov
2005
8 Nov
'05
8:19 p.m.
On Tue, Nov 08, 2005 at 02:43:47PM +0000, Malcolm Wallace wrote:
Of course, there is the old stand-by C pre-processor trick:
#define superError(s) error (s++"\nin file "++__FILE__ \ ++" at line "++__LINE__)
There is a nice trick I saw in darcs' code to make this even more Haskellish: #define superError (\s -> error (s++"\nin file "++ __FILE__ \ ++" at line "++ show (__LINE__ :: Int))) so you can simply write: superError "message" Best regards Tomasz