[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
define and set! with multiple-values I think I've changed my mind.
- To: bhyde@gensym.com
- Subject: define and set! with multiple-values I think I've changed my mind.
- From: Glenn S. Burke <gsb>
- Date: Mon, 4 Jan 93 13:36:07 -0500
- Cc: info-dylan@cambridge.apple.com
- In-reply-to: Ben A. Hyde's message of Mon, 4 Jan 93 10:47:38 EST <9301041547.AA01968@gensym.com>
Date: Mon, 4 Jan 93 10:47:38 EST
From: bhyde@gensym.com (Ben A. Hyde)
As far as I know it is not possible to implement safe
multiple values with out requiring many functions also set a value
count. Thus:
(defun foo (x)
(+ x x))
must set the value count to as well as do the tiny bit of work
required to do the addition. Meanwhile
(defun bar (x)
(gum x))
doesn't have to set it.
Wrong. It can be implemented without penalizing the simple cases.
Only the case where other than one value needs to be recognized costs
more.
Notice this is the worse kind of purity v.s. efficiency trade off.
We are taxing most functions for a cost that benefits only a
very few functions. Second, this cost can not be eliminated by a
compiler switch that proclaims that we want to run unsafe.
---------------------------------------------------------------------------
Glenn S. Burke | gsb@cambridge.apple.com
Phone: 617/374-5313 | Applelink: GSB