This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
Great work!
I have a question: why do you use list0 in the myprint example? Why not use
an existentially quantified List instead?
Also, and more importantly, when is it necessary to fully apply type
parameters to a function template? And when is it OK to omit them?
I think this is a brilliant feature. I feel it would be even nicer to pass
the needed templates explicitly as arguments; may be <<.>>. Otherwise the
search strategy reminds me of metaCLOS!
Best.
–shiv–On Sunday, March 8, 2015 at 11:06:57 AM UTC-7, gmhwxi wrote:
I added a chapter on function templates in my Intro-to-ATS book:
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
Putting the current design of templates into ATS2 was a big gamble on my
part.
I now do feel a lot of comfortable about the design than I did two years
ago, when the
design was largely untested. Before that, I spent at least 3 years trying
to figure out
how to support OOP in ATS2, which led to a design I eventually abandoned
due to its
immense complexity. But I would still like to have some form of OOP
To properly indicate which template parameters must be provided is
challenging. I will
study the issue more.On Friday, March 13, 2015 at 9:55:31 AM UTC-4, Shivkumar Chandrasekaran wrote:
Hi Hongwei,
I think this is a brilliant feature. I feel it would be even nicer to pass
the needed templates explicitly as arguments; may be <<.>>. Otherwise the
search strategy reminds me of metaCLOS!
Best.
–shiv–
On Sunday, March 8, 2015 at 11:06:57 AM UTC-7, gmhwxi wrote:
I added a chapter on function templates in my Intro-to-ATS book:
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
The template parameters of a template implementation were not allowed to
be quantifed types. After thinking over the issue today, I slightly
modified the
method used to locate the template implementation for a template instance.
Now you can do
implement(a)
myprint<List(a)> (xs) = …
val () = myprint<List(int)> (…)
Because locating the template implementation for a template instance is done after the erasure of type indices, the template parameter matching must
be exact.
For instance,
implement(a)
myprint<list(a,2)> (xs) = …
val () = myprint<list(int, 1+1)> (…)
There is NO match here because 1+1 and 2 are syntactically different.On Tuesday, March 10, 2015 at 10:26:04 AM UTC-4, Artyom Shalkhakov wrote:
On Monday, March 9, 2015 at 12:06:57 AM UTC+6, gmhwxi wrote:
I added a chapter on function templates in my Intro-to-ATS book:
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!
Great work!
I have a question: why do you use list0 in the myprint example? Why not
use an existentially quantified List instead?
Also, and more importantly, when is it necessary to fully apply type
parameters to a function template? And when is it OK to omit them?
Very cool! One question: If templates follow a first-fit model, why do you define the specialization partial order? Is it used for anything?> On Mar 8, 2015, at 2:06 PM, gmhwxi gmh...@gmail.com wrote:
I added a chapter on function templates in my Intro-to-ATS book:
This chapter is in Part V of the book, and it is still being worked. However, it can
already provide a lot of useful information on function templates in ATS. Cheers!
The partial order is a concept.
It just happens that it is not used in the current implementation.
It could be useful if one wants to report a warning in a case where
first-fit is not the same as best-fit.On Tuesday, March 10, 2015 at 10:50:13 AM UTC-4, Shea Levy wrote:
Very cool! One question: If templates follow a first-fit model, why do you
define the specialization partial order? Is it used for anything?
On Mar 8, 2015, at 2:06 PM, gmhwxi <gmh...@gmail.com <javascript:>> wrote:
I added a chapter on function templates in my Intro-to-ATS book:
This chapter is in Part V of the book, and it is still being worked.
However, it can
already provide a lot of useful information on function templates in ATS.
Cheers!