这是indexloc提供的服务,不要输入任何密码
Skip to content

Resyntax testing #1313

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

Closed
wants to merge 1 commit into from
Closed

Resyntax testing #1313

wants to merge 1 commit into from

Conversation

jackfirth
Copy link
Contributor

Another test pull request to get Resyntax to behave correctly. Ignore this.

Another test pull request to get Resyntax to behave correctly. Ignore this.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 1 file in this pull request and has added suggestions.

Comment on lines +77 to +79
(define (foo)
(let ([x 1])
(+ x x)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Suggested change
(define (foo)
(let ([x 1])
(+ x x)))
(define (foo)
(define x 1)
(+ x x))
Debugging details
Textual replacement
(line-replacement
  #:new-lines '#("(define (foo)" "  (define x 1)" "  (+ x x))")
  #:original-lines '#("(define (foo)" "  (let ([x 1])" "    (+ x x)))")
  #:start-line 77)
Syntactic replacement
(syntax-replacement
  #:introduction-scope #<procedure:do-make-syntax-introducer>
  #:new-syntax
    #<syntax:/home/runner/.local/share/racket/snapshot/pkgs/resyntax/default-recommendations/let-binding-suggestions.rkt:45:3 (define (foo) NEWLINE (define x 1) NEWLINE (+ x x))>
  #:original-syntax
    #<syntax:typed-racket-lib/typed-racket/private/type-contract.rkt:77:0 (define (foo) (let ((x 1)) (+ x x)))>)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resyntax analyzed 1 file in this pull request and has added suggestions.

Comment on lines +77 to +79
(define (foo)
(let ([x 1])
(+ x x)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let-to-define: Internal definitions are recommended instead of let expressions, to reduce nesting.

Suggested change
(define (foo)
(let ([x 1])
(+ x x)))
(define (foo)
(define x 1)
(+ x x))
Debugging details
Textual replacement
(line-replacement
  #:new-lines '#("(define (foo)" "  (define x 1)" "  (+ x x))")
  #:original-lines '#("(define (foo)" "  (let ([x 1])" "    (+ x x)))")
  #:start-line 77)
Syntactic replacement
(syntax-replacement
  #:introduction-scope #<procedure:do-make-syntax-introducer>
  #:new-syntax
    #<syntax:/home/runner/.local/share/racket/snapshot/pkgs/resyntax/default-recommendations/let-binding-suggestions.rkt:45:3 (define (foo) NEWLINE (define x 1) NEWLINE (+ x x))>
  #:original-syntax
    #<syntax:typed-racket-lib/typed-racket/private/type-contract.rkt:77:0 (define (foo) (let ((x 1)) (+ x x)))>)

@jackfirth
Copy link
Contributor Author

It works! Closing this now.

@jackfirth jackfirth closed this Feb 23, 2023
@racket-discourse-github-bot

This pull request has been mentioned on Racket Discussions. There might be relevant details there:

https://racket.discourse.group/t/rfc-adding-resyntax-code-reviews-to-core-racket-repositories/1746/4

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

Successfully merging this pull request may close these issues.

2 participants