Path: utzoo!utgpu!watserv1!watmath!att!att!emory!sol.ctr.columbia.edu!caen!sdd.hp.com!ucsd!ucbvax!iwtqg.att.com!nowlin From: nowlin@iwtqg.att.com Newsgroups: comp.lang.icon Subject: Re: Uses of dynamic typing Message-ID: <9011172202.AA14204@megaron.cs.arizona.edu> Date: 17 Nov 90 21:39:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 35 > than just prove something? I have three specific examples. The first is the use of the types "null" and "file" in programs that can read input from files or from standard input. The same expressions can be used for input if the variable used as a file is set to &null when reading from standard input. I've used this many times. The same kind of scheme can be used for output. The second example is a set of procedures that does regular expression matching. It uses a list of records. Each record contains a pair of values; a procedure and an argument to be passed to the procedure. Sometimes the argument is a string, sometimes it's a cset, and sometimes it's &null. Icon doesn't care which I store as the second value in the record. The third use is a set of procedures I wrote for a friend. These procedures allow a series of global variables to be dumped into a file. A complementary set of procedures can read the dump file and reconstruct the global variables with the same values as the program that dumped them. These procedures are used to chain together a series of programs. This would require a whole series of different variables if Icon didn't allow me to use the same variable over and over with different types each time. Very handy. As a side note we've just recently achieved a breakthrough at work (AT&T) and we're now allowed to use Icon for "real" projects. It's great. Our methodology calls for code inspections and those of us who are familiar with Icon initially thought Icon would be much easier to code inspect than C++ or C. WRONGO! The tie in to this subject is that dynamic typing may contribute to the problem. It just seems counter intuitive that Icon would be harder to inspect but after our initial session that was definitely my impression. I'll try to figure out why on my own but if anyone has any ideas throw them out. Jerry Nowlin (iwtqg!nowlin)