[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: APPLYHOOK-ENVIRONMENT (Version 1)
- To: cl-cleanup@sail.stanford.edu
- Subject: Issue: APPLYHOOK-ENVIRONMENT (Version 1)
- From: masinter.pa@Xerox.COM
- Date: 6 Jan 89 11:49 PST
!
Forum: Cleanup
Issue: APPLYHOOK-ENVIRONMENT
References: APPLYHOOK (CLtL p. 323)
Category: CHANGE
Edit history: Masinter, 6-Jan-89, Version 1
Problem description:
The function APPLYHOOK is documented to take an optional environment
argument. CLtL says "Furthermore, the env argument is used as the lexical
environment for the operation; env defaults to the null environment."
However, there is no way that the lexical environment can effect the way in
which APPLYHOOK processes its arguments; it merely calls the specified
function, and function call is not affected by lexical environments. (The
"function" argument to APPLYHOOK is a function object.)
This has been regularly a source of confusion for programmers encountering
APPLYHOOK.
Proposal (APPLYHOOK-ENVIRONMENT:REMOVE-ENV): Remove the optional "ENV"
argument to applyhook.
Rationale:
Removes a very minor wart.
Current practice:
Most implementations accept an extra argument and then ignore it.
Cost to Implementors:
Remove optional ENV argument from APPLYHOOK and any code that passes one to
APPLYHOOK.
Cost to Users:
Remove any ENV argument passed to APPLYHOOK.
Cost of non-adoption:
Continued confusion.
Performance impact:
None
Benefits:
Removes a wart.
Esthetics:
Minor improvement.
Discussion:
This was discussed on the Common Lisp mailing list several years ago, but
slipped thru the cracks.