From: Gennady Bystritsky Date: 2009-01-30T14:31:39+09:00 Subject: YAML to anchor same strings in dumps --_000_6592BDAF72405343BA096C66B735B38E016C1C74B5alvxmbw04prod_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, there Is there any way to make YAML alias same strings in dumps? The following co= de fragment: require 'yaml' s =3D 'a' * 10 puts [ s, s ].to_yaml Produces this: --- - aaaaaaaaaa - aaaaaaaaaa While I need: --- - &id001 aaaaaaaaaa - *id001 Interestingly, if I define s as: s =3D [ 'a' * 10 ] The output is aliased just fine: --- - &id001 - aaaaaaaaaa - *id001 Thanks, Gennady. --_000_6592BDAF72405343BA096C66B735B38E016C1C74B5alvxmbw04prod_--