[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

implied contracts in the mapping functions?

    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.