[Openmcl-devel] macro-characters ? x:foo => (tag foo x)
Ron Garret
ron at flownet.com
Sat Jul 28 08:36:33 PDT 2018
Yeah, doing this with a reader macro is a bad idea. But you can do it with a regular macro via something like:
`(tag ,(intern (package-name (symbol-package the-symbol)) the-current-package) ,(intern (symbol-name (the-symbol)) the-current-package))
rg
On Jul 28, 2018, at 4:54 AM, Bill St. Clair <wws at clozure.com> wrote:
> As far as I know, you can’t do that. I would also recommend against redefining the package prefix separator.
>
> On Sat, Jul 28, 2018 at 7:45 AM Taoufik Dachraoui <dachraoui.taoufik at gmail.com> wrote:
> Hi,
>
> I would like to be able to transform x:foo to (tag foo x)
>
> if I define a macro-character for : how can I access the symbol
> read just before :
>
> Example of usage:
>
> (fn (x:foo) (+ x 1)) => (fn ((tag foo x)) (+ x 1))
> ((fn (x:list) (car x)) body:list) => ((fn ((tag list x)) (car x)) (tag list body))
>
> Thanks for your help
>
> Taoufik
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20180728/54c11d45/attachment.htm>
More information about the Openmcl-devel
mailing list