the time, but now I'm less sure. I'll have to
> see how it plays out.
> On Monday, August 16, 2021 at 12:22:02 PM UTC-5 Michael Ballantyne wrote:
>
>> The essential primitive here seems to me to be:
>>
>> (define-syntax (splice stx)
>> (syntax-case stx ()
>>
The essential primitive here seems to me to be:
(define-syntax (splice stx)
(syntax-case stx ()
[(_ e ...)
(eval-syntax #'(begin e ...))]))
With with-quasisyntax being:
(define-syntax-rule
(with-quasisyntax ([a b] ...) template)
(splice (with-syntax ([a b] ...) (quasisyntax
Section 4.5 of Abdulaziz Ghuloum's PhD thesis is the earliest description
I've seen of an algorithm:
https://www.proquest.com/openview/f6a12fd14db7fd3ea85cfebbf72e0bc5
It also does not provide much justification.
The second example you give becomes more natural if you've considered
simpler
> ... to embed domain specific language in another. Does Racket have any
support for this?
One approach is discussed in our paper about making macro-extensible
DSLs: https://dl.acm.org/doi/abs/10.1145/3428297
Section 8 shows some examples of how extensibility is useful for layering
> There is another way: syntax-local-introduce will remove the macro scope.
`syntax-local-introduce` is no longer useful for this purpose since the
switch to the scope sets model. Other scopes, such as module scopes, will
often distinguish the macro-introduced name. For example, using
/issues/3198)
On Sunday, June 7, 2020 at 4:45:34 PM UTC-6, Sorawee Porncharoenwase wrote:
>
> Wow, so block is currently buggy?!
>
> On Sun, Jun 7, 2020 at 3:31 PM Michael Ballantyne > wrote:
>
>> Hah! You're right. The arrow points to the inner definition. But
perfectly shows why I need
> internal-definition-context-track, however. Thank you very much.
>
> On Sun, Jun 7, 2020 at 7:51 AM Michael Ballantyne > wrote:
>
>> > I am unable to come up with a program where this difference is
>> significant though
>>
>>
ext-track? Normally, internal definitions are
> expanded into letrec-syntaxes+values, so the bindings don’t actually
> disappear. So I am curious why internal-definition-context-track is
> needed.
>
> Thanks again.
>
> On Sat, Jun 6, 2020 at 8:21 AM Michael Ballantyne > wrote:
&
Explicitly expanding `e` would ensure that the expansion work only has to
happen once, rather than twice. Even so, the fully-expanded syntax will be
expanded again in `syntax-local-bind-syntaxes` and in the expansion.
As far as I've seen, the only thing that liberal define contexts control is
Two identifiers that are both unbound and have the same symbol are
considered free-identifier=?. Thus the match works when testing from
expander-utils.rkt, where both the pattern and usage are unbound. It also
works from expander-utils.rkt when you define `line` in that file, because
the
n e))]))
>
> In the docs, I however did read about `syntax-binding-set` and
> `syntax-binding-set-extend`, that apparently allow manually setting the
> bindings of a symbol. Would that be a potential solution?
>
>
> Le samedi 28 septembre 2019 16:05:57 UTC+2, Michael Bal
Yeah, the `begin` shouldn't be a problem---`define`s splice out of a begin.
And it doesn't look like you're missing the binding pass, because you are
successfully expanding to module-level `define-values` forms.
I suspect that your problem relates to the set of scopes that end up on the
Here's another implementation you might consider. In this version you can
view the body of `phone-numbers` as a language consisting of the `number`
and `number-list` syntactic forms. The language also supports its own kind
of macros---phone number macros---that can expand to forms of the
It's not an answer to your broader question, but I suspect what you
actually want here is
#+begin_src racket
;; inside syntax-parse
(datum->syntax this-syntax '<~)
#+end_src
Notice that the second argument to datum->syntax should be a symbol here,
rather than a syntax object. If you
I'm delighted to offer both. Here's a particularly pathological test case:
https://github.com/michaelballantyne/typed-racket-performance
Using a typed/racket/no-check variant of the tr-pfds package makes my
untyped code run 1275x faster. The feature-profile tool reports that
in the TR variant
15 matches
Mail list logo