# Naming convention

**URL:** https://discourse.ats-lang.org/t/naming-convention/534
**Category:** Google Group
**Created:** [January 28, 2015, 1:43pm UTC](https://discourse.ats-lang.org/t/naming-convention/534 "2015-01-28T13:43:56Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Andrea\_Ferretti](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Andrea\_Ferretti](https://discourse.ats-lang.org/u/Andrea_Ferretti)
#### Post date: [January 28, 2015, 1:43pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/1 "2015-01-28T13:43:56Z")

</div>

Hello, I am trying to learn ATS following the official book, and I am  
finding some difficulties with the names chosen. For instance, a sort for  
types of variable dimension is called t@ype, the type of arrays of type T  
is arrszref[T], and the function to convert between int and size\_t is  
called g0int2uint\_int\_size.

I know it is quite a trivial matter, but I find it very difficult to follow  
the code examples without remembering these names. Is there some naming  
convention or scheme behind this?

---

<div class="post-metadata">

### Author: ![Andrea\_Ferretti](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Andrea\_Ferretti](https://discourse.ats-lang.org/u/Andrea_Ferretti)
#### Post date: [January 28, 2015, 3:17pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/2 "2015-01-28T15:17:40Z")

</div>

Thank you, this clarifies quite a bit2015-01-28 16:16 GMT+01:00 Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com):

> to clarify, [staload · githwxi/ATS-Postiats Wiki · GitHub](https://github.com/githwxi/ATS-Postiats/wiki/staload)
> 
> On Wed, Jan 28, 2015 at 10:15 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> 
> > Yes, this functionality exist through named importing (staloading). I’m  
> > not certain it would help as you’d still have to keep track of many  
> > namespaces.
> > 
> > staload UN = “predude/SATS/unsafe.sats”
> > 
> > $UN.cast(…)
> > 
> > On Wed, Jan 28, 2015 at 10:12 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> > 
> > > I am speculating, since I have not read that far: but maybe the naming  
> > > could be improved by having a module (namespacing) system? If I  
> > > understand correctly your response, the naming scheme seems to arise  
> > > to have a global naming scheme without conflicts.
> > > 
> > > Has some namespacing mechanism been proposed for ATS?
> > > 
> > > 2015-01-28 16:00 GMT+01:00 Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com):
> > > 
> > > > Also you can generally find more insight by looking int he sats file  
> > > > where  
> > > > it is defined:
> > > > 
> > > > # $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size ./prelude/SATS/CODEGEN/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t = “mac#%” ./prelude/SATS/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t
> > > > 
> > > > “mac#%”
> > > > 
> > > > On Wed, Jan 28, 2015 at 10:00 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> > > > 
> > > > > This seems to be a common problem, though I’m not sure if it is  
> > > > > totally  
> > > > > circumventable due to the wide variety of types in ATS. I hope it can  
> > > > > be  
> > > > > improved.
> > > > > 
> > > > > The first part, ‘g0’, denotes we are dealing with non-indexed types  
> > > > > (int  
> > > > > instead of int (i)).
> > > > > 
> > > > > The second part, I think, is showing the general class of type  
> > > > > conversion:  
> > > > > int 2 uint
> > > > > 
> > > > > The third part shows the actual ats types … somewhat. The latter is  
> > > > > size\_t instead of size, so this mix of highly systematic and somewhat  
> > > > > lax  
> > > > > naming is a bit disconcerting if I’m reading it right.
> > > > > 
> > > > > On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> > > > > 
> > > > > > Hello, I am trying to learn ATS following the official book, and I am  
> > > > > > finding some difficulties with the names chosen. For instance, a sort  
> > > > > > for  
> > > > > > types of variable dimension is called t@ype, the type of arrays of  
> > > > > > type T is  
> > > > > > arrszref[T], and the function to convert between int and size\_t is  
> > > > > > called  
> > > > > > g0int2uint\_int\_size.
> > > > > > 
> > > > > > I know it is quite a trivial matter, but I find it very difficult to  
> > > > > > follow the code examples without remembering these names. Is there  
> > > > > > some  
> > > > > > naming convention or scheme behind this?
> > > > > > 
> > > > > > –  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups  
> > > > > > “ats-lang-users” group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > > send an  
> > > > > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > > > To view this discussion on the web visit
> > > > > > 
> > > > > > [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com).
> > > > > 
> > > > > –  
> > > > > Brandon Barker  
> > > > > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > > > 
> > > > –  
> > > > Brandon Barker  
> > > > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > > > 
> > > > –  
> > > > You received this message because you are subscribed to a topic in the  
> > > > Google Groups “ats-lang-users” group.  
> > > > To unsubscribe from this topic, visit
> > > > 
> > > > [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe).  
> > > > To unsubscribe from this group and all its topics, send an email to  
> > > > [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > To view this discussion on the web visit
> > > > 
> > > > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com).
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups  
> > > “ats-lang-users” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com).
> > 
> > –  
> > Brandon Barker  
> > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@gmail.com)
> 
> –  
> You received this message because you are subscribed to a topic in the  
> Google Groups “ats-lang-users” group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqqN4W3weYkPofY2U9sMOo\_bTdWw\_uv5GX7vBKBrTMMGQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqqN4W3weYkPofY2U9sMOo_bTdWw_uv5GX7vBKBrTMMGQ%40mail.gmail.com).

