Hi Hongwei,
On Sat, May 9, 2015 at 8:51 PM, Hongwei Xi <
gmh...@gmail.com> wrote:
> It is in ${PATSHOME}/libc/SATS/stdio.sats; it is called FILE_v.
Thank's. I got some progress.
https://github.com/master-q/ATS-Postiats/tree/feature/atsdoc
But I have found the other error. How to fix it?
The error is following:
```
$ make |& head -2
/home/kiwamu/src/ATS-Postiats.masterq/bin/patscc -g -O2 -c atsdoc_main.dats
/home/kiwamu/src/ATS-Postiats.masterq/utils/atsdoc/atsdoc_main.dats:
3191(line=103, offs=29) -- 3203(line=103, offs=41): error(3): the
dynamic expression is expected to be a pointer.
```
And code is following:
```
implement
comarglst_parse
{n} (argc, argv) = let
viewtypedef arglst (n: int) = list_vt (comarg, n)
fun loop {i:nat | i <= n} {l:addr} .<n-i>.
(pf0: arglst 0 @ l | argv: &(@[string][n]), i: int i, p: ptr l)
:<cloref> (arglst (n-i) @ l | void) =
if i < argc then let
val+ ~list_vt_nil () = !p
val arg = comarg_parse (argv.[i])
val lst0 = list_vt_cons (arg, list_vt_nil ())
val+ list_vt_cons (_, lst) = lst0
val (pf | ()) = loop (view@ (!lst) | argv, i+1, lst) // <= Here!
in
fold@ lst0; !p := lst0; (pf0 | ())
end else (pf0 | ())
val lst0 = list_vt_nil {comarg} ()
val (pf | ()) = loop (view@ lst0 | argv, 0, lst0) // tail-call
prval () = view@ lst0 := pf
in
lst0
end // end of [comarglst_parse]
```