Skip to content
Prev 32388 / 63424 Next

reference counting problem in .Primitive's?

On Thu, 23 Apr 2009, William Dunlap wrote:

            
You are probably right.  I have not yet looked at the code but am
virtually certain it does not try to temporarily bump up the NAMED
values on argument values.  Doing so would cure this but probably at
serious cost to performance, as NAMED values of 2 cannot be brought
down again and so cause copying on next modify. (Might be worth
running some tests on that though to see what the cost would be).

I'm not sure if it is written anywhere that argunments of primitives
(BUILTINS in articular as those are always strict; SPECIALS can be
non-strict but log is strict) are evaluated in any particular order.
All these examples are consistent with _some_ evaluation order, but
not the same one.  It might be possible to show that the results
obtained in these situations will always be consistent with some
evaluation order, in which case documenting that order of evaluation
is unspecified would be good enough form me.  It may also be possible
that an order that does compound expressions first and then symbols
would also solve the issue (I don't think I would want to do this in
the interpreter though because of the performance overhead.)

luke