--
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.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at 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/CAEvX6dkiPM2LcfGzVumRJ-3%2Bj%3DuSGHMxfbXtVSKOiBJFTna7ZQ%40mail.gmail.com.
implement main () = {
fun loop () = {
val b = digitalRead (BUTTON)
val () = digitalWrite (LED, b)
val () = loop ()
}
val () = pinMode (LED, OUTPUT)
val () = pinMode (BUTTON, INPUT)
val () = loop ()
}
fun delay(ms: ulint): void = "mac#" |
fun delay(us: uint): void = "mac#" The second one overwrites the first one. Try something like: |
fun delay_uint (uint): void = "mac#"
fun delay_ulint (ulint): void = "mac#"
overload delay with delay_uint
overload delay with delay_ulint
--
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.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at 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/CAJ7XQb6BRhz0Fk1uO4iZ1Xr5i8ddn-Ey6hgSrxxh1F6TmTK5jQ%40mail.gmail.com.
> Well, this can be a feature as well :)
> Imagine the following scenario:
> #include "foo.sats" // [delay] is already declared here
> fun delay (...): void = "mac#
> A warning sounds reasonable. As I see it, the right place for
> handling this is in some kind of IDE.
My knee jerk reaction is to disagree and still think it must be a
compile time error.
On Thursday, April 23, 2015 at 12:26:18 PM UTC-4, Raoul Duke wrote:> Well, this can be a feature as well :)
> Imagine the following scenario:
> #include "foo.sats" // [delay] is already declared here
> fun delay (...): void = "mac#
> A warning sounds reasonable. As I see it, the right place for
> handling this is in some kind of IDE.
My knee jerk reaction is to disagree and still think it must be a
compile time error.
Well, the current handling of the issue is consistent with the principle
of lexical scoping. I assume that you have no objection to the legality
of the following code:
val x = 1
val x = 2
Then it is only natural to handle the following declarations similarly:
fun foo : int -> int
fun foo : (int, int) -> int
Yes, it is most likely that a mistake is made if some writes this kind of stuff. But ...
Let us imagine that the code is automatically generated (instead of being written
manually).
If it were stated in the C standard that a vacuous label is illegal, then compiling into
C would have been a lot more difficult.
Now let us dream contexts where I might cave in. E.g. if there's no
such thing as namespaces, then things are so bad already that we are
forced to do / allow otherwise insanely bad habits, I guess. :-(
BTW is there an ATS lang *spec* somewhere? I could not find it in 2
minutes of looking on the web site. I'm a nerd and want that stuff
readily available. :-)
--
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.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at 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/50784cf3-206e-4e21-8828-ebcf21d5e412%40googlegroups.com.
fun sum (xs: List(int)): int
case+ xs of
| list_nil () => 0
| list_cons (x, xs) => x + sum(xs)
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/51033971-3517-4c83-9a6a-3f7dd1c5e71e%40googlegroups.com.
xx is 1
yy is 2
--
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+unsubscribe@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/4c40b2a5-f8ce-4580-8792-ad909502861a%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@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/f7a9d068-4d5a-426c-b262-5d940957ea50%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/f7a9d068-4d5a-426c-b262-5d940957ea50%40googlegroups.com.