staload, paths, and infix operators

2018-04-02 Thread M88
I have two questions... The first is that path resolution seems to have changed from ATS2 0.3.7 and 0.3.9. I used to be able to write 'staload "sats/foo.sats"' in "dats/foo.dats" and running patscc from the project root would find the file. Now it seems I need to write 'staload "./../sats/foo.

Re: Puzzling infinite loop in template code

2018-04-02 Thread Hongwei Xi
This is caused by a known tail-call optimization bug. You can circumvent the bug by adding some do-nothing code: implement(a) myprint(x) = let val f = myprint in f(x); f(x); () where { val () = () } // do nothing end On Mon, Apr 2, 2018 at 8:18 AM, Andrew Knapp wrote: > I

Puzzling infinite loop in template code

2018-04-02 Thread Andrew Knapp
I can't figure out why this code loops forever. Is it a bug in the compiler? #include "share/atspre_staload.hats" #include "share/atspre_define.hats" staload UN = "prelude/SATS/unsafe.sats" abst0ype foo(a:t0ype) = lint abst0ype twice(a:t0ype) = int extern fun{a:t@ype} myprint (x: string): void