Skip to content

Question about AST formats in the Racket book section 1.2 #175

Open
@siadat

Description

@siadat

Thanks for this great book. Just started reading the Racket book and I had a question regarding Section 1.2 (page 4). The AST examples are written in a format that is similar to the BNF grammar, and are not Racket code. Is that intentional?

For example, the AST for negative 8 is represented as this:

(Prim '- ((Int 8)))

The equivalent Racket code would be

(Prim '- (list (Int 8)))

I'm learning Racket at the same time, and I was wondering why we don't use Racket to represent the AST. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions