From: Robert Date: 2003-05-01T02:35:42+09:00 Subject: Re: How to undefine a member variable ? (or at least hide it from YAML) "Simon Vandemoortele" schrieb im Newsbeitrag news:0gKra.68148$t_2.6175@afrodite.telenet-ops.be... > On Tue, 29 Apr 2003 at 07:17 GMT, Robert wrote: > > >> However, I'd prefer a solution on YAML level for this problem. This is > >> really a 'hack'; I should be able to tell YAML: don't save 'nil' values > >> please (pretty, with sugar on top). > > > That's exactly what I'd prefer, too. Do you really have performance or > > space problems because of all those unused fields? > > No performance or space problem. Simply a matter of principle: YAML is > supposed to be user readable and that readability will be greatly > diminished with useless (empty) entries. Besides; I can't believe YAML > people have not encountered (and solved ?) this problem yet. In fact, I > am surprised we haven't had a response by some YAML expert ... I'm not a YAML expert, but I'd say YAML does what it is supposed to do: it mirrors current instance state 1:1. If a variable is nil then it's something different from being undefined and exactly that is reflected in the output. Maybe you can increase user readablility by some YAML option and / or by inserting newlines as a postprocessing stage? robert