Created
June 12, 2013 11:16
-
-
Save soegaard/5764462 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require (for-syntax racket/list)) | |
(define-syntax (foo stx) | |
(define (quote-it stx) (list 'quote stx)) | |
(define name+xs (syntax->list stx)) | |
(define name (first name+xs)) ; unused (is foo) | |
(define xs (rest name+xs)) | |
(define result-as-list (cons 'vector (map quote-it xs))) | |
(datum->syntax stx result-as-list)) | |
(foo x y z) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lang racket
(require (for-syntax racket/list))
(define-syntax (regs stx)
(define (quote-it stx) (list 'quote stx))
(define args (rest (syntax->list stx)))
(datum->syntax stx `(vector ,@(map quote-it args))))
(regs x y z)