Hi all,
I know ATS2 supports function templates, and polymorphic functions for boxed types. Is there any support for runtime polymorphism (with vtables or standalone structs of functions or similar) available in the language?
Related question: Is there support for *value* templates?
~Shea
fun vec_add{i:int}(...) =
sif i == 0
then ...
else ...
I added an example of loop unrolling here:
https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/ATS-QA-LIST/qa-list-2015-02-20.dats
I do have a plan to implement the following feature
fun vec_add{i:int}(...) =
sif i == 0
then ...
else ...
vec_add{10}(...) can then be expanded at compile-time.
--
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/4e92a56c-bb36-4901-aa58-205fcc67f373%40googlegroups.com.
I tried to implement what is mentioned below. Unfortunately, my plan did not pan out
well. The simple reason is that the condition following each 'sif' is static but the static
information is essentially all erased at the stage where 'sif' needs to be eliminated.
I could try to eliminate 'sif' at the point where such information is still available but this
means templates making use of 'sif' cannot be handled (as template instantiation happens
at a later stage).
For now, I think we simply need to implement a version of array_foreach that supports
loop unrolling. For instance, see:
https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/TYPEVAL/dotprod.dats
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/7c7a0e69-5bb1-4090-bdd3-57f97adb2070%40googlegroups.com.