# Is \`:=\` a built in operator? (fwd)

**URL:** <https://discourse.ats-lang.org/t/is-a-built-in-operator-fwd/464>\
**Category:** Google Group\
**Created:** [August 27, 2014, 1:33pm UTC](https://discourse.ats-lang.org/t/is-a-built-in-operator-fwd/464 "2014-08-27T13:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<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 27, 2014, 1:33pm UTC](https://discourse.ats-lang.org/t/is-a-built-in-operator-fwd/464/1 "2014-08-27T13:33:11Z")

</div>

I have moved the discussion to the google-group for ats-lang-users.

A linear proof variable is a left-value (of size 0). So the following code  
means to store parray\_v\_cons (pf1, pf2) into pf:

pf := parray\_v\_cons (pf1, pf2)

Of course, this is allowed only if there is no linear proof currently  
stored in pf.On Wed, Aug 27, 2014 at 9:28 AM, Hongwei Xi [hw...@bu.edu](mailto:hw...@bu.edu) wrote:

> ---------- Forwarded message ----------  
> Date: Wed, 27 Aug 2014 19:42:05 +0900  
> From: Kiwamu Okabe [kiw...@debian.or.jp](mailto:kiw...@debian.or.jp)  
> To: ats-lang-users [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> Subject: Re: [ats-lang-users] Is `:=` a built in operator?
> 
> Hi,
> 
> On Wed, Aug 27, 2014 at 1:47 AM, Brandon Barker [brandon...@gmail.com](mailto:brandon...@gmail.com) wrote:
> 
> > I believe that it should be since var updates require it, e.g.,
> > 
> > var x: int  
> > val () = x := 7
> 
> Thank’s! I explained it at  
> [Built in operators · githwxi/ATS-Postiats Wiki · GitHub](https://github.com/githwxi/ATS-Postiats/wiki/Built-in-operators).  
> However, `:=` is sometimes used for static value.
> 
> ```auto
> implement{a}
> parray_size (pf | p) = let
> prval () = lemma_parray_v_params (pf)
> fun loop
> {l:addr}{i,j:nat} .<i>. (
> pf: !parray_v (a, l, i) | p: ptr l, j: size_t j
> ) :<> size_t (i+j) = let
> val isnemp = parray_isnot_empty<a> (pf | p)
> in
> if isnemp then let
> prval parray_v_cons (pf1, pf2) = pf
> val n = loop (pf2 | p+sizeof<a>, j+1)
> prval () = pf := parray_v_cons (pf1, pf2)
> 
> ```
> 
> I will write more information, if I know static value assignment.
> 
> ## Thank’s,
> 
> Kiwamu Okabe at METASEPI DESIGN
> 
> * * *
> 
> * * *
> 
> Slashdot TV.  
> Video for Nerds. Stuff that matters.  
> [http://tv.slashdot.org/](http://tv.slashdot.org/)
> 
> * * *
> 
> ats-lang-users mailing list  
> [ats-lan...@lists.sourceforge.net](mailto:ats-lan...@lists.sourceforge.net)  
> [ats-lang-users List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ats-lang-users)

---

<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 28, 2014, 5:20pm UTC](https://discourse.ats-lang.org/t/is-a-built-in-operator-fwd/464/2 "2014-08-28T17:20:36Z")

</div>

There are many forms of left-values in ATS:

variables, dereferenced pointers, dreferenced references, field selection,  
array subscripting, named linear proof values, etc. For each form, you can  
write:

left-value := expOn Thursday, August 28, 2014 3:34:56 AM UTC-4, Kiwamu Okabe wrote:

> Hi Hongwei,
> 
> On Wed, Aug 27, 2014 at 10:33 PM, Hongwei Xi \<[gmh...@gmail.com](mailto:gmh...@gmail.com) \<javascript:\>\> wrote:
> 
> > A linear proof variable is a left-value (of size 0). So the following  
> > code  
> > means to store parray\_v\_cons (pf1, pf2) into pf:
> > 
> > pf := parray\_v\_cons (pf1, pf2)
> > 
> > Of course, this is allowed only if there is no linear proof currently  
> > stored  
> > in pf.
> 
> Umm… `:=` has following three meanings?
> 
> 1. Assign new value to a dynamic variable (var) that has the old value.
> 2. Assign new value to dereferenced (left-value) pointer with valid  
> linear proof.
> 3. Assign new static value (linear proof) to an uninitialized or empty  
> (consumed?) variable.
> 
> ## Thank’s,
> 
> Kiwamu Okabe at METASEPI DESIGN
