This is actually intended.

~ is used for the negative sign in ATS2. It is an ML tradition.
Over the years, I feel that this may not be a good choice. Maybe
we should use '-' instead, which makes parsing a little bit more involved.


On Fri, May 18, 2018 at 2:31 AM, Julian Fondren <julian.fond...@gmail.com>
wrote:

> #include "share/atspre_staload.hats"
>
>
> implement main0() = (
>   println!("~5 = ", ~5);
>   println!("~5u = ", ~5u);
> )
>
>
> Output:
> ~5 = -5
> ~5u = 4294967290
>
> As the second ~ is lnot, bitwise negation.
>
> My expectation was that unsigned numbers would mostly behave like positive
> numbers with an extra bit.
>
> Is this something that just hasn't come up, or is it intended?
>
> --
> 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-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ats-lang-users/b3188167-a418-42dc-ae98-698cf8fa5784%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/ats-lang-users/b3188167-a418-42dc-ae98-698cf8fa5784%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqAPiB-8m7eD5NHmQMbpkuSYUYXQHt%2BuXa-Jdc6CjBeTg%40mail.gmail.com.

Reply via email to