---

<div class="post-metadata">

### Author: ![Andrea\_Ferretti](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Andrea\_Ferretti](https://discourse.ats-lang.org/u/Andrea_Ferretti)
#### Post date: [January 28, 2015, 3:12pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/3 "2015-01-28T15:12:06Z")

</div>

I am speculating, since I have not read that far: but maybe the naming  
could be improved by having a module (namespacing) system? If I  
understand correctly your response, the naming scheme seems to arise  
to have a global naming scheme without conflicts.

Has some namespacing mechanism been proposed for ATS?2015-01-28 16:00 GMT+01:00 Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com):

> Also you can generally find more insight by looking int he sats file where  
> it is defined:
> 
> $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size  
> ./prelude/SATS/CODEGEN/integer.sats:fun g0int2uint\_int\_size (x: int):\<\>  
> size\_t =  
> “mac#%”  
> ./prelude/SATS/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t =  
> “mac#%”
> 
> On Wed, Jan 28, 2015 at 10:00 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> 
> > This seems to be a common problem, though I’m not sure if it is totally  
> > circumventable due to the wide variety of types in ATS. I hope it can be  
> > improved.
> > 
> > The first part, ‘g0’, denotes we are dealing with non-indexed types (int  
> > instead of int (i)).
> > 
> > The second part, I think, is showing the general class of type conversion:  
> > int 2 uint
> > 
> > The third part shows the actual ats types … somewhat. The latter is  
> > size\_t instead of size, so this mix of highly systematic and somewhat lax  
> > naming is a bit disconcerting if I’m reading it right.
> > 
> > On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> > 
> > > Hello, I am trying to learn ATS following the official book, and I am  
> > > finding some difficulties with the names chosen. For instance, a sort for  
> > > types of variable dimension is called t@ype, the type of arrays of type T is  
> > > arrszref[T], and the function to convert between int and size\_t is called  
> > > g0int2uint\_int\_size.
> > > 
> > > I know it is quite a trivial matter, but I find it very difficult to  
> > > follow the code examples without remembering these names. Is there some  
> > > naming convention or scheme behind this?
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups  
> > > “ats-lang-users” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com).
> > 
> > –  
> > Brandon Barker  
> > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@gmail.com)
> 
> –  
> You received this message because you are subscribed to a topic in the  
> Google Groups “ats-lang-users” group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com).

---

<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: [February 1, 2015, 6:41pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/4 "2015-02-01T18:41:07Z")

</div>

t@p is not a valid identifier.

The parser can only recognize t@ype, which can also be written as t0ype.On Sun, Feb 1, 2015 at 1:20 PM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> I have a related question: is this on purpose if the sort `t0p` cannot be  
> written as `t@p`?
> 
> Le mercredi 28 janvier 2015 14:43:56 UTC+1, Andrea Ferretti a écrit :
> 
> > Hello, I am trying to learn ATS following the official book, and I am  
> > finding some difficulties with the names chosen. For instance, a sort for  
> > types of variable dimension is called t@ype, the type of arrays of type  
> > T is arrszref[T], and the function to convert between int and size\_t is  
> > called g0int2uint\_int\_size.
> > 
> > I know it is quite a trivial matter, but I find it very difficult to  
> > follow the code examples without remembering these names. Is there some  
> > naming convention or scheme behind this?
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/f16ae971-c0be-462a-af1b-2b0497fde96b%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f16ae971-c0be-462a-af1b-2b0497fde96b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/f16ae971-c0be-462a-af1b-2b0497fde96b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/f16ae971-c0be-462a-af1b-2b0497fde96b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

