I found another way <div><br></div><div>(defun f (string)</div><div> (read-from-string (format nil "(function ~A)" string)))</div><div><br></div><div>I am interested to know the pros and cons of using read-from-string</div>
<div>and to compare this to your code</div><div><br></div><div>Kind regards</div><div>Taoufik</div><div><br><br><div class="gmail_quote">On Sat, Dec 4, 2010 at 8:23 AM, Stas Boukarev <span dir="ltr"><<a href="mailto:stassats@gmail.com">stassats@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Taoufik Dachraoui <<a href="mailto:dachraoui.taoufik@gmail.com">dachraoui.taoufik@gmail.com</a>> writes:<br>
<br>
> Hello<br>
><br>
><br>
> I would like to return the function object from a string<br>
><br>
> (f "+") == (function +)<br>
<br>
</div>(defun f (string)<br>
(let ((symbol (find-symbol string)))<br>
(when (fboundp symbol)<br>
(fdefinition symbol))))<br>
<font color="#888888"><br>
--<br>
With Best Regards, Stas.<br>
</font></blockquote></div><br></div>