FILEref is abstract; it is just FILE* in C. As it is non-linear, you
need to remember to close an opened file handle of this type.

BTW, FILEptr is linear; so the type system help you keep track of
file handles of the type FILEptr.

--Hongwei

PS: I often use FILEref first. If needed later, I can always change
it to FILEptr and the typechecker will then lead me to all the places
where subsequent changes are needed for such a change.

On Sunday, July 11, 2021 at 8:02:39 PM UTC-4 d4v3y_5c0n3s wrote:

> Just a quick question: I noticed that the "FILEREF" type in ATS is 
> non-linear.  Does this mean that I need to enable garbage collection to 
> work with files?  Or is the value freed but hidden from the linear type 
> system?

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/c521ce5b-a311-4d65-a1a3-669b1488c2b2n%40googlegroups.com.

Reply via email to