I can't use local in

Hi everyone.

I want to try an example from the official introduction to ATS2, but an
error appears. I use this code:

local

val PI = 3.14 and radius = 10.0

in (* in of [local] *)

val area = PI * radius * radius

end // end of [local]

My OS is Fedora 23 and I use last stable version of patscc. When I use this
command:

patscc -o prueba prueba.dats

This is the error:

In file included from prueba_dats.c:15:0:

prueba_dats.c: En la función
‘_057_home_057_lajto_057_Pruebas_057_prueba_056_dats__dynload’:
prueba_dats.c:159:21: error: ‘PMVtmpltcstmat’ no se declaró aquí (primer
uso en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:21: nota: cada identificador sin declarar se reporta
sólo una vez para cada función en el que aparece
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:39: error: ‘g0float_mul’ no se declaró aquí (primer uso
en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:51: aviso: declaración implícita de la función
‘S2Eextkind’ [-Wimplicit-function-declaration]
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:78: error: expected expression before ‘)’ token
e(statmp1,
PMVtmpltcstmat0(ATSPMVf0l
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp0,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:78: error: expected expression before ‘)’ token
e(statmp0,
PMVtmpltcstmat0(statmp1,
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^

Anyone can help? Maybe I made a silly mistake?

You need the following line at the top:

#include “share/atspre_staload.hats” // telling the compiler where to get
the needed templates

Also you need to implement the main function:

implement main0 () = ()On Thursday, January 14, 2016 at 7:42:23 AM UTC-5, Lajto wrote:

Hi everyone.

I want to try an example from the official introduction to ATS2, but an
error appears. I use this code:

local

val PI = 3.14 and radius = 10.0

in (* in of [local] *)

val area = PI * radius * radius

end // end of [local]

My OS is Fedora 23 and I use last stable version of patscc. When I use
this command:

patscc -o prueba prueba.dats

This is the error:

In file included from prueba_dats.c:15:0:

prueba_dats.c: En la función
‘_057_home_057_lajto_057_Pruebas_057_prueba_056_dats__dynload’:
prueba_dats.c:159:21: error: ‘PMVtmpltcstmat’ no se declaró aquí (primer
uso en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:21: nota: cada identificador sin declarar se reporta
sólo una vez para cada función en el que aparece
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:39: error: ‘g0float_mul’ no se declaró aquí (primer uso
en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:51: aviso: declaración implícita de la función
‘S2Eextkind’ [-Wimplicit-function-declaration]
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:78: error: expected expression before ‘)’ token
e(statmp1,
PMVtmpltcstmat0(ATSPMVf0l
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp0,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:78: error: expected expression before ‘)’ token
e(statmp0,
PMVtmpltcstmat0(statmp1,
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^

Anyone can help? Maybe I made a silly mistake?

Ok, silly mistake. So, I see that the template provided here
A Template for Single-File Programs is
necessary. Many examples that I tried before didn’t need that. Anyway, from
now on I’ll use it.

Thanks ^^.El jueves, 14 de enero de 2016, 14:20:58 (UTC+1), gmhwxi escribió:

You need the following line at the top:

#include “share/atspre_staload.hats” // telling the compiler where to get
the needed templates

Also you need to implement the main function:

implement main0 () = ()

On Thursday, January 14, 2016 at 7:42:23 AM UTC-5, Lajto wrote:

Hi everyone.

I want to try an example from the official introduction to ATS2, but an
error appears. I use this code:

local

val PI = 3.14 and radius = 10.0

in (* in of [local] *)

val area = PI * radius * radius

end // end of [local]

My OS is Fedora 23 and I use last stable version of patscc. When I use
this command:

patscc -o prueba prueba.dats

This is the error:

In file included from prueba_dats.c:15:0:

prueba_dats.c: En la función
‘_057_home_057_lajto_057_Pruebas_057_prueba_056_dats__dynload’:
prueba_dats.c:159:21: error: ‘PMVtmpltcstmat’ no se declaró aquí (primer
uso en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:21: nota: cada identificador sin declarar se reporta
sólo una vez para cada función en el que aparece
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:39: error: ‘g0float_mul’ no se declaró aquí (primer
uso en esta función)
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:51: aviso: declaración implícita de la función
‘S2Eextkind’ [-Wimplicit-function-declaration]
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp1,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:159:78: error: expected expression before ‘)’ token
e(statmp1,
PMVtmpltcstmat0(ATSPMVf0l
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:62: error: expected expression before ‘atstype_double’
ATSINSmove(statmp0,
PMVtmpltcstmat0(
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^
prueba_dats.c:164:78: error: expected expression before ‘)’ token
e(statmp0,
PMVtmpltcstmat0(statmp1,
^
/home/lajto/.ats2-compiler/ccomp/runtime/pats_ccomp_instrset.h:266:37:
nota: in definition of macro ‘ATSINSmove’
#define ATSINSmove(tmp, val) (tmp = val)
^

Anyone can help? Maybe I made a silly mistake?