nicholasbs/statemachines — comment on commit 4fc7e8d6e8b7414c8f30a2ad7f2a4be01f049fec
File: pda.ss line 15
By apgwoz:

It may not exists in the Neil's SICP language, as they don't use (that I can remember) a construct like that in SICP. What they typically do is create structures much like you are doing, but include a tag at the front, to identify it. So, `(define (make-pda ss as ts) (list 'pda ss as ts))` and then define individual functions like you did to access pieces of the list. I should note that your functions can be simplified to `(define pda-start-state car)` as they do nothing more than call a procedure on the only argument passed--but in reality, you'd probably want to do:

(define (pda-start-state pda)
(if (pda? pda) (car pda) (error "not a pda")))

Or indicate failure in some other way.