Syntax spec? (Let vs where)

38 views
Skip to first unread message

Raoul Duke

unread,
May 6, 2016, 3:26:43 PM5/6/16
to ats-lang-users

Hi, I looked a bit but failed to find a language syntax spec, to help advertise / answer questions about ATS features & syntax. Please consider making it more findable? :-)

I see let-in but is there support for where (which I overall much prefer)?

Thank you.

gmhwxi

unread,
May 6, 2016, 4:42:48 PM5/6/16
to ats-lang-users
It is buried pretty deep:

http://ats-lang.sourceforge.net/htdocs-old/RESOURCE/resource.html
http://ats-lang.sourceforge.net/htdocs-old/DOCUMENT/GRAMMAR/ats_grammar_desc.html

Here is an example:

fun fact(n: int): int = fact2(n, 1) where
{
//
fun fact2(n: int, res:int): int = if n > 0 then fact2(n-1, n*res) else res
//

Raoul Duke

unread,
May 6, 2016, 4:43:54 PM5/6/16
to ats-lang-users
thanks!
Reply all
Reply to author
Forward
0 new messages