### Author: ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)
#### Post date: [January 28, 2015, 3:00pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/5 "2015-01-28T15:00:10Z")

</div>

This seems to be a common problem, though I’m not sure if it is totally  
circumventable due to the wide variety of types in ATS. I hope it can be  
improved.

The first part, ‘g0’, denotes we are dealing with non-indexed types (int  
instead of int (i)).

The second part, I think, is showing the general class of type conversion:  
int 2 uint

The third part shows the actual ats types … somewhat. The latter is  
size\_t instead of size, so this mix of highly systematic and somewhat lax  
naming is a bit disconcerting if I’m reading it right.On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:

> Hello, I am trying to learn ATS following the official book, and I am  
> finding some difficulties with the names chosen. For instance, a sort for  
> types of variable dimension is called t@ype, the type of arrays of type T  
> is arrszref[T], and the function to convert between int and size\_t is  
> called g0int2uint\_int\_size.
> 
> I know it is quite a trivial matter, but I find it very difficult to  
> follow the code examples without remembering these names. Is there some  
> naming convention or scheme behind this?
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

### Author: ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)
#### Post date: [January 28, 2015, 3:15pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/6 "2015-01-28T15:15:17Z")

</div>

Yes, this functionality exist through named importing (staloading). I’m not  
certain it would help as you’d still have to keep track of many namespaces.

staload UN = “predude/SATS/unsafe.sats”

$UN.cast(…)On Wed, Jan 28, 2015 at 10:12 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:

> I am speculating, since I have not read that far: but maybe the naming  
> could be improved by having a module (namespacing) system? If I  
> understand correctly your response, the naming scheme seems to arise  
> to have a global naming scheme without conflicts.
> 
> Has some namespacing mechanism been proposed for ATS?
> 
> 2015-01-28 16:00 GMT+01:00 Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com):
> 
> > Also you can generally find more insight by looking int he sats file  
> > where  
> > it is defined:
> > 
> > $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size  
> > ./prelude/SATS/CODEGEN/integer.sats:fun g0int2uint\_int\_size (x: int):\<\>  
> > size\_t =  
> > “mac#%”  
> > ./prelude/SATS/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t =  
> > “mac#%”
> > 
> > On Wed, Jan 28, 2015 at 10:00 AM, Brandon Barker \< [brandon...@gmail.com](mailto:brandon...@gmail.com)\> wrote:
> > 
> > > This seems to be a common problem, though I’m not sure if it is totally  
> > > circumventable due to the wide variety of types in ATS. I hope it can be  
> > > improved.
> > > 
> > > The first part, ‘g0’, denotes we are dealing with non-indexed types (int  
> > > instead of int (i)).
> > > 
> > > The second part, I think, is showing the general class of type  
> > > conversion:  
> > > int 2 uint
> > > 
> > > The third part shows the actual ats types … somewhat. The latter is  
> > > size\_t instead of size, so this mix of highly systematic and somewhat  
> > > lax  
> > > naming is a bit disconcerting if I’m reading it right.
> > > 
> > > On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> > > 
> > > > Hello, I am trying to learn ATS following the official book, and I am  
> > > > finding some difficulties with the names chosen. For instance, a sort  
> > > > for  
> > > > types of variable dimension is called t@ype, the type of arrays of  
> > > > type T is  
> > > > arrszref[T], and the function to convert between int and size\_t is  
> > > > called  
> > > > g0int2uint\_int\_size.
> > > > 
> > > > I know it is quite a trivial matter, but I find it very difficult to  
> > > > follow the code examples without remembering these names. Is there some  
> > > > naming convention or scheme behind this?
> > > > 
> > > > –  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups  
> > > > “ats-lang-users” group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an  
> > > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com)  
> .
> 
> > > –  
> > > Brandon Barker  
> > > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > 
> > –  
> > Brandon Barker  
> > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > 
> > –  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups “ats-lang-users” group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe)  
> > .  
> > To unsubscribe from this group and all its topics, send an email to  
> > [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com)  
> .
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

### Author: ![Andrea\_Ferretti](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Andrea\_Ferretti](https://discourse.ats-lang.org/u/Andrea_Ferretti)
#### Post date: [January 28, 2015, 5:39pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/7 "2015-01-28T17:39:18Z")

