From: Thomas Sawyer Date: 2011-11-09T03:29:40+09:00 Subject: [ruby-core:40855] [ruby-trunk - Feature #5578] Embedded YAML for Ruby 2.0 Issue #5578 has been updated by Thomas Sawyer. @kurt "Why does YAML need first class status?" On the surface it's just more elegant. e.g. x = --- a: 1 b: 2 ... vs. x = YAML %{ a: 1 b: 2 } But see my last post about the potential for deeper integration. In short, the later can only ever handle a string. Integrating YAML more deeply could allow for Ruby objects to be inserted directly into the YAML structure. --- time: ->{ Time.now } ... Would be equivalent too { 'time' => Time.now } Why would you want to do that? For the very reasons we like YAML. It is an easy to read and concise format, especially when the data structure gets a little bit more nested than just a couple of elements (unlike the examples above). Note also that JSON is a subset of YAML. So if Ruby supported YAML natively, it would also support JSON natively --just like Javascript. ---------------------------------------- Feature #5578: Embedded YAML for Ruby 2.0 http://redmine.ruby-lang.org/issues/5578 Author: Thomas Sawyer Status: Open Priority: Normal Assignee: Category: Target version: 2.0.0 Way cool would be support for embedded YAML. data = --- a: 1 b: 2 c: 3 ... -- http://redmine.ruby-lang.org