Skip to content

Commit

Permalink
tutorial fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelballantyne committed Feb 16, 2025
1 parent 091b18b commit c80b084
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scribblings/tutorial/basic-tutorial.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Our initial specification with @racket[syntax-spec] supplies the grammar:
@codeblock|{
#lang racket

(require syntax-spec)
(require syntax-spec (for-syntax syntax/parse racket/list))

(syntax-spec
(host-interface/expression
(machine #:initial initial-state:id s:state-spec ...)
Expand Down Expand Up @@ -373,8 +373,6 @@ Now Let's start to write the compiler:
#'(compile-machine initial-state s ...))
...)

(require (for-syntax syntax/parse racket/list))

(define-syntax compile-machine
(syntax-parser
#:datum-literals (machine state on-enter)
Expand Down Expand Up @@ -498,7 +496,7 @@ In our language's compiler, we can use symbol set to raise an error when a state
(error 'machine "Inaccessible state: ~a" (syntax->datum (state-spec-name state-spec)))))

(define (get-accessible-states initial-state-id state-specs)
(define-local-symbol-set accessible-states)
(define accessible-states (local-symbol-set))
(define (find-state-spec state-name)
(findf (lambda (state-spec)
(compiled-identifier=? state-name (state-spec-name state-spec)))
Expand Down

0 comments on commit c80b084

Please sign in to comment.