HTDP question

32 views
Skip to first unread message

Дмитрий

unread,
Aug 4, 2019, 8:41:42 AM8/4/19
to Racket Users
Hello.

I'm reading HTDP, and not understand one data definition in the chapter 22.3:

; An XMachine is a nested list of this shape:
; `(machine ((initial ,FSM-State)) [List-of X1T])

; An X1T is a nested list of this shape:
; `
(action ((state ,FSM-State) (next ,FSM-State)))

With this definition of XMachine you can't received result like in constant definition xm0 above in this chapter:

(define xm0
'(machine ((initial "red"))
    (action ((state "red") (next "green")))
    (action ((state "green") (next "yellow")))
    (action ((state "yellow") (next "red")))))


I think it will be right to define XMachine like this:

; An XMachine is a nested list of this shape:
; `(machine ((initial ,FSM-State)) ,@[List-of X1T])


Am I wrong?



Reply all
Reply to author
Forward
0 new messages