[Openmcl-devel] name (string) to function

Taoufik Dachraoui dachraoui.taoufik at gmail.com
Sun Dec 5 00:11:27 PST 2010


While implementing the matching function I wanted to represent the type
as follows:   (:type x :name) and then to transform :name -> "name" ->
function

now, I am using typep as suggested by Greg

Taoufik

On Sun, Dec 5, 2010 at 6:12 AM, Robert P. Goldman <rpgoldman at sift.info>wrote:

> I don't understand.
>
> String -> function
>
> Isn't really meaningful. Don't you want
>
> String x package -> function?
>
> R
>
> On Dec 4, 2010, at 1:36, Stas Boukarev <stassats at gmail.com> wrote:
>
> > Taoufik Dachraoui <dachraoui.taoufik at gmail.com> writes:
> >
> >> I found another way
> >>
> >>
> >> (defun f (string)
> >>   (read-from-string (format nil "(function ~A)" string)))
> >>
> >> I am interested  to know the pros and cons of using read-from-string
> >> and to compare this to your code
> >>
> > read-from-string interns symbol, which may be undesirable, and it can
> > execute arbitrary code, so you need to bind *read-eval* to nil.
> >
> > --
> > With Best Regards, Stas.
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > http://clozure.com/mailman/listinfo/openmcl-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20101205/7899f146/attachment.htm>


More information about the Openmcl-devel mailing list