Re: [racket-users] Expanding a macro into multiple syntax objects (Defining two things with one macro)

2017-06-22 Thread Sam Waxman
Bizarre, I was for some reason very convinced that begin defined its own scope! I guess I usually called it in the positions in which it becomes an expression as opposed to being used in its special form with splicing. The macro is working like a charm now. Thanks, I thought the solution would

Re: [racket-users] Expanding a macro into multiple syntax objects (Defining two things with one macro)

2017-06-22 Thread Sam Caldwell
Are you sure that `begin` doesn't suffice for your needs? It has a somewhat unintuitive scoping behavior. From the docs [1] The begin form is special at the top level, at module level, or as a body after only internal definitions. In those positions, instead of forming an expression, the content

Re: [racket-users] Expanding a macro into multiple syntax objects (Defining two things with one macro)

2017-06-22 Thread Deren Dohoda
Hi Sam, ​I'm a little unclear on your intended use case since (begin ...) does splice defines, for instance: (define (add-something x) (begin (define one 1) (define two 2)) (+ x one two)) ;; Welcome to DrRacket, version 6.9 [3m]. Language: racket/base, with debugging; memory