</div>

Ok, I am starting to see the rationale. Still, I am under the  
impression that making the prelude more modular would have allowed  
such uses as

staload UN = “prelude/SATS/unindexed-cast.sats”  
staload IN = “prelude/SATS/indexed-cast.sats”

$UN.int2size\_t(x) // = g0int2uint\_int\_size(x)  
$UN.size\_t2int(x) // = g0uint2int\_size\_int(x)  
$IN.int2size\_t(x) // = g1int2uint\_int\_size(x)  
$IN.size\_t2int(x) // = g1uint2int\_size\_int(x)

Anyway, I am looking forward to learning more while using $UN.cast in  
the meantime! :-)2015-01-28 18:28 GMT+01:00 gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com):

> This is certainly a big issue for people to learn ATS.
> 
> g0: ‘g’ for generic; ‘0’ for un-indexed  
> g1: ‘g’ for generic’ ‘1’ for indexed
> 
> So g0int2uint\_int\_size means it is for turning a signed integer (int) into  
> an unsigned integer (size\_t).
> 
> So g1int2uint\_int\_size means it is also for turning a signed integer (int)  
> into an unsigned integer (size\_t).
> 
> However, the type for the latter is more accurate:
> 
> {n:nat} int(i) → size\_t(i)
> 
> which states that the signed integer is a natural number and the returned  
> unsigned integer has the same value as the signed one.
> 
> As you can see, there is a lot to memorize. When you write ATS code, I  
> suggest that you use $UN.cast (and various variants of it):
> 
> staload UN = “prelude/SATS/unsafe.sats”
> 
> val x = $UN.cast{size\_t}(31415926)
> 
> Of course, $UN.cast is unsafe but it can get you going very quickly.
> 
> Also, there are many overloaded names.
> 
> For instance, g0i2u for g0int2uint\_…; g0u2i for g0uint2int …; g0i2f for  
> g0int2float\_…; g0f2i for g0float2int\_…
> 
> But $UN.cast is your swiss army knife 🙂
> 
> On Wednesday, January 28, 2015 at 8:43:56 AM UTC-5, Andrea Ferretti wrote:
> 
> > Hello, I am trying to learn ATS following the official book, and I am  
> > finding some difficulties with the names chosen. For instance, a sort for  
> > types of variable dimension is called t@ype, the type of arrays of type T is  
> > arrszref[T], and the function to convert between int and size\_t is called  
> > g0int2uint\_int\_size.
> > 
> > I know it is quite a trivial matter, but I find it very difficult to  
> > follow the code examples without remembering these names. Is there some  
> > naming convention or scheme behind this?
> 
> –  
> You received this message because you are subscribed to a topic in the  
> Google Groups “ats-lang-users” group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/0e005458-c775-4a31-a2c0-4751442d3560%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/0e005458-c775-4a31-a2c0-4751442d3560%40googlegroups.com).

---

<div class="post-metadata">

### Author: ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)
#### Post date: [January 28, 2015, 4:56pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/8 "2015-01-28T16:56:19Z")

</div>

> $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size

FYI, git grep is a nicer way to do this if you’re in a git checkout.

---

<div class="post-metadata">

### Author: ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)
#### Post date: [January 28, 2015, 5:06pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/9 "2015-01-28T17:06:18Z")

</div>

Thanks for the tip! Learning git is also a long process for me. FYI these  
will show the atxt files which are used by Hongwei to generate the .sats  
files while also being used to generate documentation (so I guess you’d say  
it is a form of literate programming):

[brandon@localhost ATS-Postiats]$ git grep g0int2uint\_int\_size  
doc/BOOK/INT2PROGINATS/CHAP\_EFFECTFUL/main.atxt:#stacode(“size\_t”) are  
#dyncode(“g0int2uint\_int\_size”) and  
doc/BOOK/INT2PROGINATS/CHAP\_EFFECTFUL/main.atxt: #define i2sz  
g0int2uint\_int\_size  
doc/BOOK/INT2PROGINATS/CODE/CHAP\_EFFECTFUL/permord.dats: #define i2sz  
g0int2uint\_int\_size  
prelude/CATS/CODEGEN/integer.atxt:#define atspre\_g0int2uint\_int\_size(x)  
((atstype\_size)(x))  
prelude/CATS/CODEGEN/integer.atxt:#define atspre\_g1int2uint\_int\_size  
atspre\_g0int2uint\_int\_size  
prelude/DATS/CODEGEN/integer.atxt:g0int2uint\<intknd,sizeknd\> =  
g0int2uint\_int\_size  
prelude/SATS/CODEGEN/integer.atxt:fun g0int2uint\_int\_size (x: int):\<\>  
size\_t = "mac#%"On Wed, Jan 28, 2015 at 11:56 AM, Shea Levy [sh...@shealevy.com](mailto:sh...@shealevy.com) wrote:

