Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2019 - Pattern Matching - New feature in Ruby 2.7 by Kazuki Tsujimoto Ruby core team plans to introduce pattern matching as an experimental feature in Ruby 2.7. In this presentation, we will talk about the current proposed syntax and its design policy. #confreaks #rubyconf2019
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this talk presented by Kazuki Tsujimoto at RubyConf 2019, the focus is on the introduction of pattern matching as an experimental feature in Ruby 2.7. Tsujimoto, a member of the Ruby core team and the proposer of this feature, discusses the proposed syntax and design philosophy guiding its implementation. Key points covered during the presentation include: - **Definition and Functionality**: Pattern matching is described as an advanced combination of case statements and multiple assignments, enabling developers to check object structures with patterns. - **Implementation Use Cases**: Practical examples illustrate how pattern matching can be applied to real JSON data, simplifying the syntax for complex condition checks. - **Specifications**: The syntax is aligned with existing Ruby case statements and allows for both sequential pattern evaluations and complexity through additional conditions. - **Types of Patterns**: Tsujimoto elaborates on six distinct patterns within Ruby's pattern matching: - **Equality Compare**: Uses the ‘===’ method for simple comparisons. - **Variable Patterns**: Binds values from patterns for reference. - **Caution on Shadowing**: Discusses how to avoid variable name conflicts using the caret (^) symbol. - **Alternative Patterns**: Matches any of the given patterns. - **Destructuring Patterns**: Extracts values from data structures, enhancing usability. - **Hash Key Patterns**: Retrieves values based on specified keys in hashes. - **Design Philosophy**: The Ruby team emphasizes compatibility with existing code, user-friendly interface, and operational performance as core guiding principles for the development of pattern matching. They aim to minimize disruption to current Ruby practices while providing a powerful new feature. The talk concludes with a call for community feedback, encouraging Ruby developers to experiment with pattern matching and help shape its future. Tsujimoto expresses excitement for the potential impact of this feature on Ruby programming. This session not only introduces a significant enhancement to Ruby but also highlights the collaborative and iterative nature of software development within the Ruby community.
Suggest modifications
Cancel