Hmm, perhaps this would be easier to define the problem if I were to share
the code for where this has to go.
Currently, my struct system looks like this:
https://github.com/jarcane/heresy/blob/master/lib/things.rkt
Now, as it stands this works quite well as an opaque data structure, but
they can
Or you don’t even need a syntax-parameter:
#lang racket
(require (for-syntax syntax/parse))
(define-syntax letexpand
(syntax-parser
[(_ alst body ...)
(with-syntax ([alst (syntax-local-introduce #`#,(syntax-local-value
#'alst))])
#'(let alst body ...))]))
(define (foo)
(define-synt
#lang racket
(require (for-syntax syntax/parse) racket/stxparam)
(define-syntax letexpand
(syntax-parser
[(_ alst body ...)
(with-syntax ([alst (syntax-local-introduce #`#,(syntax-parameter-value
#'alst))])
#'(let alst body ...))]))
(define (foo)
(define-syntax-parameter dave
Hmm. That does appear to work at a global level, but then when you attempt
to use it inside of a function it returns "identifier used out of context".
Trying to define-for-syntax in a local context also causes problems;
"begin-for-syntax: not in a definition context in: (begin-for-syntax
(define-va
Would something like this work for what you want?
#lang racket
(require (for-syntax syntax/parse))
(define-for-syntax dave '((is 5) (fat 6)))
(define-syntax letexpand
(syntax-parser
[(_ alst body ...)
(with-syntax ([alst (syntax-local-introduce #`#,(eval-syntax #'alst))])
#'(let
I've been experimenting with a new feature for Heresy, and I find myself in
need of a macro that can insert the contents of an a-list into a let syntax
to serve as its definitions. I am utterly failing to accomplish this. It
seems like it should be simple enough to splice a variable's contents into
6 matches
Mail list logo