Strnptr_copy error

hello,
could not understand while this simple sample failed at C compilation level
:

#include “share/atspre_staload.hats”

implement main0() = let
val s0 = string1_copy(“hello world”)
val s1 = strnptr_copy(s0)
val () = strnptr_free(s0)
in
fprintln! (stdout_ref, strnptr2string(s1))
end

@ patscc -DATS_MEMALLOC_LIBC -o test_strncopy test_strncopy.dats
test_strncopy_dats.c: In function ‘mainats_void_0’:
test_strncopy_dats.c:331:1: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: note: each undeclared identifier is reported
only once for each function it appears in
test_strncopy_dats.c:331:1: error: ‘strnptr_copy’ undeclared (first use in
this function)
test_strncopy_dats.c:331:1: error: expected expression before ‘>’ token

Am I missing something ?

I just checked. This function is not implemented in ATS2-0.1.6.
It is really just the same as strptr0_copy:

implement{}
strnptr_copy
{n}(x) = x2 where
{
val x = strnptr2ptr(x)
val x = $UN.castvwtp0{Strptr0}(x)
val x2 = $UN.castvwtp0{strnptr(n)}(strptr0_copy(x))
prval ((void)) = $UN.cast2void(x)
} (* end of [strnptr_copy] *)On Friday, January 9, 2015 at 10:33:47 PM UTC-5, Cyrille Duret wrote:

hello,
could not understand while this simple sample failed at C compilation
level :

#include “share/atspre_staload.hats”

implement main0() = let
val s0 = string1_copy(“hello world”)
val s1 = strnptr_copy(s0)
val () = strnptr_free(s0)
in
fprintln! (stdout_ref, strnptr2string(s1))
end

@ patscc -DATS_MEMALLOC_LIBC -o test_strncopy test_strncopy.dats
test_strncopy_dats.c: In function ‘mainats_void_0’:
test_strncopy_dats.c:331:1: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: note: each undeclared identifier is reported
only once for each function it appears in
test_strncopy_dats.c:331:1: error: ‘strnptr_copy’ undeclared (first use in
this function)
test_strncopy_dats.c:331:1: error: expected expression before ‘>’ token

Am I missing something ?

I take that back, this is a regression =( It just seemed better at first
because of a different change I made.On Fri, Jan 9, 2015 at 11:05 PM, Brandon Barker brandon...@gmail.com wrote:

staload “libats/ML/SATS/string.sats”

gives some improvement

On Fri, Jan 9, 2015 at 10:33 PM, Cyrille Duret cdu...@gmail.com wrote:

hello,
could not understand while this simple sample failed at C compilation
level :

#include “share/atspre_staload.hats”

implement main0() = let
val s0 = string1_copy(“hello world”)
val s1 = strnptr_copy(s0)
val () = strnptr_free(s0)
in
fprintln! (stdout_ref, strnptr2string(s1))
end

@ patscc -DATS_MEMALLOC_LIBC -o test_strncopy test_strncopy.dats
test_strncopy_dats.c: In function ‘mainats_void_0’:
test_strncopy_dats.c:331:1: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: note: each undeclared identifier is reported
only once for each function it appears in
test_strncopy_dats.c:331:1: error: ‘strnptr_copy’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: error: expected expression before ‘>’ token

Am I missing something ?


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/1c01641b-d410-4451-a600-e7fa01fde2de%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/1c01641b-d410-4451-a600-e7fa01fde2de%40googlegroups.com?utm_medium=email&utm_source=footer
.


Brandon Barker
brandon...@gmail.com

Brandon Barker
brandon...@gmail.com

thank you !Le samedi 10 janvier 2015 05:46:54 UTC+1, gmhwxi a écrit :

I just checked. This function is not implemented in ATS2-0.1.6.
It is really just the same as strptr0_copy:

implement{}
strnptr_copy
{n}(x) = x2 where
{
val x = strnptr2ptr(x)
val x = $UN.castvwtp0{Strptr0}(x)
val x2 = $UN.castvwtp0{strnptr(n)}(strptr0_copy(x))
prval ((void)) = $UN.cast2void(x)
} (* end of [strnptr_copy] *)

On Friday, January 9, 2015 at 10:33:47 PM UTC-5, Cyrille Duret wrote:

hello,
could not understand while this simple sample failed at C compilation
level :

#include “share/atspre_staload.hats”

implement main0() = let
val s0 = string1_copy(“hello world”)
val s1 = strnptr_copy(s0)
val () = strnptr_free(s0)
in
fprintln! (stdout_ref, strnptr2string(s1))
end

@ patscc -DATS_MEMALLOC_LIBC -o test_strncopy test_strncopy.dats
test_strncopy_dats.c: In function ‘mainats_void_0’:
test_strncopy_dats.c:331:1: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: note: each undeclared identifier is reported
only once for each function it appears in
test_strncopy_dats.c:331:1: error: ‘strnptr_copy’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: error: expected expression before ‘>’ token

Am I missing something ?

staload “libats/ML/SATS/string.sats”

gives some improvementOn Fri, Jan 9, 2015 at 10:33 PM, Cyrille Duret cdu...@gmail.com wrote:

hello,
could not understand while this simple sample failed at C compilation
level :

#include “share/atspre_staload.hats”

implement main0() = let
val s0 = string1_copy(“hello world”)
val s1 = strnptr_copy(s0)
val () = strnptr_free(s0)
in
fprintln! (stdout_ref, strnptr2string(s1))
end

@ patscc -DATS_MEMALLOC_LIBC -o test_strncopy test_strncopy.dats
test_strncopy_dats.c: In function ‘mainats_void_0’:
test_strncopy_dats.c:331:1: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
test_strncopy_dats.c:331:1: note: each undeclared identifier is reported
only once for each function it appears in
test_strncopy_dats.c:331:1: error: ‘strnptr_copy’ undeclared (first use in
this function)
test_strncopy_dats.c:331:1: error: expected expression before ‘>’ token

Am I missing something ?


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/1c01641b-d410-4451-a600-e7fa01fde2de%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/1c01641b-d410-4451-a600-e7fa01fde2de%40googlegroups.com?utm_medium=email&utm_source=footer
.

Brandon Barker
brandon...@gmail.com