<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="">Before setting off to the tattoo parlour I made one small change to keep it more ‘DCG’, I removed {true} and put in [] instead./..<div class=""><br class=""></div><div class=""><div class=""><font face="Courier" class="">skip_ws --></font></div><div class=""><font face="Courier" class=""> ( if ([' '];['\t'])</font></div><div class=""><font face="Courier" class=""> then skip_ws</font></div><div class=""><font face="Courier" class=""> else []</font></div><div class=""><font face="Courier" class=""> ).</font></div><div class=""><br class=""></div><div class="">Nice work though!</div><div><br class=""><blockquote type="cite" class=""><div class="">On 8 May 2021, at 16:54, Volker Wysk <<a href="mailto:post@volker-wysk.de" class="">post@volker-wysk.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Am Samstag, den 08.05.2021, 16:26 +0100 schrieb Sean Charles<br class="">(emacstheviking):<br class=""><blockquote type="cite" class=""><br class="">In the end I made it `set` like this, I don’t see why skipping whitespace should fail anyway, if it isn’t there then the next part of the calling rule can deal with it!<br class=""><br class="">:- pred skip_ws(list(char)::in, list(char)::out) is det.<br class=""><br class="">skip_ws(In, Out) :-<br class=""> trace[io(!S), run_time(env("FELT_DBG"))]<br class=""> (io.format("skip_ws: ",[],!S),<br class=""> io.print_line(In,!S)<br class=""> ),<br class=""> ( if [C|Cs] = In then<br class=""> ( list.member(C, [' ', '\t']) -><br class=""> skip_ws(Cs, Out)<br class=""> ;<br class=""> Out =In<br class=""> )<br class=""> else<br class=""> Out = In<br class=""> ).<br class=""></blockquote><br class="">This could be written like this:<br class=""><br class="">:- pred skip_ws(list(char)::in, list(char)::out) is det.<br class="">skip_ws --><br class=""> ( if ([' '] ; ['\t'])<br class=""> then skip_ws<br class=""> else { true }<br class=""> ).<br class=""><br class=""><br class="">Cheers,Volker<br class=""></div></div></blockquote></div><br class=""></div></body></html>