Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!linus!decvax!harpo!floyd!clyde!ihnp4!mit-eddie!gs From: gs@mit-eddie.UUCP (Gordon Strong) Newsgroups: net.lang Subject: Re: CLU mutations Message-ID: <1004@mit-eddie.UUCP> Date: Tue, 6-Dec-83 09:27:49 EST Article-I.D.: mit-eddi.1004 Posted: Tue Dec 6 09:27:49 1983 Date-Received: Fri, 9-Dec-83 01:46:53 EST References: <1084@uvacs.UUCP> Organization: MIT, Cambridge, MA Lines: 20 You've basically got it right on CLU mutations. For those of you who haven't used CLU, there are mutable and immutable data types available for use. For example, an array is mutable (and they can grow dynamically). An immutable array is called a sequence. Other types are records and variants (mutable) corresponding to structs and oneofs (immutable). You can always define your own data types in addition to the ones provided. Creating your own data types is winning because you can use them to make abstractions. Modular programming using abstractions is a very good way of writing large programs. For example, you might want to have a stack abstraction. Typical operations might be create, push, pop, and empty. You don't have to know anything about how it is implemented, just the interface. This enables you to say things like: stack$create(), stack$push(s,n), etc. If anyone wants to see more of an example on CLU usage, I will post the implementation of the stack abstraction (it's real short). -- Gordon Strong decvax!genrad!mit-eddie!gs GS@MIT-XX