On Tue, Jan 8, 2019 at 4:35 PM Jens Axel Søgaard <jensa...@soegaard.net> wrote:
>
> Den tir. 8. jan. 2019 kl. 21.40 skrev David Storrs <david.sto...@gmail.com>:
>>
>>
>> This.  In an ideal world, before/after/around would be parameterized so that 
>> you can make the change only for a defined scope.
>>
>> Still, the intent was never that it would extend its effects outside the 
>> current module.
>
> In that case you can use let-syntax and to redefine #%app.

If we're talking module scope, there's (require (rename-in racket/base
[+ rkt:+])), then define + as you prefer, using rkt:+ or not as you
like.

If we're talking local scope, there's local-require. Or simply (let
([+ my-plus]) (+ 1 2 3)).

Both are syntactically apparent. (The first is more apparent when the
require is at the top and the module isn't too long.) In terms of
cognitive load, it's just roses by other names.


If we're talking dynamic scope, then it sounds like generics / classes
/ passing a function as an argument, are likely to be better than
"monkey-patching" or "advising". That kind of stuff has its place for
emergency hot-fixes or endless mutable balls of end-user mud like
Emacs. But it's refreshingly sane not to have it as part of the
language or package ecosystem, I think?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to