# Exception and sats file

**URL:** <https://discourse.ats-lang.org/t/exception-and-sats-file/152>\
**Category:** Google Group\
**Created:** [August 10, 2016, 2:09pm UTC](https://discourse.ats-lang.org/t/exception-and-sats-file/152 "2016-08-10T14:09:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![steinwaywhw](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/steinwaywhw/32/2_2.png) [@steinwaywhw](https://discourse.ats-lang.org/u/steinwaywhw)\
**Post date:** [August 10, 2016, 2:09pm UTC](https://discourse.ats-lang.org/t/exception-and-sats-file/152/1 "2016-08-10T14:09:05Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [August 10, 2016, 2:14pm UTC](https://discourse.ats-lang.org/t/exception-and-sats-file/152/2 "2016-08-10T14:14:41Z")

</div>

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,
