🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Kernel Account Wed, 22 Jul 1992 02:20
Ada-like "PRIVATE" Types in SML?
#7
Author: Kernel Account
Date: Wed, 22 Jul 1992 02:20
40 lines
1441 bytes
I don't have _good_ reference material for SML, so here goes:

If I am creating a module with a signature (see example), how can I  
effectively hide the declaration of a datatype referred to in the sig?   
I want to make file_contents_type "private," ala Ada.  Is this even  
possible?

Example (pseudo-SML source)
---------------------------

structure MyModule:
  sig
	(* How can I do the following in SML?
	   datatype file_contents_type is private
	*)

	datatype file =
	  emptyfile
	| opened of {
		     (*some other fields here*)
		     contents:file_contents_type
		    };

	(*some other things in the sig here*)
  end =

  struct
	(* definition of file_contents_type here *)

	(* rest of definitions *)
end;


Please email replies to kleinjf@cs.rose-hulman.edu


Joel F. Klein

B.T.W., why is there so little activity in alt.lang.ml?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads