Re: [racket] Splicing a variable to serve as let declarations

2014-12-11 Thread J Arcane
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

Re: [racket] Splicing a variable to serve as let declarations

2014-12-11 Thread Alexander D. Knauth
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

Re: [racket] Splicing a variable to serve as let declarations

2014-12-11 Thread Roman Klochkov
#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

Re: [racket] Splicing a variable to serve as let declarations

2014-12-08 Thread J Arcane
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

Re: [racket] Splicing a variable to serve as let declarations

2014-12-08 Thread Alexander D. Knauth
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

[racket] Splicing a variable to serve as let declarations

2014-12-07 Thread J Arcane
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