exception and sats file

16 views
Skip to first unread message

Steinway Wu

unread,
Aug 10, 2016, 10:09:05 AM8/10/16
to ats-lang-users
Hi, 

When I define an exception in SATS file `exn.sats`, I need to compile it like `patscc *.dats exn.sats` to have the symbol defined. However, when I define a normal datatype in some sats file, I usually can compile it by indicating only those DATS files, like `patscc *.dats`. Why are they different?

Thanks,

gmhwxi

unread,
Aug 10, 2016, 10:14:41 AM8/10/16
to ats-lang-users

Exception can be seen as an extensible datatype.
The tag attached to each exception constructor is chosen
at run-time (during initialization phase). When you compile
exn.sats, some sort of initialization function is generated.

The tag attached to each constructor associated with a datatype
is chosen at compile-time. So there is no need for the aforementioned
initialization.
Reply all
Reply to author
Forward
0 new messages