Next: , Previous: , Up: Formal syntax   [Index]


7.1.6 Programs and definitions

⟨program⟩ → ⟨import declaration⟩+ ⟨command or definition⟩+

⟨command or definition⟩ → ⟨command⟩ | ⟨definition⟩ | (begin ⟨command or definition⟩+)

⟨definition⟩ → (define ⟨identifier⟩ ⟨expression⟩)
  | (define (⟨identifier⟩ ⟨def formals⟩) ⟨body⟩)
  | ⟨syntax definition⟩
  | (define-values ⟨formals⟩ ⟨body⟩)
  | (define-record-type ⟨identifier⟩ ⟨constructor⟩ ⟨identifier⟩ ⟨field spec⟩*)
  | (begin ⟨definition⟩*)

⟨def formals⟩ → ⟨identifier⟩* | ⟨identifier⟩* . ⟨identifier⟩

⟨constructor⟩ → (⟨identifier⟩ ⟨field name⟩*)

⟨field spec⟩ → (⟨field name⟩ ⟨accessor⟩) | (⟨field name⟩ ⟨accessor⟩ ⟨mutator⟩)

⟨field name⟩ → ⟨identifier⟩

⟨accessor⟩ → ⟨identifier⟩

⟨mutator⟩ → ⟨identifier⟩

⟨syntax definition⟩ → (define-syntax ⟨keyword⟩ ⟨transformer spec⟩)