ATS. How to compile non void function?

72 Views Asked by At

I'm a newbie in ML languages. I'm reading the ATS manual and I in mad now. I read half of manual and there is no explanation in it how to compile a non-void function.

Only one example with "hello world" program.

ats
val x = "hello"

implement main0 () = print x

But if I change x to 2 * 2 it will raise an error.

Should I read the manual without capability to compile code and test it? Disgusting.

1

There are 1 best solutions below

0
On

You need the following line for some library functions:

#include "share/atspre_staload.hats"

ATS may not be a good language for beginners as it assumes a fair amount of knowledge of ML and C.