range of usage
> patterns. Or so I thought at 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-
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 templa
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 cas
> ... 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
higher-level
> 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
`syntax-l
/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 it
; (void))
>
> The second example 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
>&
> internal-definition-context-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 Mic
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
w
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 patter
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 Ballanty
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
binding
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
`phone
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 provide
The `syntax-local-introduce` solution breaks when the macro is used from a
different module.
The datum->syntax solution may or may not have the behavior you are looking
for:
#lang racket
(module a racket
(require (for-syntax syntax/parse))
(require (for-syntax racket/syntax))
(define
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 "Co
> (module testlang racket/base
> (require typed/racket)
> (provide (all-from-out typed/racket))
> )
>
> I have no idea why the other one doesn’t though.
>
> On Jun 5, 2014, at 3:59 PM, Michael Ballantyne
> wrote:
>
>> Hey all,
>> I'd like to sw
Hey all,
I'd like to switch a module language I've created and the code written
in it to typed racket. I can't figure out how to reexport all the
typed/racket bindings like I can for normal racket, though. If I try
this in the repl:
(module testlang typed/racket (provide (all-from-out typed/racket
Hello all,
I'm implementing a module language. All modules using the language
will be using Scribble's in-source documentation. It's easy enough to
have the module language provide
(all-from-out racket/contract scribble/srcdoc)
but I haven't figured out a way to avoid having each module have the
Hello all,
I'm implementing a module language. All modules using the language
will be using Scribble's in-source documentation. It's easy enough to
have the module language provide
(all-from-out racket/contract scribble/srcdoc)
but I haven't figured out a way to avoid having each module have the
20 matches
Mail list logo