[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
implied contracts in the mapping functions?
- To: Fahlman@CMU-CS-C, GSB@MIT-ML
- Subject: implied contracts in the mapping functions?
- From: Robert A. Cassels <Cassels%SCRC-TENEX@MIT-MC>
- Date: Sun, 18 Sep 1983 03:08:00 -0000
- Cc: common-lisp@SU-AI
- In-reply-to: The message of 17 Sep 83 21:23-EDT from Scott E. Fahlman <Fahlman at CMU-CS-C>
Date: Sat, 17 Sep 1983 21:23 EDT
From: Scott E. Fahlman <Fahlman@CMU-CS-C.ARPA>
I think that "it is an error" to destructively mess around with a list
after it has been fed to MAPCAR or even to DOLIST. The fact that most
implementations would do this in a certain way and the user can guess
what that way is should not matter. If we let people twiddle hidden
state and count on the results, there will be no safe optimizations
left, and all Common Lisp implementations will slow down by a
considerable factor.
I agree that it ought to be "an error" or left undefined
(implementation-dependent). Other languages with looping constructs
have run into this problem, and most have decided to admit that there is
"hidden state" which is implementation-dependent.