> On Jan 28, 2015, at 3:00 PM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> 
> $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size
> 
> FYI, git grep is a nicer way to do this if you’re in a git checkout.
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com](https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com?utm_medium=email&utm_source=footer)  
> .

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<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: [January 28, 2015, 5:28pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/10 "2015-01-28T17:28:11Z")

</div>

This is certainly a big issue for people to learn ATS.

g0: ‘g’ for generic; ‘0’ for un-indexed  
g1: ‘g’ for generic’ ‘1’ for indexed

So g0int2uint\_int\_size means it is for turning a signed integer (int) into  
an unsigned integer (size\_t).

So g1int2uint\_int\_size means it is also for turning a signed integer (int)  
into an unsigned integer (size\_t).

However, the type for the latter is more accurate:

{n:nat} int(i) → size\_t(i)

which states that the signed integer is a natural number and the returned  
unsigned integer has the same value as the signed one.

As you can see, there is a lot to memorize. When you write ATS code, I  
suggest that you use $UN.cast (and various variants of it):

staload UN = “prelude/SATS/unsafe.sats”

val x = $UN.cast{size\_t}(31415926)

Of course, $UN.cast is unsafe but it can get you going very quickly.

Also, there are many overloaded names.

For instance, g0i2u for g0int2uint\_…; g0u2i for g0uint2int …; g0i2f for  
g0int2float\_…; g0f2i for g0float2int\_…

But $UN.cast is your swiss army knife :)On Wednesday, January 28, 2015 at 8:43:56 AM UTC-5, Andrea Ferretti wrote:

> Hello, I am trying to learn ATS following the official book, and I am  
> finding some difficulties with the names chosen. For instance, a sort for  
> types of variable dimension is called t@ype, the type of arrays of type T  
> is arrszref[T], and the function to convert between int and size\_t is  
> called g0int2uint\_int\_size.
> 
> I know it is quite a trivial matter, but I find it very difficult to  
> follow the code examples without remembering these names. Is there some  
> naming convention or scheme behind this?

---

<div class="post-metadata">

### Author: ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)
#### Post date: [January 28, 2015, 5:11pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/11 "2015-01-28T17:11:34Z")

</div>

You can also limit searched files with something like

$ git grep g0int2uint\_int\_size – '\*.sats’

But of course since those files are generated they don’t exist in my tree 🙂

