Re: Prefer CLOS over closures that modify variables they close over?
- From: stamant@xxxxxxxx (Rob St. Amant)
- Date: Thu, 24 May 2007 20:17:27 -0400
Pillsy <pillsbury@xxxxxxxxx> writes:
On May 24, 1:30 pm, "ricky.clark...@xxxxxxxxx"
<ricky.clark...@xxxxxxxxx> wrote:
It appears that I've misrepresented the channel here, so you may
disregard the above in terms of how it paints #lisp, but I'm still
interested to see why and when various people would use CLOS over a
closure.
If it were something that simple, I'd probably just make it a closure.
I haven't really thought about why too much, beyond the fact that it
feels like the most natural abstraction to use. You call a function,
you get the number of times it's been called, and it's all very
simple.
Actually, if it were that simple, I expect most Lispers would write
(let ((x 0))
(incf x (<function call>)))
rather than passing a closure as an argument to modify x. I assume
the real scenario is more complicated, of course.
.
- References:
- Prefer CLOS over closures that modify variables they close over?
- From: ricky.clarkson@xxxxxxxxx
- Re: Prefer CLOS over closures that modify variables they close over?
- From: ricky.clarkson@xxxxxxxxx
- Re: Prefer CLOS over closures that modify variables they close over?
- From: Pillsy
- Prefer CLOS over closures that modify variables they close over?
- Prev by Date: Re: Dumbing down?
- Next by Date: Re: Followup Question 1: What is a hacker?
- Previous by thread: Re: Prefer CLOS over closures that modify variables they close over?
- Next by thread: Re: Prefer CLOS over closures that modify variables they close over?
- Index(es):
Relevant Pages
|