1

in SML, is a declaration (val-declaration, type declaration, ...)

  • an expression
  • a statement which, if I am correct, is defined as an expression with side effect
  • or something else?

Thanks.

Tim
  • 1
  • 141
  • 372
  • 590
  • [This formal grammar](https://people.mpi-sws.org/~rossberg/sml.html) has its own top-level entry for declarations. `dec` by itself is not an instance of `exp`. Andreas Rossberg wrote that and is active on this tag, perhaps he could give a definitive answer. – John Coleman May 01 '20 at 20:44

1 Answers1

2

A declaration is just that, a declaration, its own syntactic class. The only way to embed into an expression is via the expression form let dec in exp end.

Technically, there are no statements in ML.

Andreas Rossberg
  • 34,518
  • 3
  • 61
  • 72