~Shea\> On Jan 28, 2015, at 5:06 PM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> Thanks for the tip! Learning git is also a long process for me. FYI these will show the atxt files which are used by Hongwei to generate the .sats files while also being used to generate documentation (so I guess you’d say it is a form of literate programming):
> 
> [brandon@localhost ATS-Postiats]$ git grep g0int2uint\_int\_size  
> doc/BOOK/INT2PROGINATS/CHAP\_EFFECTFUL/main.atxt:#stacode(“size\_t”) are #dyncode(“g0int2uint\_int\_size”) and  
> doc/BOOK/INT2PROGINATS/CHAP\_EFFECTFUL/main.atxt: #define i2sz g0int2uint\_int\_size  
> doc/BOOK/INT2PROGINATS/CODE/CHAP\_EFFECTFUL/permord.dats: #define i2sz g0int2uint\_int\_size  
> prelude/CATS/CODEGEN/integer.atxt:#define atspre\_g0int2uint\_int\_size(x) ((atstype\_size)(x))  
> prelude/CATS/CODEGEN/integer.atxt:#define atspre\_g1int2uint\_int\_size atspre\_g0int2uint\_int\_size  
> prelude/DATS/CODEGEN/integer.atxt:g0int2uint\<intknd,sizeknd\> = g0int2uint\_int\_size  
> prelude/SATS/CODEGEN/integer.atxt:fun g0int2uint\_int\_size (x: int):\<\> size\_t = “mac#%”
> 
> On Wed, Jan 28, 2015 at 11:56 AM, Shea Levy \<[sh...@shealevy.com](mailto:sh...@shealevy.com) [mailto:sh...@shealevy.com](mailto:sh...@shealevy.com)\> wrote:
> 
> > On Jan 28, 2015, at 3:00 PM, Brandon Barker \<[brandon...@gmail.com](mailto:brandon...@gmail.com) [mailto:brandon...@gmail.com](mailto:brandon...@gmail.com)\> wrote:
> > 
> > $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size
> 
> FYI, git grep is a nicer way to do this if you’re in a git checkout.
> 
> –  
> You received this message because you are subscribed to the Google Groups “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com) [mailto:ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com) [mailto:ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users) [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com](https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com) [https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/68F72F48-5E9C-49F4-9049-964EA6705A4E%40shealevy.com?utm_medium=email&utm_source=footer).
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@gmail.com) [mailto:brandon...@gmail.com](mailto:brandon...@gmail.com)
> 
> –  
> You received this message because you are subscribed to the Google Groups “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com) [mailto:ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com) [mailto:ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users) [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRoygifiPUejpoUMquB-XYD2woY1n36XJjrYbNm%2B6\_v2hw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRoygifiPUejpoUMquB-XYD2woY1n36XJjrYbNm%2B6_v2hw%40mail.gmail.com) [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRoygifiPUejpoUMquB-XYD2woY1n36XJjrYbNm%2B6\_v2hw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRoygifiPUejpoUMquB-XYD2woY1n36XJjrYbNm%2B6_v2hw%40mail.gmail.com?utm_medium=email&utm_source=footer).

---

<div class="post-metadata">

### Author: ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)
#### Post date: [January 28, 2015, 3:16pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/12 "2015-01-28T15:16:02Z")

</div>

to clarify, [Create new page · githwxi/ATS-Postiats Wiki · GitHub](https://github.com/githwxi/ATS-Postiats/wiki/staloadOn) Wed, Jan 28, 2015 at 10:15 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> Yes, this functionality exist through named importing (staloading). I’m  
> not certain it would help as you’d still have to keep track of many  
> namespaces.
> 
> staload UN = “predude/SATS/unsafe.sats”
> 
> $UN.cast(…)
> 
> On Wed, Jan 28, 2015 at 10:12 AM, Andrea Ferretti \< [ferrett...@gmail.com](mailto:ferrett...@gmail.com)\> wrote:
> 
> > I am speculating, since I have not read that far: but maybe the naming  
> > could be improved by having a module (namespacing) system? If I  
> > understand correctly your response, the naming scheme seems to arise  
> > to have a global naming scheme without conflicts.
> > 
> > Has some namespacing mechanism been proposed for ATS?
> > 
> > 2015-01-28 16:00 GMT+01:00 Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com):
> > 
> > > Also you can generally find more insight by looking int he sats file  
> > > where  
> > > it is defined:
> > > 
> > > $ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size  
> > > ./prelude/SATS/CODEGEN/integer.sats:fun g0int2uint\_int\_size (x: int):\<\>  
> > > size\_t =  
> > > “mac#%”  
> > > ./prelude/SATS/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t =  
> > > “mac#%”
> > > 
> > > On Wed, Jan 28, 2015 at 10:00 AM, Brandon Barker \< [brandon...@gmail.com](mailto:brandon...@gmail.com)\> wrote:
> > > 
> > > > This seems to be a common problem, though I’m not sure if it is totally  
> > > > circumventable due to the wide variety of types in ATS. I hope it can  
> > > > be  
> > > > improved.
> > > > 
> > > > The first part, ‘g0’, denotes we are dealing with non-indexed types  
> > > > (int  
> > > > instead of int (i)).
> > > > 
> > > > The second part, I think, is showing the general class of type  
> > > > conversion:  
> > > > int 2 uint
> > > > 
> > > > The third part shows the actual ats types … somewhat. The latter is  
> > > > size\_t instead of size, so this mix of highly systematic and somewhat  
> > > > lax  
> > > > naming is a bit disconcerting if I’m reading it right.
> > > > 
> > > > On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti [ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> > > > 
> > > > > Hello, I am trying to learn ATS following the official book, and I am  
> > > > > finding some difficulties with the names chosen. For instance, a sort  
> > > > > for  
> > > > > types of variable dimension is called t@ype, the type of arrays of  
> > > > > type T is  
> > > > > arrszref[T], and the function to convert between int and size\_t is  
> > > > > called  
> > > > > g0int2uint\_int\_size.
> > > > > 
> > > > > I know it is quite a trivial matter, but I find it very difficult to  
> > > > > follow the code examples without remembering these names. Is there  
> > > > > some  
> > > > > naming convention or scheme behind this?
> > > > > 
> > > > > –  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups  
> > > > > “ats-lang-users” group.  
> > > > > To unsubscribe from this group and stop receiving emails from it,  
> > > > > send an  
> > > > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > > To view this discussion on the web visit
> > 
> > [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com)  
> > .
> > 
> > > > –  
> > > > Brandon Barker  
> > > > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > > 
> > > –  
> > > Brandon Barker  
> > > [brandon...@gmail.com](mailto:brandon...@gmail.com)
> > > 
> > > –  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups “ats-lang-users” group.  
> > > To unsubscribe from this topic, visit
> > 
> > [https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe](https://groups.google.com/d/topic/ats-lang-users/4djRxVNHAys/unsubscribe).
> > 
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit
> > 
> > [https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAORbNRqbZwtAr%2BQ2XdRAVeFP-ztaDE5UUkPcXByVXzvdF2C3uw%40mail.gmail.com)  
> > .
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAMF%3D6sJ97eicPGtBdMn13uCEMu%3DN8E%3D9D5itipk2-cVCPeWc5w%40mail.gmail.com)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@gmail.com)

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

