The syntactic entity is needed

Probably a dependent type issue:
I’m trying to transform a list to a list_vt using a functional + linear
approach.

I bet that using templates would be easier, but I should probably continue
to try to master this style:

(* ****** ****** *)
extern
fun
grexplst_cnfize_list_vt {n:pos} (gxs: list(grexp, n)): grcnflst

(* ****** ****** *)

implement
grexplst_cnfize_list_vt
{n} (gxs) = let
var cnfs = list_vt_nil()
//

fun loop {i:nat|i<n}
(gxs: list(grexp, n), i: int i,
cnfs: &list_vt(INV(grcnf), i) >> list_vt(grcnf, i+1)
): void = case+ gxs of
| list_cons (gx, gxs1) => let
val gx_cnf = grexp_cnfize(gx)
val () = list_vt_insert_at(cnfs, i, gx_cnf)
in
loop(gxs1, i+1, cnfs)
end // end of [list_cons]

| list_nil () => () //shouldn’t be reached

// end of [loop]

val () = loop(gxs, 0, cnfs)
in // in of let

cnfs
end //end of grexplst_cnfize_list_vt

/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3606(line=219, offs=19) – 3608(line=219, offs=21): error(parsing): the
syntactic entity [s0qua] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3605(line=219, offs=18) – 3606(line=219, offs=19): error(parsing): the
keyword ‘}’ is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3597(line=219, offs=10) – 3598(line=219, offs=11): error(parsing): the
keyword [=] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3588(line=219, offs=1) – 3591(line=219, offs=4): error(parsing): the
keyword [in] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3556(line=216, offs=15) – 3559(line=216, offs=18): error(parsing): the
syntactic entity [d0exp] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3508(line=214, offs=1) – 3517(line=214, offs=10): error(parsing): the
token is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3828(line=226, offs=1) – 3830(line=226, offs=3): error(parsing): the token
is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3970(line=232, offs=1) – 3972(line=232, offs=3): error(parsing): the token
is discarded.

i<n changes to i < n.On Monday, January 27, 2014 6:33:27 PM UTC-5, Brandon Barker wrote:

Probably a dependent type issue:
I’m trying to transform a list to a list_vt using a functional + linear
approach.

I bet that using templates would be easier, but I should probably continue
to try to master this style:

(* ****** ****** *)
extern
fun
grexplst_cnfize_list_vt {n:pos} (gxs: list(grexp, n)): grcnflst

(* ****** ****** *)

implement
grexplst_cnfize_list_vt
{n} (gxs) = let
var cnfs = list_vt_nil()
//

fun loop {i:nat|i<n}
(gxs: list(grexp, n), i: int i,
cnfs: &list_vt(INV(grcnf), i) >> list_vt(grcnf, i+1)
): void = case+ gxs of
| list_cons (gx, gxs1) => let
val gx_cnf = grexp_cnfize(gx)
val () = list_vt_insert_at(cnfs, i, gx_cnf)
in
loop(gxs1, i+1, cnfs)
end // end of [list_cons]

| list_nil () => () //shouldn’t be reached

// end of [loop]

val () = loop(gxs, 0, cnfs)
in // in of let

cnfs
end //end of grexplst_cnfize_list_vt

/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3606(line=219, offs=19) – 3608(line=219, offs=21): error(parsing): the
syntactic entity [s0qua] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3605(line=219, offs=18) – 3606(line=219, offs=19): error(parsing): the
keyword ‘}’ is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3597(line=219, offs=10) – 3598(line=219, offs=11): error(parsing): the
keyword [=] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3588(line=219, offs=1) – 3591(line=219, offs=4): error(parsing): the
keyword [in] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3556(line=216, offs=15) – 3559(line=216, offs=18): error(parsing): the
syntactic entity [d0exp] is needed.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3508(line=214, offs=1) – 3517(line=214, offs=10): error(parsing): the
token is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3828(line=226, offs=1) – 3830(line=226, offs=3): error(parsing): the token
is discarded.
/home/brandon/ATS-Postiats/doc/PROJECT/TEMPORARY/FALCON/falcon_cnfize.dats:
3970(line=232, offs=1) – 3972(line=232, offs=3): error(parsing): the token
is discarded.