albrow / fo

An experimental language which adds functional programming features to Go.
Other
1.24k stars 34 forks source link

Tiny fix in docs #16

Closed chriswessels closed 6 years ago

albrow commented 6 years ago

This is not a mistake. I used the same EBNF notation as in the Go Spec. The square brackets represent options. That is, the expression inside the brackets can appear 0 or 1 times.

For example, consider the Fo grammar for a type declaration:

TypeDecl = "type" identifier [ TypeParams ] Type .

It is perfectly valid in Fo to have a type declaration without type parameters, so TypeParams is optional here.

I'll admit that I'm not super familiar with the notation and it's possible I made a mistake somewhere. I just don't think this is one.