
Thanks a lot, Tom. That really clarified the issue :) -Kartik Tom Shackell wrote:
Firstly we have to remember that every heap node follows the same structure: first we have the node header, then we have pointers to arguments.
... In the second case we get an application to putStrLn with it's argument pointer being the header of show (i.e. a random junk pointer). ... in general you either end up needing heap offsets (nhc's solution) or a stack (yhc's solution).
-- Kartik Vaddadi. Home: www.cse.iitb.ac.in/~kart Blogs: kartik.infogami.com, kartik-log.blogspot.com, kartik-rlog.blogspot.com Alternate mail ID: kartik.vad@gmail.com "50% Reservation, 100% Politics" - Protest the Indian government's decision to increase reservation in private educational institutions (yfemumbai.blogspot.com)