[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] macro systems and chicken (long)
From: |
Alaric Snell-Pym |
Subject: |
Re: [Chicken-users] macro systems and chicken (long) |
Date: |
Thu, 17 Apr 2008 17:02:23 +0100 |
On 17 Apr 2008, at 12:58 pm, Alex Shinn wrote:
(define-syntax let
(er-macro-transformer
(lambda (expr rename compare)
`((lambda ,(map car (cadr expr)) ,@(cddr expr))
,@(map cadr (cadr expr))))))
or equivalently with MATCH destructuring
(define-syntax let
(er-macro-transformer
(lambda (expr rename compare)
(match expr
((let ((var val) ...) body ...)
`((lambda ,var ,@body)
,@val))))))
could fail if the (var val) ... list were passed as a syntax
object. Though probably this would never happen in
practice.
When *will* it happen in practice? I did have the strong impression
that the input to a transformer would always be a normal s-expr. I
know that what make-syntactic-closure or the renaming function return
might be more exotic objects, but I didn't think the input s-expr
could be.
Anyway, regarding DEFINE-RECORD, I've personally been doing
prototyping in Chicken using that and then automatically
converting to DEFINE-RECORD-TYPE, simply for portability
among other Schemes. You can run the following elisp
function inside the DEFINE-RECORD form to perform the
expansion.
Can we not write a define-record as a macro on top of define-record-
type? I've not used define-record-type much (it seems a bit
overcomplex) so I'm not sure if there's some fundamental
incompatability...
ABS
--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4
- Re: [Chicken-users] macro systems and chicken (long), (continued)
- Re: [Chicken-users] macro systems and chicken (long), felix winkelmann, 2008/04/08
- Re: [Chicken-users] macro systems and chicken (long), Alaric Snell-Pym, 2008/04/08
- Re: [Chicken-users] macro systems and chicken (long), Alaric Snell-Pym, 2008/04/08
- Re: [Chicken-users] macro systems and chicken (long), felix winkelmann, 2008/04/09
- Re: [Chicken-users] macro systems and chicken (long), Alaric Snell-Pym, 2008/04/12
- Re: [Chicken-users] macro systems and chicken (long), Graham Fawcett, 2008/04/07
- Re: [Chicken-users] macro systems and chicken (long), felix winkelmann, 2008/04/08
- Re: [Chicken-users] macro systems and chicken (long), Alaric Snell-Pym, 2008/04/08
- Re: [Chicken-users] macro systems and chicken (long), felix winkelmann, 2008/04/09
- Re: [Chicken-users] macro systems and chicken (long), Alex Shinn, 2008/04/17
- Re: [Chicken-users] macro systems and chicken (long),
Alaric Snell-Pym <=
- Re: [Chicken-users] macro systems and chicken (long), Alex Shinn, 2008/04/17
- Re: [Chicken-users] macro systems and chicken (long), Alaric Snell-Pym, 2008/04/18
Re: [Chicken-users] macro systems and chicken (long), John Cowan, 2008/04/06
Re: [Chicken-users] macro systems and chicken (long), felix winkelmann, 2008/04/07