[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile: What's wrong with this?
From: |
Mark H Weaver |
Subject: |
Re: Guile: What's wrong with this? |
Date: |
Wed, 04 Jan 2012 23:24:45 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
I wrote:
> (define-syntax define
> (lambda (x)
> (with-syntax ((orig-define #'(@ (guile) define)))
> (syntax-case x ()
> ((_ (proc arg ...) e0 e1 ...)
> #'(orig-define proc (lambda (arg ...) e0 e1 ...)))
> ((_ v e)
> (identifier? #'v)
> (if (string? (syntax->datum #'e))
> #'(orig-define v (string-copy e))
> #'(orig-define v e)))))))
In case you're planning to use this, I just realized that this syntax
definition has a flaw: it won't handle cases like this:
(define (map f . xs) ...)
To fix this flaw, change the two lines after syntax-case to:
> ((_ (proc . args) e0 e1 ...)
> #'(orig-define proc (lambda args e0 e1 ...)))
The other macro I provided has the same flaw, and the same fix applies.
Mark
- Re: Fixed string corruption bugs, (continued)
- Re: Fixed string corruption bugs, Andy Wingo, 2012/01/07
- Re: Guile: What's wrong with this?, Mark H Weaver, 2012/01/04
- Re: Guile: What's wrong with this?, Andy Wingo, 2012/01/04
- Re: Guile: What's wrong with this?, Mark H Weaver, 2012/01/04
- Re: Guile: What's wrong with this?, Andy Wingo, 2012/01/04
- Re: Guile: What's wrong with this?, Bruce Korb, 2012/01/04
- Re: Guile: What's wrong with this?, David Kastrup, 2012/01/04
- Re: Guile: What's wrong with this?, Andy Wingo, 2012/01/04
- Re: Guile: What's wrong with this?, Bruce Korb, 2012/01/04
- Re: Guile: What's wrong with this?, Mark H Weaver, 2012/01/04
- Re: Guile: What's wrong with this?,
Mark H Weaver <=
- Re: Guile: What's wrong with this?, Ludovic Courtès, 2012/01/04