$arrpsz is not a function. It is a function-like construct for constructing
arrays.
In ATS, identifiers beginning with the $ symbol often represent constructs
that
are function-like. For example, $list, $list_vt, $tuple, $tuple_vt, $raise,
etc.
$arrpsz{T}(…) gives you a value of the type arrayptrsize(T, N), where N
is the
number of arguments.
How do I create a function that takes variable number of arguments of
same type ?
Say this function is called foo.
Then you can give foo the following interface:
fun foo{n:int} (arrayptrsize (T, n)): …
A call to foo is like: foo($arrpsz{T}(…))On Tuesday, February 11, 2014 1:29:02 AM UTC-5, chotu s wrote:
Hello,
Where is this function declared and what it does exactly ?
val A = (arrayptr) $arrpsz{int}(1,2,3,4,5,6)
It seems to take variable number of arguments , and return a value of
type arrayptr(int,6) .
How do I create a function that takes variable number of arguments of same
type ?
Variable argument does not seem to work. Can you give me a working code
where say a fun takes 1 or more integers and return its sum or say simply
returns an array whose elements are these integers.
By the way , I also cant find “arrayptrsize” in any file .
ThanksOn Tue, Feb 11, 2014 at 12:08 PM, gmhwxi gmh...@gmail.com wrote:
$arrpsz is not a function. It is a function-like construct for
constructing arrays.
In ATS, identifiers beginning with the $ symbol often represent constructs
that
are function-like. For example, $list, $list_vt, $tuple, $tuple_vt,
$raise, etc.
$arrpsz{T}(…) gives you a value of the type arrayptrsize(T, N), where N
is the
number of arguments.
How do I create a function that takes variable number of arguments of
same type ?
Say this function is called foo.
Then you can give foo the following interface:
fun foo{n:int} (arrayptrsize (T, n)): …
A call to foo is like: foo($arrpsz{T}(…))
On Tuesday, February 11, 2014 1:29:02 AM UTC-5, chotu s wrote:
Hello,
Where is this function declared and what it does exactly ?
val A = (arrayptr) $arrpsz{int}(1,2,3,4,5,6)
It seems to take variable number of arguments , and return a value of
type arrayptr(int,6) .
How do I create a function that takes variable number of arguments of
same type ?
Variable argument does not seem to work. Can you give me a working code
where say a fun takes 1 or more integers and return its sum or say simply
returns an array whose elements are these integers.
By the way , I also cant find “arrayptrsize” in any file .
Thanks
On Tue, Feb 11, 2014 at 12:08 PM, gmhwxi <gmh...@gmail.com <javascript:>>wrote:
$arrpsz is not a function. It is a function-like construct for
constructing arrays.
In ATS, identifiers beginning with the $ symbol often represent
constructs that
are function-like. For example, $list, $list_vt, $tuple, $tuple_vt,
$raise, etc.
$arrpsz{T}(…) gives you a value of the type arrayptrsize(T, N), where N
is the
number of arguments.
How do I create a function that takes variable number of arguments of
same type ?
Say this function is called foo.
Then you can give foo the following interface:
fun foo{n:int} (arrayptrsize (T, n)): …
A call to foo is like: foo($arrpsz{T}(…))
On Tuesday, February 11, 2014 1:29:02 AM UTC-5, chotu s wrote:
Hello,
Where is this function declared and what it does exactly ?
val A = (arrayptr) $arrpsz{int}(1,2,3,4,5,6)
It seems to take variable number of arguments , and return a value of
type arrayptr(int,6) .
How do I create a function that takes variable number of arguments of
same type ?
On Tuesday, February 11, 2014 6:53:52 AM UTC-5, chotu s wrote:
Variable argument does not seem to work. Can you give me a working code
where say a fun takes 1 or more integers and return its sum or say simply
returns an array whose elements are these integers.
By the way , I also cant find “arrayptrsize” in any file .
Thanks
On Tue, Feb 11, 2014 at 12:08 PM, gmhwxi gmh...@gmail.com wrote:
$arrpsz is not a function. It is a function-like construct for
constructing arrays.
In ATS, identifiers beginning with the $ symbol often represent
constructs that
are function-like. For example, $list, $list_vt, $tuple, $tuple_vt,
$raise, etc.
$arrpsz{T}(…) gives you a value of the type arrayptrsize(T, N), where
N is the
number of arguments.
How do I create a function that takes variable number of arguments of
same type ?
Say this function is called foo.
Then you can give foo the following interface:
fun foo{n:int} (arrayptrsize (T, n)): …
A call to foo is like: foo($arrpsz{T}(…))
On Tuesday, February 11, 2014 1:29:02 AM UTC-5, chotu s wrote:
Hello,
Where is this function declared and what it does exactly ?
val A = (arrayptr) $arrpsz{int}(1,2,3,4,5,6)
It seems to take variable number of arguments , and return a value of
type arrayptr(int,6) .
How do I create a function that takes variable number of arguments of
same type ?
Thanks
–
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...@googlegroups.com.
To post to this group, send email to ats-l...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/ats-lang-users/ca3c544a-aba8-4a74-8762-76cbd5911b79% 40googlegroups.com.