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
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
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
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
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