ATS2TUTORIAL: boxed tuples and records

33 views
Skip to first unread message

gmhwxi

unread,
Dec 13, 2015, 10:56:53 AM12/13/15
to ats-lang-users

I added a chapter in the ATS2TUTORIAL book:

http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.html

It about forming boxed tuples and records with read-only fields as well as fields that may be
updated.

Cheers!

--Hongwei

gmhwxi

unread,
Dec 13, 2015, 10:57:29 AM12/13/15
to ats-lang-users

It is currently Chapter 15.

Yannick Duchêne

unread,
Dec 13, 2015, 12:58:03 PM12/13/15
to ats-lang-users
Out of topic, still related to tuple and records, this thread reminds me something I wanted to try. Just checked it's OK:

One can do …
extern fn f(a:int, b:int): int
val a
= f(0, 1)
… which does not allow to name parameters.

A common SML idiom works with ATS too:
extern fn g(@{a=int, b=int}): int
val b
= g@{a=0, b=1}
… which gives named parameters.

(don't know it it impacts the generated code a lot or not)

Barry Schwartz

unread,
Dec 13, 2015, 5:40:41 PM12/13/15
to 'Yannick Duchêne' via ats-lang-users
'Yannick Duchêne' via ats-lang-users <ats-lan...@googlegroups.com> skribis:
> Out of topic, still related to tuple and records, this thread reminds me
> something I wanted to try. Just checked it's OK:
>
> One can do …
> extern fn f(a:int, b:int): int
> val a = f(0, 1)
> … which does not allow to name parameters.
>
> A common SML idiom works with ATS too:
> extern fn g(@{a=int, b=int}): int
> val b = g@{a=0, b=1}
> … which gives named parameters.
>
> (don't know it it impacts the generated code a lot or not)

That’s a really good idea IMO, as long as one is happy to have
parameters passed as structs by value.

Mike Jones

unread,
Dec 27, 2015, 5:25:04 PM12/27/15
to ats-lang-users
Could you gen a pdf? I'd like to take a copy to read on a flight.

Thx,

Mike

Yannick Duchêne

unread,
Dec 27, 2015, 6:03:41 PM12/27/15
to ats-lang-users
Just a quick answer: some browsers have a “print to PDF”  feature, if I'm not wrong (at least, Opera does).

Mike jones

unread,
Dec 27, 2015, 7:38:58 PM12/27/15
to ats-lan...@googlegroups.com
I'm not sure how to do that on an iPad. Typically I pull PDFs into Good Reader from the web and then read when I'm traveling. They also markup well in Good Reader. I suppose I could make a PDF on a laptop and find a way to transfer it to my iPad. I. Guess I'm biased toward PDFs and mobile devices because I'm often moving around.

Sent from my iPad
--
You received this message because you are subscribed to a topic in the Google Groups "ats-lang-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ats-lang-users/GoCw5--amAM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/6221cfe9-e252-457c-ba8e-0a334d7304ef%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages