TIENE EN SU CESTA DE LA COMPRA
en total 0,00 €
Want to learn how to program and think like a computer scientist? This practical guide gets you started on your programming journey with the help of Perl 6, the younger sister of the popular Perl programming language. Ideal for beginners, this hands-on book includes over 100 exercises with multiple solutions, and more than 1,000 code examples so you can quickly practice what you learn. Experienced programmers-especially those who know Perl 5-will also benefit.
Divided into two parts, Think Perl 6 starts with basic concepts that every programmer needs to know, and then focuses on different programming paradigms and some more advanced programming techniques. With two semesters' worth of lessons, this book is the perfect teaching tool for computer science beginners in colleges and universities.
Learn basic concepts including variables, expressions, statements, functions, conditionals, recursion, and loops
Understand commonly used basic data structures and the most useful algorithms
Dive into object-oriented programming, and learn how to construct your own types and methods to extend the language
Use grammars and regular expressions to analyze textual content
Explore how functional programming can help you make your code simpler and more expressive
Starting with the Basics
Chapter 1The Way of the Program
What Is a Program?
Running Perl 6
The First Program
Arithmetic Operators
Values and Types
Formal and Natural Languages
Debugging
Glossary
Exercises
Chapter 2Variables, Expressions, and Statements
Assignment Statements
Variable Names
Expressions and Statements
Script Mode
One-Liner Mode
Order of Operations
String Operations
Comments
Debugging
Glossary
Exercises
Chapter 3Functions
Function Calls
Functions and Methods
Math Functions
Composition
Adding New Functions (a.k.a. Subroutines)
Definitions and Uses
Flow of Execution
Parameters and Arguments
Variables and Parameters Are Local
Stack Diagrams
Fruitful Functions and Void Functions
Function Signatures
Immutable and Mutable Parameters
Functions and Subroutines as First-Class Citizens
Why Functions and Subroutines?
Debugging
Glossary
Exercises
Chapter 4Loops, Conditionals, and Recursion
Integer Division and Modulo
Boolean expressions
Logical Operators
Conditional Execution
Alternative Execution
Chained Conditionals
Nested Conditionals
if Conditionals as Statement Modifiers
Unless Conditional Statement
for Loops
Recursion
Stack Diagrams for Recursive Subroutines
Infinite Recursion
Keyboard Input
Program Arguments and the MAIN Subroutine
Debugging
Glossary
Exercises
Chapter 5Fruitful Subroutines
Return Values
Incremental Development
Composition
Boolean Functions
A Complete Programming Language
More Recursion
Leap of Faith
One More Example
Checking Types
Multi Subroutines
Debugging
Glossary
Exercises
Chapter 6Iteration
Assignment Versus Equality
Reassignment
Updating Variables
The while Statement
Local Variables and Variable Scoping
Control Flow Statements (last, next, etc.)
Square Roots
Algorithms
Debugging
Glossary
Exercises
Chapter 7Strings
A String Is a Sequence
Common String Operators
String Traversal with a while or for Loop
Looping and Counting
Regular Expressions (Regexes)
Using Regexes
Building your Regex Patterns
Putting It All Together
Substitutions
Debugging
Glossary
Exercises
Chapter 8Case Study: Word Play
Reading from and Writing to Files
Reading Word Lists
Exercises
Search
Debugging
Glossary
Exercises
Chapter 9Arrays and Lists
Lists and Arrays Are Sequences
Arrays Are Mutable
Adding New Elements to an Array or Removing Some
Stacks and Queues
Other Ways to Modify an Array
Traversing a List
New Looping Constructs
Map, Filter, and Reduce
Fixed-Size, Typed, and Shaped Arrays
Multidimensional Arrays
Sorting Arrays or Lists
More Advanced Sorting Techniques
Debugging
Glossary
Exercises
Chapter 10Hashes
A Hash Is a Mapping
Common Operations on Hashes
Hash as a Collection of Counters
Looping and Hashes
Reverse Lookup
Testing for Existence
Hash Keys Are Unique
Hashes and Arrays
Memos
Hashes as Dispatch Tables
Global Variables
Debugging
Glossary
Exercises
Chapter 11Case Study: Data Structure Selection
The Ternary Conditional Operator
The given ... when "Switchö Statement
Subroutine Named and Optional Parameters
Word Frequency Analysis
Random Numbers
Word Histogram
Most Common Words
Optional Parameters
Hash Subtraction
Constructing New Operators
Sets, Bags, and Mixes
Random Words
Markov Analysis
Data Structures
Building Your Own Data Structures
Debugging
Glossary
Exercises: Huffman Coding
Moving Forward
Chapter 12Classes and Objects
Objects, Methods, and Object-Oriented Programming
Programmer-Defined Types
Attributes
Creating Methods
Rectangles and Object Composition
Instances as Return Values
Inheritance
Roles and Composition
Method Delegation
Polymorphism
Encapsulation
Interface and Implementation
Object-Oriented Programming: A Tale
Debugging
Glossary
Chapter 13Regexes and Grammars
A Brief Refresher
Declarative Programming
Captures
Named Rules (a.k.a. Subrules)
Grammars
Grammar Inheritance
Actions Objects
A Grammar for Parsing JSON
Inheritance and Mutable Grammars
Debugging
Glossary
Exercise: A Grammar for an Arithmetic Calculator
Chapter 14Functional Programming in Perl
Higher-Order Functions
List Processing and Pipeline Programming
Creating Your Own Map-Like Functions
The gather and take Construct
Lazy Lists and the Sequence Operator
Currying and the Whatever Operator
Using a Functional Programming Style
Debugging
Glossary
Exercise: Quick Sort
Chapter 15Some Final Advice
Make It Clear, Keep It Simple
Dos and Don'ts
Use Idioms
What's Next?
Appendix Solutions to the Exercises
Exercises of Chapter 3: Functions and Subroutines
Exercises of Chapter 4: Conditionals and Recursion
Exercises of Chapter 5: Fruitful Functions
Exercises of Chapter 6: Iteration
Exercises of Chapter 7: Strings
Exercises of Chapter 8: Word Play
Exercises of Chapter 9: Arrays and Lists
Exercises of Chapter 10: Hashes
Exercises of Chapter 11
Exercises of Chapter 13: Regexes and Grammars
Exercises of Chapter 14: Functional Programming