Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!gb17+ From: gb17+@andrew.cmu.edu (George Thomas Baggott) Newsgroups: comp.lang.misc Subject: side effects Message-ID: Date: 21 Jul 89 21:30:07 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 19 In a truly functional language (i.e. no side effects at all), a function for altering a large data structure (adding an entry to a dictionary, for example) would be written as: dictionary_add(dictionary, entry) returns dictionary; /* return a copy of dictionary with entry added to it */ This is very costly, however. If side effects were allowed, you could do it at a much smaller cost: dictionary_add(dictionary, entry); /* add entry to dictionary */ Is there some way to have a language with no side effects, yet still be able to solve this class of problems in a practical way? If not what is the minimum amount of comprimise that must be made? George