<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I am wondering what the most appropriate technique is to emulate the concept of an interface that fronts a selected concrete representation of a translation process? Each translation process will have a common set of predicates to transform my AST into a different output form according to command line switches.</div><div class=""><br class=""></div><div class="">I have worked through several options but eventually they all feel cumbersome and clumsy. For example :-</div><div class=""><br class=""></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><font face="Courier New" class="">:- import_module form_a.  % renders ‘a’ code from AST</font></div></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><font face="Courier New" class="">:- import_module form_c.  % etc.</font></div></div><div class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><font face="Courier New" class="">:- import_module form_b.</font></div></div><div class=""><br class=""></div><div class="">    ( if option = “form a” then</div><div class="">        renderer = form_a.render</div><div class="">    else if option = “form b” then</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>renderer = form_b.render</div><div class=""><br class=""></div><div class="">then later where I need to call the render functions…</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>renderer( … )</div><div class="">   :</div><div class=""><br class=""></div><div class="">I hope my question is clear enough to elicit meaningful response. I have not had too much success using currying in Mercury, the above is about as brave as I have been but that’s only one possible solution. I guess I am just trying to make that leap from thinking about things in OO to more of a Mercury paradigm.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Sean</div><div class=""><br class=""></div></body></html>