<div dir="ltr"><br><p>Can Pid be maps key ?</p>
<p>Build maps from #{} syntax, The error says Pid can not be key.</p>
<p>Bug build with maps module, Pid can be key.</p>
<pre><code><span>18</span><span>>
</span><span>18</span><span>> </span><span>Pid</span><span> = self()</span><span>.</span><span>
<</span><span>0.39</span><span>.</span><span>0</span><span>>
</span><span>19</span><span>> #{</span><span>Pid</span><span> => </span><span>1</span><span>}</span><span>.</span><span>
* </span><span>1</span><span>: illegal use </span><span>of</span><span> variable </span><span>'Pid'</span><span> </span><span>in</span><span> map
</span><span>20</span><span>>
</span><span>20</span><span>> </span><span>M1</span><span> = maps:from_list([{</span><span>Pid</span><span>,</span><span> </span><span>1</span><span>}])</span><span>.</span><span>
#{<</span><span>0.39</span><span>.</span><span>0</span><span>> => </span><span>1</span><span>}
</span><span>21</span><span>>
</span><span>21</span><span>> #{</span><span>Pid</span><span> := </span><span>V</span><span>} = </span><span>M1</span><span>.</span><span>
* </span><span>2</span><span>: illegal use </span><span>of</span><span> variable </span><span>'Pid'</span><span> </span><span>in</span><span> map
</span><span>22</span><span>>
</span><span>22</span><span>> maps:get(</span><span>Pid</span><span>,</span><span> </span><span>M1</span><span>)</span><span>.</span><span>
</span><span>1</span></code></pre><br><br><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">My GitHub<br><a href="https://github.com/yueyoum" target="_blank">https://github.com/yueyoum</a><br><br></div></div>
</div>