From jan.moringen at uni-bielefeld.de Wed Oct 13 18:07:44 2010 From: jan.moringen at uni-bielefeld.de (Jan Moringen) Date: Wed, 13 Oct 2010 20:07:44 +0200 Subject: [metacopy-devel] Structure sharing and unbound slots Message-ID: <10671_1286993266_ZZh0~6l8Pzqpg.00_1286993265.18949.20.camel@steed.robot-madness> Hi, thanks for metacopy, it's very useful. I have a small problem and associated suggestion to make, though. Currently the "duplicate-set" behavior actually has two behaviors (I'm not completely sure about the first one): * setting the slot value in the copied object to the result of evaluating an arbitrary form * setting the slot value in the copied object to the slot value in the original object such that they are `eq' and therefore share structure When used in the second mode, there is no check to make sure the slot is bound in the original object. Currently, this makes it impossible to have "safe" copying of slots without invoking the deep copy machinery. My suggestion is to separate the "duplicate-set" behavior into * a modified "duplicate-set" behavior (keyword :set) that does not access slots in the original object, but assigns the result of evaluating a form * a new "duplicate-share" behavior (keyword :share) that does a "safe" (nop if unbound) structure sharing assignment The attached patch roughly implements the suggestion. What do you think? Kind regards, Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: metacopy-add-share-duplicator.diff Type: text/x-patch Size: 4604 bytes Desc: not available URL: