Exception and sats file


#1

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,


#2

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.On Wednesday, August 10, 2016 at 10:09:05 AM UTC-4, Steinway Wu wrote:

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,