<div dir="ltr">Hi<div><br></div><div>I needed to have a computed GO in one of my developments</div><div>I could not use tagbody so I developed a macro using</div><div>nfunctions and replace go by a funcall</div><div><br></div>
<div>in order to improve performance I use (return-from block (funcall f))</div><div><br></div><div>where all nfunctions have the form (lambda () (block name body))</div><div><br></div><div>I was hoping that the compiler will replace (return-from name (funcall f))</div>
<div>as a simple jump but this was not the case</div><div><br></div><div>Even though I found a simple implementation using tagbody</div><div>I would like to know why the compiler do not consider</div><div> (return-from block (funcall f)) as a simple jump</div>
<div><br></div><div>With the simple implementation using tagbody, as fast as the tagbody,</div><div> I can do the following:</div><div><br></div><div><div>(defun bar ()</div><div> (let ((tags '(h e l l o end))</div><div>
(n 0))</div><div> (tagblock nil</div><div> start (incf n) (goto (pop tags))</div><div> end (return-from nil n)</div><div> h (princ 'h) (go start)</div><div> e (princ 'e) (go start)</div>
<div> l (princ 'l) (go start)</div><div> o (princ 'o) (go start)</div><div> )))</div></div><div><br></div><div>as you can see (goto expr) will compute expr and the (go <result of expr>)</div>
<div><br></div><div>Kind regards</div><div>Taoufik</div><div><br></div><div><br></div><div><br></div><div><br></div></div>