{"size": 1818, "ext": "scrbl", "max_stars_repo_path": "except-in-quiet/except-in-quiet.scrbl", "max_stars_repo_name": "soegaard/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": "except-in-quiet/except-in-quiet.scrbl", "max_issues_repo_name": "soegaard/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": "except-in-quiet/except-in-quiet.scrbl", "max_forks_repo_name": "soegaard/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": 29.3225806452, "max_line_length": 92, "alphanum_fraction": 0.6721672167}
#lang syntax-parse-example
@require[
  (for-label racket/base syntax/parse syntax-parse-example/except-in-quiet/except-in-quiet)]

@(define except-in-quiet-eval
   (make-base-eval '(require syntax-parse-example/except-in-quiet/except-in-quiet)))

@title{@tt{except-in-quiet}}

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

@defmodule[syntax-parse-example/except-in-quiet/except-in-quiet]{}

@nested[#:style 'inset @emph{Thanks to Leif Andersen for the original macro.}]

Racket's @racket[except-in] form subtracts a sequence of identifiers from
a source.
If the source does not provide one of the named identifiers, then @racket[except-in]
raises a syntax error.

@examples[#:eval (make-base-eval)
(require (except-in racket/list second))
(first '(1 2 3))
(eval:error (second '(1 2 3)))
(eval:error (require (except-in racket/list snd)))]

@defform[(except-in-quiet expr ...)]{
  Similar to @racket[except-in] but does not raise an error when asked to
  subtract a missing identifier.

  @examples[#:eval except-in-quiet-eval
  (require (except-in-quiet racket/list second))
  (first '(1 2 3))
  (eval:error (second '(1 2 3)))
  (require (except-in-quiet racket/list snd))]

  The macro (or rather, @tech/reference{require transformer}) should work in four steps:

  @itemlist[#:style 'ordered
    @item{
      resolve the required expression to a module,
    }
    @item{
      find all exports from that module,
    }
    @item{
      subtract names from the export list, and
    }
    @item{
      proceed with a call to @racket[expand-import].
    }
  ]

  Steps 2 through 4 are implemented fairly well below.
  Step 1, however, is done in a very simple way.
  It works for basic paths like @tt{racket/base} but nothing more complicated.

  @racketfile{except-in-quiet.rkt}
}


