You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/news/_posts/2019-04-20-ruby-2-7-0-preview1-released.md
+44-15Lines changed: 44 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,6 @@ Some multithread Ruby programs may cause memory fragmentation, leading to high m
23
23
24
24
The `GC.compact` method is introduced for compacting the heap. This function compacts live objects in the heap so that fewer pages may be used, and the heap may be more CoW friendly. [#15626](https://bugs.ruby-lang.org/issues/15626)
25
25
26
-
Known issues: It may cause segmentation faults if MJIT is enabled. Please avoid using both Compaction GC and MJIT at the same time.
27
-
28
26
## Pattern Matching [Experimental]
29
27
30
28
Pattern matching, widely used feature in functional programming languages, is introduced as an experimental feature. [#14912](https://bugs.ruby-lang.org/issues/14912)
For more details, please see https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7.
40
+
41
41
## REPL improvement
42
42
43
43
`irb`, bundled interactive environment (REPL; Read-Eval-Print-Loop), now supports multi-line editing. It's powered by `reline`, `readline` compatible pure Ruby implementation.
44
-
It also provides rdoc integration. In `irb` you now can display the reference for a given class, module, or method. [#14683](https://bugs.ruby-lang.org/issues/14683)[#14787](https://bugs.ruby-lang.org/issues/14787)[#14918](https://bugs.ruby-lang.org/issues/14918)
44
+
It also provides rdoc integration. In `irb` you can display the reference for a given class, module, or method. [#14683](https://bugs.ruby-lang.org/issues/14683), [#14787](https://bugs.ruby-lang.org/issues/14787), [#14918](https://bugs.ruby-lang.org/issues/14918)
45
+
Besides, source lines shown at `binding.irb` and inspect results for core-class objects are now colorized.
* A method reference operator, <code>.:</code>, is introduced as an experimental feature. [#12125](https://bugs.ruby-lang.org/issues/12125)[#13581](https://bugs.ruby-lang.org/issues/13581)
53
+
* A method reference operator, <code>.:</code>, is introduced as an experimental feature. [#12125](https://bugs.ruby-lang.org/issues/12125),[#13581](https://bugs.ruby-lang.org/issues/13581)
53
54
54
55
* Numbered parameter as the default block parameter is introduced as an experimental feature. [#4475](https://bugs.ruby-lang.org/issues/4475)
55
56
56
57
* A beginless range is experimentally introduced. It might not be as useful
57
-
as an endless range, but would be good for DSL purpose. [14799](https://bugs.ruby-lang.org/issues/14799)
58
+
as an endless range, but would be good for DSL purpose. [#14799](https://bugs.ruby-lang.org/issues/14799)
58
59
59
60
ary[..3] # identical to ary[0..3]
60
-
where(sales: ..100)
61
+
rel.where(sales: ..100)
62
+
63
+
*`Enumerable#tally` is added. It counts the occurrence of each element.
64
+
65
+
["a", "b", "c", "b"].tally
66
+
#=> {"a"=>1, "b"=>2, "c"=>1}
61
67
62
68
## Performance improvements
63
69
@@ -73,18 +79,18 @@ It also provides rdoc integration. In `irb` you now can display the reference fo
73
79
74
80
## Other notable changes since 2.6
75
81
76
-
* Proc.new and proc with no block in a method called with a block is warned now.
82
+
*`Proc.new` and `proc` with no block in a method called with a block is warned now.
77
83
78
-
* lambda with no block in a method called with a block errs.
84
+
*`lambda` with no block in a method called with a block errs.
79
85
80
-
* Update Unicode version and Emoji version from 11.0.0 to 12.0.0. [Feature #15321]
86
+
* Update Unicode version and Emoji version from 11.0.0 to 12.0.0. [[Feature #15321]](https://bugs.ruby-lang.org/issues/15321)
81
87
82
-
* Update Unicode version to 12.1.0, adding support for U+32FF SQUARE ERA NAME REIWA. [Feature #15195]
88
+
* Update Unicode version to 12.1.0, adding support for U+32FF SQUARE ERA NAME REIWA. [[Feature #15195]](https://bugs.ruby-lang.org/issues/15195)
83
89
84
-
* Date.jisx0301, Date#jisx0301, and Date.parse provisionally support the new Japanese era as an informal extension, until the new JIS X 0301 is issued. [Feature #15742]
90
+
*`Date.jisx0301`, `Date#jisx0301`, and `Date.parse` provisionally support the new Japanese era as an informal extension, until the new JIS X 0301 is issued. [[Feature #15742]](https://bugs.ruby-lang.org/issues/15742)
85
91
86
-
* Require compilers to support C99 [Misc #15347]
87
-
* Details of our dialect: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99
92
+
* Require compilers to support C99 [[Misc #15347]](https://bugs.ruby-lang.org/issues/15347)
93
+
* Details of our dialect: <https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99>
88
94
89
95
See [NEWS](https://github.com/ruby/ruby/blob/v2_7_0_preview1/NEWS) or [commit logs](https://github.com/ruby/ruby/compare/v2_6_0...v2_7_0_preview1) for more details.
90
96
@@ -94,7 +100,30 @@ Enjoy programming with Ruby 2.7!
* Date.jisx0301, Date#jisx0301, および Date.parse で非公式に新元号に仮対応しました。これは JIS X 0301 の新しい版で正式な仕様が決定されるまでの暫定的なものです。[Feature #15742]
87
+
*`Date.jisx0301`, `Date#jisx0301`, および `Date.parse` で非公式に新元号に仮対応しました。これは JIS X 0301 の新しい版で正式な仕様が決定されるまでの暫定的なものです。[[Feature #15742]](https://bugs.ruby-lang.org/issues/15742)
0 commit comments