Learning Perl 6. Keeping the Easy, Hard, and Impossible Within Reach - Helion
ISBN: 978-14-919-7764-4
stron: 476, Format: ebook
Data wydania: 2018-08-24
Księgarnia: Helion
Cena książki: 29,90 zł (poprzednio: 213,57 zł)
Oszczędzasz: 86% (-183,67 zł)
f you’re ready to get started with Raku (formerly Perl 6), this is the book you want, whether you’re a programmer, system administrator, or web hacker. Raku is a new language—a modern reinvention of Perl suitable for almost any task, from short fixes to complete web applications. This hands-on tutorial gets you started.
Author brian d foy (Mastering Perl) provides a sophisticated introduction to this new programming language. Each chapter in this guide contains exercises to help you practice what you learn as you learn it. Other books may teach you to program in Raku, but this book will turn you into a Raku programmer.
Learn how to work with:
- Numbers, strings, blocks, and positionals
- Files and directories and input/output
- Associatives, subroutines, classes, and roles
- Junctions and sets
- Regular expressions and built-in grammars
- Concurrency features: Promises, supplies, and channels
- Controlling external programs and other advanced features
Osoby które kupowały "Learning Perl 6. Keeping the Easy, Hard, and Impossible Within Reach", wybierały także:
- Think Perl 6. How to Think Like a Computer Scientist 213,57 zł, (29,90 zł -86%)
- Mastering Perl. 2nd Edition 175,88 zł, (29,90 zł -83%)
- Mastering Perl for Bioinformatics 175,88 zł, (29,90 zł -83%)
- Perl Cookbook. 2nd Edition 175,88 zł, (29,90 zł -83%)
- Games, Diversions & Perl Culture. Best of the Perl Journal 175,88 zł, (29,90 zł -83%)
Spis treści
Learning Perl 6. Keeping the Easy, Hard, and Impossible Within Reach eBook -- spis treści
- Preface
- The Backstory of Perl 6
- What You Should Already Know
- Getting Rakudo
- How to Use This Book
- How to Get Help
- Conventions Used in This Book
- Using Code Examples
- OReilly Safari
- How to Contact Us
- Acknowledgments
- 1. Introduction
- Why Perl 6?
- First Steps with the REPL
- Reading the Documentation
- Basic Syntax
- Terms
- Operators and Expressions
- Before, after, and around
- Precedence
- Statements
- Blocks
- Comments
- Unspace
- Objects and Classes
- Variables
- Simple Output
- Lexical Scope
- Predefined Variables
- Making and Running a Program
- Summary
- 2. Number Guessing
- Binding and Assignment
- A MAIN Program
- Program Arguments
- Prompting for Values
- Literal Numbers
- Formatting Numbers
- Numeric Operations
- Conditional Execution
- Boolean Values
- Short-circuit operators
- Comparing Things
- Chained comparisons
- Conditionally running a statement
- Conditional Branching
- Boolean Values
- Putting It All Together
- Summary
- 3. Numbers
- Number Types
- Integers
- Type Constraints
- Smart Matching
- Rational Numbers
- Imaginary and Complex Numbers
- Numbers Small and Large
- The Numeric Hierarchy
- Summary
- 4. Strings
- Literal Quoting
- Escaped Strings
- Adverbs for Quoting
- String Operators and Methods
- Looking Inside Strings
- Normal Form Grapheme
- String Comparisons
- Prompting for Input
- Number to String Conversions
- String to Number Conversions
- Interpolated Strings
- Here Docs
- Shell Strings
- Shell Safety
- Fancier Quoting
- Summary
- 5. Building Blocks
- Blocks
- Lexical Scope
- Control Structures
- Phasers
- The while structure
- Storing Blocks
- Blocks with Parameters
- Implicit parameters
- Explicit signatures
- Type constraints
- Simple Subroutines
- Named Subroutines
- Whatever Code
- Subsets
- Summary
- Blocks
- 6. Positionals
- Constructing a List
- Iterating All the Elements
- Reading lines of input
- Iterating All the Elements
- Ranges
- The @ Coercer
- Sequences
- Infinite Lazy Lists
- Gathering Values
- Single-Element Access
- Changing a Single Element
- Multiple-Element Access
- Arrays
- Constructing an Array
- Interpolating Arrays
- Array Operations
- Lists of Lists
- Flattening Lists
- Interesting Sublists
- Combining Lists
- The Zip Operator, Z
- The Cross Operator, X
- The Hyperoperators
- The Reduction Operator
- Filtering Lists
- Transforming a List
- Sorting Lists
- Sorting on Multiple Comparisons
- Summary
- Constructing a List
- 7. When Things Go Wrong
- Exceptions
- Catching Exceptions
- Backtraces
- Rethrowing Errors
- Throwing Your Own Exceptions
- Defining Your Own Exception Types
- Failures
- Warnings
- The Wisdom of Exceptions
- Summary
- Exceptions
- 8. Files and Directories, Input and Output
- File Paths
- File Test Operators
- File Metadata
- File times
- Linking and Unlinking Files
- Renaming and Copying Files
- Manipulating Directories
- Directory Listings
- Creating Directories
- Removing Directories
- Formatted Output
- Common Formatting Tasks
- The Standard Filehandles
- Standard Output
- Standard Error
- Standard Input
- Reading Input
- Reading Lines
- Reading a File
- Writing Output
- Opening a File for Writing
- Binary Files
- Moving Around
- Writing Binary Files
- Summary
- File Paths
- 9. Associatives
- Pairs
- Adverbs
- Modifying a Pair
- Maps
- Checking Keys
- Creating from a Positional
- Checking Allowed Values
- Hashes
- Accumulating with a Hash
- Multilevel Hashes
- Summary
- Pairs
- 10. Using Modules
- Installing Modules
- Loading Modules
- Finding the Module
- The lib pragma
- The environment
- The -I switch
- Lexical Effect
- Loading a Module at Runtime
- Interpolating module names
- Finding the Module
- Fetching Data from the Web
- Running Perl 5 in Perl 6
- Summary
- 11. Subroutines
- A Basic Subroutine
- Extra Arguments
- Explicit Returns
- Recursing
- Iterating Instead of Recursing
- Storing Subroutines in Libraries
- Exporting Subroutines
- Positional Parameters
- Slurpy Parameters
- Have It Both Ways
- Combining Slurpies
- Optional and Default Arguments
- Parameter Traits
- Parameter Constraints
- Same Name, Different Signature
- Literal Value Parameters
- Number of Arguments
- Parameter Types
- Named Parameters
- Required Named Parameters
- Named Parameters for Free
- Mixed Parameters
- Return Types
- Summary
- A Basic Subroutine
- 12. Classes
- Your First Class
- Defining Methods
- Private Methods
- Defining Subroutines
- Objects
- Private Attributes
- Public Attributes
- multi Methods
- Inheriting Types
- Checking Inheritance
- Stub Methods
- Controlling Object Creation
- Building Objects
- Tweaking Objects
- Private Classes
- Summary
- 13. Roles
- Adding Behavior to Classes
- Applying Multiple Roles
- Methods in Roles
- De-Conflicting Roles
- Anonymous Roles
- Summary
- Adding Behavior to Classes
- 14. Junctions and Sets
- Junctions
- any
- all
- one
- none
- Some Junctive Tricks
- Sets
- Set Operations
- Summary
- Junctions
- 15. Regular Expressions
- The Match Operator
- Match Operator Syntax
- Successful Matches
- Defining a Pattern
- Predefined Patterns
- Matching Nonliteral Characters
- Matching Any Character
- Escaping characters
- Matching literal spaces
- Matching Types of Characters
- Unicode properties
- Combining properties
- User-Defined Character Classes
- Character class ranges
- Negated character classes
- Matching Any Character
- Matching Adverbs
- Matching Either Case
- Ignoring Marks
- Global Matches
- Things That Use Patterns
- Substitutions
- Summary
- The Match Operator
- 16. Fancier Regular Expressions
- Quantifiers
- Zero or More
- Greediness
- Zero or One
- Minimal and Maximal
- Controlling Quantifiers
- Turning Off Backtracking
- Captures
- Named Captures
- A Capture Tree
- Backreferences
- Surrounders and Separators
- Assertions
- Anchors
- Conditions
- Code Assertions
- Matching an IPv4 address
- Alternations
- First Match
- Longest Token Matching
- Summary
- Quantifiers
- 17. Grammars
- A Simple Grammar
- Multiple Rules
- Debugging Grammars
- Grammar::Tracer
- Grammar::Debugger
- A Simple Action Class
- Creating an Abstract Syntax Tree
- Ratcheting
- Parsing JSON
- Parsing CSV
- Adjusting the Grammar
- Using Roles in Grammars
- Summary
- 18. Supplies, Channels, and Promises
- Supplies
- Multiple Taps
- Live Supplies
- Channels
- Promises
- Waiting for Promises
- Waiting for Multiple Promises
- Managing Your Own Promises
- Promise Junctions
- Reactive Programming
- Reacting in the Background
- Summary
- Supplies
- 19. Controlling Other Programs
- Quick and Easy
- Quoted Commands
- Safer Commands
- Writing to a Proc
- Procs
- Asynchronous Control
- Summary
- Quick and Easy
- 20. Advanced Topics
- One-Liners
- Declarator Block Comments
- Feed Operators
- Destructuring Signatures
- Defining Your Own Operators
- Perl 5 Patterns
- Shaped Arrays
- Typed Containers
- NativeCall
- The with Topicalizer
- 21. Conclusion
- Glossary
- A. Exercise Answers
- Answers to Preface Exercises
- Answers to Chapter 1 Exercises
- Answers to Chapter 2 Exercises
- Answers to Chapter 3 Exercises
- Answers to Chapter 4 Exercises
- Answers to Chapter 5 Exercises
- Answers to Chapter 6 Exercises
- Answers to Chapter 7 Exercises
- Answers to Chapter 8 Exercises
- Answers to Chapter 9 Exercises
- Answers to Chapter 10 Exercises
- Answers to Chapter 11 Exercises
- Answers to Chapter 12 Exercises
- Answers to Chapter 13 Exercises
- Answers to Chapter 14 Exercises
- Answers to Chapter 15 Exercises
- Answers to Chapter 16 Exercises
- Answers to Chapter 17 Exercises
- Answers to Chapter 18 Exercises
- Answers to Chapter 19 Exercises
- Index