{"size": 1558, "ext": "scrbl", "max_stars_repo_path": "displaylns/displaylns.scrbl", "max_stars_repo_name": "bennn/syntax-parse-example", "max_stars_repo_stars_event_min_datetime": "2017-05-18T22:15:56.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-17T13:13:05.000Z", "max_issues_repo_path": "displaylns/displaylns.scrbl", "max_issues_repo_name": "bennn/syntax-parse-example", "max_issues_repo_issues_event_min_datetime": "2017-05-18T22:54:53.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-19T02:58:50.000Z", "max_forks_repo_path": "displaylns/displaylns.scrbl", "max_forks_repo_name": "bennn/syntax-parse-example", "max_forks_repo_forks_event_min_datetime": "2017-05-19T14:27:57.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-30T09:36:54.000Z"}
{"max_stars_count": 22, "max_issues_count": 20, "max_forks_count": 6, "avg_line_length": 33.1489361702, "max_line_length": 113, "alphanum_fraction": 0.6861360719}
#lang syntax-parse-example
@require[
  (for-label racket/base syntax/parse syntax/parse/define syntax-parse-example/displaylns/displaylns)]

@(define displaylns-eval
   (make-base-eval '(require syntax-parse-example/displaylns/displaylns) '(define a-port (current-output-port))))

@title{@tt{displaylns}}

@; =============================================================================

@defmodule[syntax-parse-example/displaylns/displaylns]{}
@stxbee2021["Lazerbeak12345" 2]

@defform[(displayln* expr ...)]{
  This macro is intended to make debugging easier by allowing a programmer to
  print a batch of values all in one go much like Python's
  @hyperlink["https://docs.python.org/3/library/functions.html#print" "print"].

  To change the output port use @racket[parameterize].

  @examples[#:eval displaylns-eval
    (displayln* 1 2 3 4 5 '(this is a list of datums 1 2 3 "hi"))
    (parameterize ([current-output-port a-port])
      (displayln* 1 2 '(a b)))
  ]

  With @racket[define-syntax-parse-rule], this macro is a one-liner:

  @racketfile{displaylns.rkt}

  A function could express the same behavior.
  Furthermore, using a function instead would help reduce code size ---
  assuming the compiler does not inline every call to @racket[displayln*].
  That said, a macro has two advantages for this debugging tool:
  @itemize[
  @item{
    You can easily to hide all the debug expressions by changing the macro
    body to @racket[(void)].
  }
  @item{
    You might extend the macro to compute source locations from its arguments.
  }
  ]

}
