Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrRacket Quickscript of the day #33

Closed
spdegabrielle opened this issue Feb 27, 2021 · 8 comments
Closed

DrRacket Quickscript of the day #33

spdegabrielle opened this issue Feb 27, 2021 · 8 comments

Comments

@spdegabrielle
Copy link
Contributor

spdegabrielle commented Feb 27, 2021

DrRacket Quickscript of the day

Don't wait for Jack Firth’s resyntax, fix your #t and #f today!

(resyntax is an experimental refactoring tool built on top of syntax-parse.)

#lang racket/base
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;;;          [MIT license](http://opensource.org/licenses/MIT) at your option.
(require quickscript)
(script-help-string
 "Replaces all occurrences of #t and #f with #true and #false in the selected text (warning: in strings too!)")
(define-script fix-true-false
  #:label "fix-true-false"
  (λ (selection)
    (regexp-replaces selection '([#px"#t\\b" "#true"] [#px"#f\\b" "#false"]))))

Quickscript is included in DrRacket, and scripts are managed by the Script menu. See the documentation at https://docs.racket-lang.org/quickscript/

Stephen De Gabrielle

@spdegabrielle
Copy link
Contributor Author

FYI @jackfirth & @Metaxal

@spdegabrielle
Copy link
Contributor Author

spdegabrielle commented Mar 1, 2021

@pmatos can the code appear in racket news?
The intention is this is a separate ‘article’ in RN.

@pmatos
Copy link
Owner

pmatos commented Mar 2, 2021

Sure - lets try this as a different article this week. :)

@pmatos
Copy link
Owner

pmatos commented Mar 2, 2021

My biggest concern is generally, how long we can keep it up. As in, how many different quickscripts are there? :)

@pmatos pmatos closed this as completed Mar 2, 2021
@spdegabrielle
Copy link
Contributor Author

spdegabrielle commented Mar 2, 2021 via email

@pmatos
Copy link
Owner

pmatos commented Mar 2, 2021

OK - lets give it a go.

@Metaxal
Copy link

Metaxal commented Mar 2, 2021

Can you add the following line after the script, if possible:

If you have installed the url2script quickscript, you can use it to install the script above with this link.

If this is a recurrent thing, this line above will appear each time. (url2script eases installation and update of the scripts)

@Metaxal
Copy link

Metaxal commented Mar 2, 2021

But don't bother if that makes RN too bulky because of that, of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants