Frank,<div><br></div><div>   is this close enough?</div><div><br></div><div>[:a :block :with :args|] decompile arguments collect: [:ea| ea key] #(&#39;a&#39; &#39;block&#39; &#39;with&#39; &#39;args&#39;)</div><div><br></div>
<div>Not symbols, but strings.<br><br><div class="gmail_quote">On Mon, May 21, 2012 at 2:27 PM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 21 May 2012 22:00, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>

&gt; On 21.05.2012, at 22:47, Frank Shearar wrote:<br>
&gt;<br>
&gt;&gt; Without having to decompile a block, how may I find the names of a<br>
&gt;&gt; block&#39;s arguments?<br>
&gt;&gt;<br>
&gt;&gt; In other words, given<br>
&gt;&gt;<br>
&gt;&gt;     [:a :b :c | &quot;stuff&quot;]<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d like to extract #(a b c).<br>
&gt;&gt;<br>
&gt;&gt; (Failing that, I&#39;ll have to live with myBlock decompile arguments<br>
&gt;&gt; collect: [:a | a name asSymbol]).<br>
&gt;&gt;<br>
&gt;&gt; frank<br>
&gt;<br>
&gt; I don&#39;t know (I&#39;m even surprise the decompiler knows) - but can you say a little bit more for what you would need that?<br>
<br>
</div></div>Sure! I&#39;m working on a miniKanren-like logic programming<br>
language/framework. Typically in a miniKanren clone there&#39;s a macro<br>
called &quot;fresh&quot; that introduces logic variables. For instance,<br>
<br>
(fresh [x y]<br>
  (== [x y] [1 5]))<br>
<br>
introduces two logic variables called x and y, and then unifies [x y]<br>
with [1 5] to give the substitution/most general unifier x -&gt; 1, y -&gt;<br>
5.<br>
<br>
So I thought I could do something like<br>
<br>
[:x :y | {x. y} unifyWith: #(1 5)] fresh<br>
<br>
where BlockClosure &gt;&gt; #fresh currently looks like this:<br>
<br>
fresh<br>
        ^ self valueWithArguments: (self decompile arguments collect: [:a | a<br>
name asSymbol]).<br>
<br>
frank<br>
<br>
&gt; - Bert -<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>
</div>