### Author: ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)
#### Post date: [January 28, 2015, 3:00pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/13 "2015-01-28T15:00:49Z")

</div>

Also you can generally find more insight by looking int he sats file where  
it is defined:

$ find ./ -name ‘\*.sats’ | xargs grep g0int2uint\_int\_size  
./prelude/SATS/CODEGEN/integer.sats:fun g0int2uint\_int\_size (x: int):\<\>  
size\_t =  
“mac#%”  
./prelude/SATS/integer.sats:fun g0int2uint\_int\_size (x: int):\<\> size\_t =  
"mac#%"On Wed, Jan 28, 2015 at 10:00 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:

> This seems to be a common problem, though I’m not sure if it is totally  
> circumventable due to the wide variety of types in ATS. I hope it can be  
> improved.
> 
> The first part, ‘g0’, denotes we are dealing with non-indexed types (int  
> instead of int (i)).
> 
> The second part, I think, is showing the general class of type conversion:  
> int 2 uint
> 
> The third part shows the actual ats types … somewhat. The latter is  
> size\_t instead of size, so this mix of highly systematic and somewhat lax  
> naming is a bit disconcerting if I’m reading it right.
> 
> On Wed, Jan 28, 2015 at 8:43 AM, Andrea Ferretti \<[ferrett...@gmail.com](mailto:ferrett...@gmail.com) wrote:
> 
> > Hello, I am trying to learn ATS following the official book, and I am  
> > finding some difficulties with the names chosen. For instance, a sort for  
> > types of variable dimension is called t@ype, the type of arrays of type  
> > T is arrszref[T], and the function to convert between int and size\_t is  
> > called g0int2uint\_int\_size.
> > 
> > I know it is quite a trivial matter, but I find it very difficult to  
> > follow the code examples without remembering these names. Is there some  
> > naming convention or scheme behind this?
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/e7afa080-5e5f-4709-8f2d-199df647469e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> –  
> Brandon Barker  
> [brandon...@gmail.com](mailto:brandon...@gmail.com)

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

### Author: ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)
#### Post date: [February 1, 2015, 6:20pm UTC](https://discourse.ats-lang.org/t/naming-convention/534/14 "2015-02-01T18:20:56Z")

</div>

I have a related question: is this on purpose if the sort `t0p` cannot be  
written as `t@p`?Le mercredi 28 janvier 2015 14:43:56 UTC+1, Andrea Ferretti a écrit :

> Hello, I am trying to learn ATS following the official book, and I am  
> finding some difficulties with the names chosen. For instance, a sort for  
> types of variable dimension is called t@ype, the type of arrays of type T  
> is arrszref[T], and the function to convert between int and size\_t is  
> called g0int2uint\_int\_size.
> 
> I know it is quite a trivial matter, but I find it very difficult to  
> follow the code examples without remembering these names. Is there some  
> naming convention or scheme behind this?
