Can't use arrayref outside file

I have a compile error I’ve been pulling my hair out over.

In file a.dats:

macdef packetIn =
$extval(arrayref(uint8, 127),“packetIn”)

extern fun{} setPacketIn(index: natLt(127), v: uint8): void
implement{} setPacketIn(index, v) = (packetIn[index] := v)

In file b.dats

staload “a.dats”

setPacketIn($UN.cast{natLt(127)}(4), u8(0)) // To test compile

I get errors:

S2-Postiats-0.2.4/ccomp/runtime -O0 -Wall -mcpu=arm926ej-s
-mthumb-interwork -ffunction-sections -fdata-sections -c -o a.o a_dats.c
In file included from a_dats.c:33:0:


^
In file included from DATS/process_dats.c:15:0:
DATS/process_dats.c: In function
’ATSLIB_056_prelude__array_set_at_gint__80__1’:
DATS/process_dats.c:9248:31: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
ATSINSmove_void(tmpret303__1,
PMVtmpltcstmat[0](ptr0_set<S2Eapp(S2Ecst(g0uint_t0ype);
S2Eextkind(atstype_uint8))>)(tmp304__1, arg2)) ;
^

^
DATS/process_dats.c:9248:49: error: ‘ptr0_set’ undeclared (first use in
this function)
ATSINSmove_void(tmpret303__1,
PMVtmpltcstmat[0](ptr0_set<S2Eapp(S2Ecst(g0uint_t0ype);
S2Eextkind(atstype_uint8))>)(tmp304__1, arg2)) ;
^

If I just try to access packetIn[] directly, I get the same errors. The
code in a.dats is well established working code, and this is the first time
I have tried to access it from a second dats file.

I’m statically loading:

staload _ = "prelude/DATS/integer.dats"
staload _ = "prelude/DATS/pointer.dats"
staload _ = "prelude/DATS/bool.dats"
staload _ = "prelude/DATS/char.dats"
staload _ = "prelude/DATS/integer_fixed.dats"
staload _ = "prelude/DATS/string.dats"
staload _ = "prelude/DATS/array.dats"
staload _ = "prelude/DATS/arrayptr.dats"
staload _ = “prelude/DATS/arrayref.dats”

Perhaps there is something missing I need to load?

Can you explain how to get that from the message so I can self serve next
time?

Also need:

staload _ = "prelude/DATS/unsafe.dats"On Sat, Nov 21, 2015 at 9:39 PM, Mike Jones proc...@gmail.com wrote:

I have a compile error I’ve been pulling my hair out over.

In file a.dats:

macdef packetIn =
$extval(arrayref(uint8, 127),“packetIn”)

extern fun{} setPacketIn(index: natLt(127), v: uint8): void
implement{} setPacketIn(index, v) = (packetIn[index] := v)

In file b.dats

staload “a.dats”

setPacketIn($UN.cast{natLt(127)}(4), u8(0)) // To test compile

I get errors:

S2-Postiats-0.2.4/ccomp/runtime -O0 -Wall -mcpu=arm926ej-s
-mthumb-interwork -ffunction-sections -fdata-sections -c -o a.o a_dats.c
In file included from a_dats.c:33:0:


^
In file included from DATS/process_dats.c:15:0:
DATS/process_dats.c: In function
‘ATSLIB_056_prelude__array_set_at_gint__80__1’:
DATS/process_dats.c:9248:31: error: ‘PMVtmpltcstmat’ undeclared (first use
in this function)
ATSINSmove_void(tmpret303__1,
PMVtmpltcstmat[0](ptr0_set<S2Eapp(S2Ecst(g0uint_t0ype);
S2Eextkind(atstype_uint8))>)(tmp304__1, arg2)) ;
^

^
DATS/process_dats.c:9248:49: error: ‘ptr0_set’ undeclared (first use in
this function)
ATSINSmove_void(tmpret303__1,
PMVtmpltcstmat[0](ptr0_set<S2Eapp(S2Ecst(g0uint_t0ype);
S2Eextkind(atstype_uint8))>)(tmp304__1, arg2)) ;
^

If I just try to access packetIn directly, I get the same errors. The
code in a.dats is well established working code, and this is the first time
I have tried to access it from a second dats file.

I’m statically loading:

staload _ = “prelude/DATS/integer.dats”
staload _ = “prelude/DATS/pointer.dats”
staload _ = “prelude/DATS/bool.dats”
staload _ = “prelude/DATS/char.dats”
staload _ = “prelude/DATS/integer_fixed.dats”
staload _ = “prelude/DATS/string.dats”
staload _ = “prelude/DATS/array.dats”
staload _ = “prelude/DATS/arrayptr.dats”
staload _ = “prelude/DATS/arrayref.dats”

Perhaps there is something missing I need to load?


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/6e9b27d0-f9d1-468c-9095-870a683b28b2%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/6e9b27d0-f9d1-468c-9095-870a683b28b2%40googlegroups.com?utm_medium=email&utm_source=footer
.

PMVtmpltcstmat[0](ptr0_set<S2Eapp(S2Ecst(g0uint_t0ype)…

This message means that ptr0_set<…> is unavailable. This is
due to no implementation of ptr0_set being available to the compilerOn Sat, Nov 21, 2015 at 9:59 PM, Mike Jones proc...@gmail.com wrote:

Can you explain how to get that from the message so I can self serve next
time?


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/bc4a744a-b051-402b-b115-7ce812f3368c%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/bc4a744a-b051-402b-b115-7ce812f3368c%40googlegroups.com?utm_medium=email&utm_source=footer
.

Oh, I guess it did not occur to me that was in unsafe. I guess I should
just grep all files and not think so much.