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

Test Resyntax reviews again #135

Closed
wants to merge 1 commit into from
Closed

Test Resyntax reviews again #135

wants to merge 1 commit into from

Conversation

jackfirth
Copy link
Owner

No description provided.

Copy link
Contributor

@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 +29 to +31
(let ([path (make-temporary-file "rkttmp~a" #f parent-dir)])
(display-to-file contents path #:mode 'text #:exists 'truncate)
path))
Copy link
Contributor

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
(let ([path (make-temporary-file "rkttmp~a" #f parent-dir)])
(display-to-file contents path #:mode 'text #:exists 'truncate)
path))
(define path (make-temporary-file "rkttmp~a" #f parent-dir))
(display-to-file contents path #:mode 'text #:exists 'truncate)
path)
Debugging details
Textual replacement
(line-replacement
  #:new-lines
    '#("    (define path (make-temporary-file \"rkttmp~a\" #f parent-dir))"
       "    (display-to-file contents path #:mode 'text #:exists 'truncate)"
       "    path)")
  #:original-lines
    '#("    (let ([path (make-temporary-file \"rkttmp~a\" #f parent-dir)])"
       "      (display-to-file contents path #:mode 'text #:exists 'truncate)"
       "      path))")
  #:start-line 29)
Syntactic replacement
(syntax-replacement
  #:introduction-scope #<procedure:do-make-syntax-introducer>
  #:new-syntax
    #<syntax:.../resyntax/base.rkt:171:28 (define (create) (define path (make-temporary-file "rkttmp~a" #f parent-dir)) (display-to-file contents path #:mode (quote text) #:exists (quote truncate)) path)>
  #:original-syntax
    #<syntax:disposable/file.rkt:28:2 (define (create) (let ((path (make-temporary-file "rkttmp~a" #f parent-dir))) (display-to-file contents path #:mode (quote text) #:exists (quote truncate)) path))>
  #:source
    (file-source
     #<path:/home/runner/work/racket-disposable/racket-disposable/disposable/file.rkt>))

@jackfirth jackfirth closed this Sep 19, 2024
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.

1 participant