{"size": 1142, "ext": "scrbl", "max_stars_repo_path": "fnarg/fnarg.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": "fnarg/fnarg.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": "fnarg/fnarg.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": 35.6875, "max_line_length": 80, "alphanum_fraction": 0.738178634}
#lang syntax-parse-example
@require[
  (for-label racket/base syntax/parse syntax-parse-example/fnarg/fnarg)]

@title{Function Parameter Syntax Class}
@stxbee2021["shhyou" 23]

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

@defmodule[syntax-parse-example/fnarg/fnarg]{}

Syntax classes offer a powerful mechanism for abstracting over classes of
conceptually related patterns. Moreover, syntax classes can be parameterized,
with @racket[expr/c] being one prominent example.

In this example, we define a syntax class that roughly captures the grammar of
formal parameters in function headers. It parses the name of the formal
parameter, the default expressions of optional arguments and the keywords of
keyworded arguments.

@defidform[fnarg]{
  The @racket[fnarg] syntax class matches the basic argument patterns that
  can appear in function headers: mandatory, optional, and keyword arguments.
  The class optionally accepts two parameters to toggle whether optional and/or
  keyword arguments are allowed.

  Refer to the source file @tt{fnarg-test.rkt} for an example use.

  @racketfile{fnarg.rkt}

}
