"arrpsz" what is this exactly?

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

$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

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 ?

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-user...@googlegroups.com.
To post to this group, send email to ats-lan...@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
.

See:

https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/ATS-QA-LIST/qa-list-190.datsOn 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 <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 ?

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 <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com<javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/ca3c544a-aba8-4a74-8762-76cbd5911b79%40googlegroups.com
.

Thanks . It now works (tested it and used it in my own code) just fine :)On Tue, Feb 11, 2014 at 8:03 PM, gmhwxi gmh...@gmail.com wrote:

See:

https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/ATS-QA-LIST/qa-list-190.dats

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.


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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/6ced3dd2-10f9-4cac-a405-c2863adb97a1%40googlegroups.com
.