mac@uvacs.UUCP (12/01/83)
Does CLU still have the mutable/immutable value distinction? My impression was that certain system-defined types (immutable) are copied on assignment, but that structured data are assigned with pointers and shared (mutable). Thus after A:=B operations on B can change A iff they are of a mutable type. This feature occurs in languages with pointers. In Algol W record types were always referenced with pointers, hence mutable. I think it progress that in Pascal the notion of record has been separated from that of pointer. For that matter, I think early SETL (BALM-SETL) had this problem. The wary user had to do lots of copy().
gs@mit-eddie.UUCP (Gordon Strong) (12/06/83)
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
aaw@pyuxss.UUCP (12/07/83)
Please post the CLU example. I suggest this newsgroup could greatly benefit if subscribers using atypical languages would post examples of those languages. This is not a request for "merry christmas"/"peacefull iftar" in obscure dialects, but rather the suggestion that *programming shorts* in innovative languages would be a painless introduction to the issues the language design addresses. Criteria that should be considered before posting include: - does this language exist (compiler course subsets of pascal don't fit) - would people be interested - does the example demonstrate the features/faults of the language - is it annotated to allow a novice to understand - IS IT A REAL EXAMPLE (not a rude hack!) Thanks (waiting for some ALPHARD) {pyuxi,houxm,ihnp4}!pyuxss!aaw Aaron Werman