[racket-users] Re: [racket] Unsafe version of require/typed?

2015-05-01 Thread Michael Ballantyne
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

[racket-users] Re: how do you read, manipulate, debug scope sets?

2019-05-07 Thread Michael Ballantyne
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

[racket-users] Re: Splicing the result of one macro into another

2019-08-22 Thread Michael Ballantyne
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

[racket-users] Re: embedding a DSL into racket code

2019-09-28 Thread Michael Ballantyne
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

Re: [racket-users] Re: embedding a DSL into racket code

2019-09-28 Thread Michael Ballantyne
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

Re: [racket-users] Re: Macro behaves differently when run from different modules

2019-09-30 Thread Michael Ballantyne
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

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Michael Ballantyne
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 >> >>

[racket-users] Re: identifier used out of context

2020-06-06 Thread Michael Ballantyne
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

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Michael Ballantyne
/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

Re: [racket-users] Re: identifier used out of context

2020-06-07 Thread Michael Ballantyne
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: &

Re: [racket-users] require and syntax-case

2020-07-14 Thread Michael Ballantyne
> 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