<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=""><div class=""><span style="font-family: CourierNewPSMT; font-size: 16px;" class="">Hi Zoltan,</span></div><div class=""><span style="font-family: CourierNewPSMT; font-size: 16px;" class=""><br class=""></span></div><span style="font-family: CourierNewPSMT; font-size: 16px;" class="">> The ambiguity comes in because list.filter has both an arity 3 and an arity 4 version,</span><br style="font-family: CourierNewPSMT; font-size: 16px;" class=""><span style="font-family: CourierNewPSMT; font-size: 16px;" class="">> and the compiler does not know which one you are trying to partially apply.</span><div class=""><font face="CourierNewPSMT" size="3" class=""><br class=""></font></div><div class=""><font face="CourierNewPSMT" size="3" class="">BINGO! I *love* exchanges like this because these are the times you truly learn something!</font></div><div class=""><font face="CourierNewPSMT" size="3" class="">The irony is that is was *because* of my morning coffee that I dug deep enough for us both to get to the solution to the puzzle.</font></div><div class=""><span style="font-family: CourierNewPSMT; font-size: medium;" class="">The software industry would collapse without coffee, and pizza, probably.</span></div><div class=""><font face="CourierNewPSMT" size="3" class=""><br class=""></font></div><div class=""><font face="CourierNewPSMT" size="3" class="">Thanks again Zoltan, a pleasure as always, I feel really happy now that the veil has lifted and I understand both the initial problem I had and my workarounds and I have now put the code back to how I wanted it in the first place but with —understanding— , the thing that sets machines apart from humans.</font></div><div class=""><font face="CourierNewPSMT" size="3" class=""><br class=""></font></div><div class=""><font face="CourierNewPSMT" size="3" class="">Excellent!</font></div><div class=""><span style="font-family: CourierNewPSMT; font-size: medium;" class="">:)</span></div><div class=""><font face="CourierNewPSMT" size="3" class="">Sean</font></div><div class=""><font face="CourierNewPSMT" size="3" class=""><br class=""></font><div><br class=""><blockquote type="cite" class=""><div class="">On 13 Jun 2021, at 09:51, Zoltan Somogyi <<a href="mailto:zoltan.somogyi@runbox.com" class="">zoltan.somogyi@runbox.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class="">2021-06-13 18:43 GMT+10:00 "Sean Charles (emacstheviking)" <<a href="mailto:objitsu@gmail.com" class="">objitsu@gmail.com</a>>:<br class=""><blockquote type="cite" class="">Your response says that the function form takes a function as the first arg but they all take a closure as the first argument, at least from looking at the source code for 20.06.01.<br class=""></blockquote><br class="">You are right, I was wrong: all versions of list.filter take a pred as the first arg.<br class="">The ambiguity comes in because list.filter has both an arity 3 and an arity 4 version,<br class="">and the compiler does not know which one you are trying to partially apply.<br class=""><br class="">Normally, the ambiguity is resolved when you use the result of the partial application<br class="">in a context that matches only one of the alternatives. However, in your original code,<br class="">the *only* thing you did with Tokens was convert it to a string, using string.string,<br class="">and that can be done for *any* type. That was what the original ambiguity message<br class="">was about. (I should not have sent my first reply before by first morning dose<br class="">of caffeine :-)<br class=""><br class=""><blockquote type="cite" class="">If I understand your response correctly, you are saying that Tokens is in fact bound to a closure presumably because I have failed to fully satisfy a func/pred form and ended up with, in Haskell terminology, a partial application?<br class=""></blockquote><br class="">Yes.<br class=""><br class=""><blockquote type="cite" class="">Changing my code to read:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>list.filter(Pr. Tk, Tokens)<br class=""><br class="">compiles as the first predicate form was satisfied, changing it to this:<br class=""><br class=""> list.filter(Pr, Tk, Tokens, Comments),<br class=""><br class="">also compiles as the second predicate form is used (this might be useful in the future actually :) and this code:<br class=""><br class=""> Tokens = list.filter(Pr, Tk)<br class=""><br class="">obviously still fails to compile and I still fail to understand. <br class=""></blockquote><br class="">I hope the above explains it.<br class=""><br class="">Zoltan.</div></div></blockquote></div><br class=""></div></body></html>