redex
redex copied to clipboard
[RFC] merge [some|all] of unstable/gui/redex into redex
I personally constantly use the following definitions from unstable/gui/redex when using redex:
binary-rw
prefix-rw
postfix-rw
function-rw
constant-rw
bracket-rw
set-cons-rw
Is there any desire to merge some/all of unstable/gui/redex
into redex
proper? Or is there a different approach that should be used towards making better high-level abstractions that aid in rewriting?
I like the api of all of those.
Do they actually work when there are multiple lines involved? I think getting that right is tricky, so if there is any doubt at all, I'd prefer a dynamic check that raises an error when the arguments span multiple lines (and then, in a separate pass, we can work out what to do and what new keyword arguments should be added to help control the options in those cases)
Oops -- I left off splice-rw
which is also a simple/useful one IMHO.
Through some quick experimentation (i.e. I haven't checked the code) I did not seem to get any errors with multi-line input on any of those forms (but for a few, not raising an error seemed like the expected behavior to me):
Do the following error on multi-line input?
-------------------------------------------
binary-rw - no
prefix-rw - no (okay?)
postfix-rw - no
function-rw - no (okay?)
constant-rw - no (okay?)
bracket-rw - no (okay?)
set-cons-rw - no
splice-rw - no
No, that's not what I'm saying. I'm not saying that they will raise errors. I'm saying that there is no one-best right behavior for multi-line inputs and so I would prefer to not be constrained with backward-incompatible changes that fix these functions.
As for splice-rw
, that one seems strange. I do not understand what the docs mean.
I see -- that makes sense.
splice-rw
drops the leading symbol and the parens from the form, e.g. if could be used to typeset (typeof Γ ⊢ e : τ)
as Γ ⊢ e : τ
It replaces them with ""
?
Um... I could be mistaken but it looks to me like it literally just drops them from the lw
:
(define (splice-rw)
(compound-rw 'splice-rw
(lambda (lws)
(drop-right (drop lws 2) 1))))
(that code from here)
Oh, that's just wrong, then.