From: Brian I. <in...@tt...> - 2004-01-06 21:34:25
|
On 30/12/03 18:06 +1300, Sam Vilain wrote: > Hi all, > > I think that using `tie' to hang out-of-band information to a data > structure, as YAML::Node does, is a poor choice of approach. There is > every possibility that a user has a data structure with ties that they > care about, which will be nuked AIUI... I'm not sure you understand how YAML::Node is intended to be used. It *is* used to hold out of band data, but not necessarily directly on the raw node in your data. There is a technique called "shadowing" that associates a YAML::Node with a raw node. I think this is what you want. See the YAML::Shadow() function. I'm on a flaky connection right now, so I can discuss this in length later if you still have doubts. Cheers, Brian > > What would be wrong with just using a hash in the YAML object doing > the dumping, from the reference address of the object (as returned by > Scalar::Util::refaddr) to the information? Stay as "hands-off" to the > data structure as possible. > > Otherwise, there is a good example of handing out-of-band information > off a reference without tie (using a custom mg_type) in the Info/ > directory of the Pixie distribution. It is a fairly simple XS module. > -- > Sam Vilain, sa...@vi... > > A meeting is an event at which the minutes are kept and the hours are > lost. > - anon. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Yaml-core mailing list > Yam...@li... > https://lists.sourceforge.net/lists/listinfo/yaml-core |