Re: Some ATS code for Book "Getting Started with Arduino"

2018-03-11 Thread Brandon Barker
I still find this behavior to be a bit surprising: #include "share/atspre_staload.hats" fun immval(): void = let val xx: int = 1 val _ = xx = 2 val yy: int = 1 val yy: int = 2 in ( println!("xx is ", xx); println!("yy is ", yy) ) end implement main0 () = immval() The result of running th

Re: Some ATS code for Book "Getting Started with Arduino"

2018-03-11 Thread Hongwei Xi
There are no assignments here. The following line binds '_' to the value 'true': val _ = xx = 2 xx = 2 is a boolean expression; it is not assignment. Also, the following line means creating a name yy for the value 1: val yy: int = 1 Again, no assignment. For assignments, you need to change 'v

Re: Some ATS code for Book "Getting Started with Arduino"

2018-03-11 Thread Brandon Barker
Ah, right, I'm still warming up to having "=" used for both assignment and equality depending on placement, sorry for the mixup. In the second case, then, I guess what I'm suggesting is that the same name shouldn't be allowed to bind more than once in the same scope. On Sunday, March 11, 2018 a

Re: Some ATS code for Book "Getting Started with Arduino"

2018-03-11 Thread Hongwei Xi
>>In the second case, then, I guess what I'm suggesting is that the same name shouldn't be allowed to bind more than once in the same scope. This really a taste, I would argue. When coding in Java, I use a lot of 'final' variables. I find it annoying that two 'final' variables can not have the sa

Re: Some ATS code for Book "Getting Started with Arduino"

2018-03-11 Thread Brandon Barker
Maybe now isn't the time, but perhaps (in ATS2 or ATS3) there could be scope-based or project-based overrides for certain linting. For instance, the following library is a build plugin and a normal library: http://www.wartremover.org/doc/install-setup.html In the first sense, as a build plugin,