<div dir="ltr">Loic: what's wrong is you can't xref it, AFAIK.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div><br></div><div>Cheers,</div><div>-- </div><div>Pierre Fenoll</div></div><div><br></div></div></div></div>
<br><div class="gmail_quote">On 10 July 2015 at 01:15, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/10/2015 07:17 AM, Pierre Fenoll wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A pipe operator would turn this structure-specific code into something<br>
more readable and editable too.<br>
Maybe like something like this:<br>
<br>
NewContext = Context<br>
|> cb_context:set_doc(_, [])<br>
|> cb_context:set_resp_status(_, success)<br>
|> cb_context:set_resp_data(_, [])<br>
|> cb_context:set_resp_etag(_, undefined)<br>
<br>
Where m:f(_, A2) is fun (_1) -> m:f(_1, A2) end; thus redefining _ for<br>
pipes (in non-matching contexts…).<br>
</blockquote>
<br></span>
What's wrong with this?<br>
<br>
NewContext = cb_context:set(#{doc=>[], resp_status=success...}, Context)<br>
<br>
Has less repetition/verbosity, is most likely faster, already works today, and you can also use a proplist if you're a map hater.<div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
Author of The Erlanger Playbook,<br>
A book about software development using Erlang<br>
</div></div></blockquote></div><br></div>