NEWS for Ruby 1.9.1

本文件列出了版本之间用户可见的功能变更,不包括错误修复。

请注意,每个条目都非常简短,没有提供任何原因或参考信息。有关所有足够信息的完整变更列表,请参阅 ChangeLog 文件。

自 1.8.7 版本以来的变更

有关 1.8.6 和 1.8.7 之间的变更,请参阅 doc/NEWS-1.8.7。

兼容性问题

语言核心变更

* New syntax and semantics
      o Magic comments to declare in which encoding your source
        code is written
      o New literal hash syntax and new syntax for hash style
        arguments
      o New syntax for lambdas
      o .() and calling Procs without #call/#[]
      o Block in block arguments
      o Block local variables
      o Mandatory arguments after optional arguments allowed
      o Multiple splats allowed
      o #[] can take splatted arguments, hash style arguments
        and a block.
      o New directives in printf-style formatted strings (%).
      o Newlines allowed before ternary colon operator (:) and
        method call dot operator (.)
      o Negative operators such as !, != and !~ are now
        overloadable
      o Encoding.default_external and default_internal
      o __ENCODING__: New pseudo variable to hold the current
        script's encoding

库更新

实现变更