How to write a closure taking a ref val?

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

Or do you mean leaving out variable names? Yes, I see that is bad now.On Feb 20, 2014 10:33 PM, “Brandon Barker” brandon...@gmail.com wrote:

Thanks. Partially annotated refers to using a closure to hide data used as
inputs?
On Feb 20, 2014 10:26 PM, “gmhwxi” gmh...@gmail.com wrote:

This one works.

abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int

implement
my_makeclo(x) = lam(xs) => myfun(xs, x)

Partially annotated functions should in general be avoided.

On Thursday, February 20, 2014 9:24:38 PM UTC-5, Brandon Barker wrote:

When I use a slightly less recent versio
abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int
//
implement
my_makeclo(x) =
lam(xs: !mytype) => myfun(xs, x)

n (but one that compiles) with this test case, the same problem occurs:

On Thursday, February 20, 2014 8:47:04 PM UTC-5, gmhwxi wrote:

Your version of ATS is too new :slight_smile:

On Thursday, February 20, 2014 8:06:31 PM UTC-5, Brandon Barker wrote:

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t
seem to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to `2media_2RAID5_2home
2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__
hidexp_ccomp_ret_fixinit’

On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed
refval types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)


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/312ce9c3-bb8d-4a2b-8e3a-f752faa3805d%40googlegroups.com
.

Thanks. Partially annotated refers to using a closure to hide data used as
inputs?On Feb 20, 2014 10:26 PM, “gmhwxi” gmh...@gmail.com wrote:

This one works.

abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int

implement
my_makeclo(x) = lam(xs) => myfun(xs, x)

Partially annotated functions should in general be avoided.

On Thursday, February 20, 2014 9:24:38 PM UTC-5, Brandon Barker wrote:

When I use a slightly less recent versio
abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int
//
implement
my_makeclo(x) =
lam(xs: !mytype) => myfun(xs, x)

n (but one that compiles) with this test case, the same problem occurs:

On Thursday, February 20, 2014 8:47:04 PM UTC-5, gmhwxi wrote:

Your version of ATS is too new :slight_smile:

On Thursday, February 20, 2014 8:06:31 PM UTC-5, Brandon Barker wrote:

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t
seem to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to `2media_2RAID5_2home
2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__
hidexp_ccomp_ret_fixinit’

On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed
refval types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)


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/312ce9c3-bb8d-4a2b-8e3a-f752faa3805d%40googlegroups.com
.

This one works.

abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int

implement
my_makeclo(x) = lam(xs) => myfun(xs, x)

Partially annotated functions should in general be avoided.On Thursday, February 20, 2014 9:24:38 PM UTC-5, Brandon Barker wrote:

When I use a slightly less recent versio
abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int
//
implement
my_makeclo(x) =
lam(xs: !mytype) => myfun(xs, x)

n (but one that compiles) with this test case, the same problem occurs:

On Thursday, February 20, 2014 8:47:04 PM UTC-5, gmhwxi wrote:

Your version of ATS is too new :slight_smile:

On Thursday, February 20, 2014 8:06:31 PM UTC-5, Brandon Barker wrote:

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t
seem to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to
`_2media_2RAID5_2home_2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__hidexp_ccomp_ret_fixinit’

On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

When I use a slightly less recent versio
abstype mytype

extern
fun myfun
(!mytype, x: int): int

extern
fun my_makeclo(int): (!mytype) - int
//
implement
my_makeclo(x) =
lam(xs: !mytype) => myfun(xs, x)

n (but one that compiles) with this test case, the same problem occurs:On Thursday, February 20, 2014 8:47:04 PM UTC-5, gmhwxi wrote:

Your version of ATS is too new :slight_smile:

On Thursday, February 20, 2014 8:06:31 PM UTC-5, Brandon Barker wrote:

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t seem
to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to
`_2media_2RAID5_2home_2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__hidexp_ccomp_ret_fixinit’

On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t seem
to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to
`_2media_2RAID5_2home_2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__hidexp_ccomp_ret_fixinit’On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

Your version of ATS is too new :)On Thursday, February 20, 2014 8:06:31 PM UTC-5, Brandon Barker wrote:

Woops, that makes sense. However, it seems I still get the same error.

I updated ATS-Postiats to HEAD to see if that would help and I can’t seem
to build:
/media/RAID5/home/brandon/ATS-Postiats/src/pats_ccomp_dynexp_dats.c:3799:
undefined reference to
`_2media_2RAID5_2home_2brandon_2ATS_2dPostiats_2src_2pats_ccomp_dynexp_2edats__hidexp_ccomp_ret_fixinit’

On Thursday, February 20, 2014 7:16:33 PM UTC-5, gmhwxi wrote:

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)

should be

extern
fun gmeanvar_makeclo(GDMap, GDMap):
(!genes) - (double, double)

On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)

If you annotate a function, please try to have types for arguments and
result.

In the following case, there is no result type:

lam (x: int) => …

In the following case, there is no argument type:

lam (x): int => …On Thursday, February 20, 2014 5:31:39 PM UTC-5, Brandon Barker wrote:

I’ve had similar errors before but in different contexts I think:
d1exp_tr_arg_body_ann: the function argument cannot be ascribed refval
types.

extern
fun genes_meanvar
(xs: !genes, emap: GDMap, smap: GDMap): (double, double)

extern
fun gmeanvar_makeclo(GDMap, GDMap):
genes - (double, double)
//
implement
gmeanvar_makeclo(emap, smap) =
lam(xs: !genes) => genes_meanvar(xs, emap, smap)