Perl 6 Deep Dive

Total Page:16

File Type:pdf, Size:1020Kb

Perl 6 Deep Dive Perl 6 Deep Dive Data manipulation, concurrency, functional programming, and more Andrew Shitov BIRMINGHAM - MUMBAI Perl 6 Deep Dive Copyright © 2017 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2017 Production reference: 1060917 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78728-204-9 www.packtpub.com Credits Author Copy Editor Andrew Shitov Safis Editing Reviewer Project Coordinator Alex Kapranoff Prajakta Naik Commissioning Editor Proofreader Merint Mathew Safis Editing Acquisition Editor Indexer Chaitanya Nair Francy Puthiry Content Development Editor Graphics Lawrence Veigas Abhinash Sahu Technical Editor Production Coordinator Mehul Singh Nilesh Mohite About the Author Andrew Shitov has been a Perl enthusiast since the end of the 1990s, and is the organizer of over 30 Perl conferences in eight countries. He worked as a developer and CTO in leading web-development companies, such as Art. Lebedev Studio, Booking.com, and eBay, and he learned from the "Fathers of the Russian Internet", Artemy Lebedev and Anton Nossik. Andrew has been following the Perl 6 development since its beginning in 2000. He ran a blog dedicated to the language, published a series of articles in the Pragmatic Perl magazine, and gives talks about Perl 6 at various Perl events. In 2017, he published the Perl 6 at a Glance book by DeepText, which was the first book on Perl 6 published after the first stable release of the language specification. Acknowledgements Through the course of writing this book, I contacted many people who helped me clarify many dark corners of Perl 6. First of all, thanks to the reviewers of this book, Liz Mattijsen, who is also the core developer of the Perl 6 compiler, and Alex Kapranoff, who has helped me promote Perl 6 for more than a decade already. I would also like to thank the whole Rakudo compiler team, who worked hard to make things happen even when almost nobody believed that Perl 6 would become a reality. So, primarily, thanks to Jonathan Worthington for not only working on the compiler, but also for his talks, which I found on YouTube and used for reference. Also, thanks to the rest of the team. Special thanks go to Wendy van Dijk, who has done great work to change the image of the Perl language and has personally helped me promote my books. And of course, thanks to the author of Perl, Larry Wall, and his wife, Gloria, for the years of patience and enthusiasm; they made Perl 6 fly in the end. This book has also been possible due to the number of other Perl 6 books that appeared this year; so, I want to thank the authors of those books as they indirectly stimulated me to write faster and more. Finally, this book took its shape with the efforts of the editors at Packt, Lawrence Veigas, who guided me through the writing process, and Mehul Singh, who joined at the last stage of the publishing process and provided many suggestions on how to make the book better and more useful for the readers. About the Reviewer Alex Kapranoff studied software engineering in one of the smaller Russian cities and then worked in the internet industry for about 20 years in roles ranging from software developer to CTO to technical manager. Having written production code in many programming languages, he still considers Perl his one true love. Perl 6 is a huge step forward for the language, for the ecosystem, and, maybe even for programming language theory. Agava, Inline Technologies, Rambler.ru, and Yandex are companies that provided Alex with the opportunities to be his best and write impactful code in Perl on a day-to-day basis throughout his career. Alex has worked on a number of books about the performance-oriented web server software, Nginx, and published his own take on Nginx Troubleshooting with Packt Publishing. I am very grateful to the whole worldwide Perl community – an amazing group of people using and constantly improving the language that we all love and have the most impact with. www.PacktPub.com For support files and downloads related to your book, please visit www.PacktPub.com. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. https://www.packtpub.com/mapt Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career. Why subscribe? Fully searchable across every book published by Packt Copy and paste, print, and bookmark content On demand and accessible via a web browser Customer Feedback Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/178728204X. If you'd like to join our team of regular reviewers, you can email us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products! Table of Contents Chapter 1: What is Perl 6? 7 Origins of Perl 6 7 Differences from Perl 5 8 Sigils 8 Signatures 9 Classes 11 Compatibility with Perl 5 13 Perl 6 resources 14 Documentation 14 Test Suite 15 STD.pm 15 Community 15 Compilers 16 Parrot 17 Pugs 17 Perlito 17 Rakudo 18 Working with Rakudo Star 18 Downloading and installing Rakudo Star 18 Command-line options 19 The -c command 19 The --doc command 20 The -e command 20 The -h and --help commands 21 The -n command 21 The -p command 21 The -I and -M commands 21 The -v and --version command 22 The --stagestats command 22 Writing our Hello World program 23 Summary 24 Chapter 2: Writing Code 25 Using Unicode 25 Whitespaces and unspaces 29 Comments 31 One-line comments 31 Multiline comments 33 Embedded comments 35 Creating Pod documentation 35 The =begin / =end Pod block 36 Phasers 39 Simple input and output 40 Summary 42 Chapter 3: Working with Variables and Built-in Data Types 43 Using variables 43 Declaring variables 44 Variable containers in Perl 6 44 Scalars 45 Arrays 45 Methods of the Array type 46 Hashes 48 Methods of the Hash class 49 Naming conventions 50 Typed variables 51 Using simple built-in data types 52 Integer data type 54 Methods of the Int type 56 Converting to a character using the chr method 56 Checking whether the number is prime 56 Generating a random number 57 Getting the sign of the value 57 Calculating the square root of the value 57 Getting the next and previous values 58 Getting the absolute value 58 Rational data type 58 Methods of the Rat type 59 Getting the Perl representation of the value 60 Converting to an Int value 60 Getting the numerator and denominator 60 Methods for rounding the value 61 Methods pred and succ 61 Numeric data type 62 Num versus Numeric versus Real 62 Enumerations 63 Boolean data type 63 Methods of the Bool type 64 Using pred and succ 64 Methods to generate random Boolean values 64 String data type 65 [ ] Methods of the Str class 65 Converting register 65 Methods to cut strings 66 Methods to check the content of a string 67 Length of the string 67 Reversing a string 67 Complex numbers 68 Methods of the Complex data type 68 Getting real and imaginary parts 68 Data types to manipulate date and time 69 Using the Date class 69 Using the DateTime data type 71 Summary 72 Chapter 4: Working with Operators 73 Operator classification 74 Categories of operators 74 Operators as functions 76 Operators in Perl 6 77 Infix operators 77 Assignment operators 77 Operators for multiplication and division 78 Operators for addition and subtraction 79 Modulo operator 80 Divisibility operator 81 Integer division and modulo operators 81 Bitwise operators 82 Integer shift operators 83 String logical operators 83 Boolean logical operators 83 Great common divisor and least common multiple operators 84 String repetition operator 85 List repetition operator 86 String concatenation operator 86 Junction operators 86 The does operator 87 The but operator 88 Universal comparison operator 88 String comparison operator leg 89 Comparison operator for Real numbers 90 Range creating operator 90 Equality and non-equality operators 90 Numerical comparison operators 91 String comparison
Recommended publications
  • On the Naming of Methods: a Survey of Professional Developers
    On the Naming of Methods: A Survey of Professional Developers Reem S. Alsuhaibani Christian D. Newman Michael J. Decker Michael L. Collard Jonathan I. Maletic Computer Science Software Engineering Computer Science Computer Science Computer Science Kent State University Rochester Institute of Bowling Green State The University of Akron Kent State University Prince Sultan University Technology University Ohio, USA Ohio, USA Riyadh, Saudi Arabia New York, USA Ohio, USA [email protected] [email protected] [email protected] [email protected] [email protected] Abstract—This paper describes the results of a large (+1100 Here, we focus specifically on the names given to methods responses) survey of professional software developers concerning in object-oriented software systems. However, much of this also standards for naming source code methods. The various applies to (free) functions in non-object-oriented systems (or standards for source code method names are derived from and parts). We focus on methods for several reasons. First, we are supported in the software engineering literature. The goal of the interested in method naming in the context of automatic method survey is to determine if there is a general consensus among summarization and documentation. Furthermore, different developers that the standards are accepted and used in practice. programming language constructs have their own naming Additionally, the paper examines factors such as years of guidelines. That is, local variables are named differently than experience and programming language knowledge in the context methods, which are named differently than classes [10,11]. Of of survey responses. The survey results show that participants these, prior work has found that function names have the largest very much agree about the importance of various standards and how they apply to names and that years of experience and the number of unique name variants when analyzed at the level of programming language has almost no effect on their responses.
    [Show full text]
  • GNU MPFR the Multiple Precision Floating-Point Reliable Library Edition 4.1.0 July 2020
    GNU MPFR The Multiple Precision Floating-Point Reliable Library Edition 4.1.0 July 2020 The MPFR team [email protected] This manual documents how to install and use the Multiple Precision Floating-Point Reliable Library, version 4.1.0. Copyright 1991, 1993-2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back- Cover Texts. A copy of the license is included in Appendix A [GNU Free Documentation License], page 59. i Table of Contents MPFR Copying Conditions ::::::::::::::::::::::::::::::::::::::: 1 1 Introduction to MPFR :::::::::::::::::::::::::::::::::::::::: 2 1.1 How to Use This Manual::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 2 Installing MPFR ::::::::::::::::::::::::::::::::::::::::::::::: 3 2.1 How to Install ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 3 2.2 Other `make' Targets :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.3 Build Problems :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 2.4 Getting the Latest Version of MPFR ::::::::::::::::::::::::::::::::::::::::::::::: 4 3 Reporting Bugs::::::::::::::::::::::::::::::::::::::::::::::::: 5 4 MPFR Basics ::::::::::::::::::::::::::::::::::::::::::::::::::: 6 4.1 Headers and Libraries :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 6
    [Show full text]
  • Declare Variable on Python
    Declare Variable On Python Is Herby devout when Ambrose presaged familiarly? Rob castigate stertorously. Jake interchanging unwieldily? The final equals sign should point to the value you want to assign to your variables. There are some guidelines you need to know before you name a variable. Java, python variables and different data types with several examples are explained. There is a question that always hovers among Python programmers. Strings are declared within a single or double quote. Break a string based on some rule. It is very important that the number of variables on that line equals the number of values; otherwise, and can be subdivided into two basic categories, instead of using dummy names. Python interpreter allocates the memory to the variable. Python assigns values from right to left. However, Sam, then check your prediction. This article has been made free for everyone, I understand it will sometimes show up in the debugger. The data stored in memory can be of many types. Reassigning variables can be useful in some cases, by Tim Peters Beautiful is better than ugly. The variables that are prefixed with __ are known as the special variables. Swapping values between two variables is a common programming operation. We will go through python variables and python data types in more detail further in this blog. Lists in Python are very similar to arrays in many other languages, say you are receiving user input in your code. What if we try to call the local variable outside of the function? This appends a single value to the end of a list.
    [Show full text]
  • C++ API for BLAS and LAPACK
    2 C++ API for BLAS and LAPACK Mark Gates ICL1 Piotr Luszczek ICL Ahmad Abdelfattah ICL Jakub Kurzak ICL Jack Dongarra ICL Konstantin Arturov Intel2 Cris Cecka NVIDIA3 Chip Freitag AMD4 1Innovative Computing Laboratory 2Intel Corporation 3NVIDIA Corporation 4Advanced Micro Devices, Inc. February 21, 2018 This research was supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of two U.S. Department of Energy organizations (Office of Science and the National Nuclear Security Administration) responsible for the planning and preparation of a capable exascale ecosystem, including software, applications, hardware, advanced system engineering and early testbed platforms, in support of the nation's exascale computing imperative. Revision Notes 06-2017 first publication 02-2018 • copy editing, • new cover. 03-2018 • adding a section about GPU support, • adding Ahmad Abdelfattah as an author. @techreport{gates2017cpp, author={Gates, Mark and Luszczek, Piotr and Abdelfattah, Ahmad and Kurzak, Jakub and Dongarra, Jack and Arturov, Konstantin and Cecka, Cris and Freitag, Chip}, title={{SLATE} Working Note 2: C++ {API} for {BLAS} and {LAPACK}}, institution={Innovative Computing Laboratory, University of Tennessee}, year={2017}, month={June}, number={ICL-UT-17-03}, note={revision 03-2018} } i Contents 1 Introduction and Motivation1 2 Standards and Trends2 2.1 Programming Language Fortran............................ 2 2.1.1 FORTRAN 77.................................. 2 2.1.2 BLAST XBLAS................................. 4 2.1.3 Fortran 90.................................... 4 2.2 Programming Language C................................ 5 2.2.1 Netlib CBLAS.................................. 5 2.2.2 Intel MKL CBLAS................................ 6 2.2.3 Netlib lapack cwrapper............................. 6 2.2.4 LAPACKE.................................... 7 2.2.5 Next-Generation BLAS: \BLAS G2".....................
    [Show full text]
  • Functional and Procedural Languages and Data Structures Learning
    Chapter 1 Functional and Procedural Languages and Data Structures Learning Joao˜ Dovicchi and Joao˜ Bosco da Mota Alves1 Abstract: In this paper authors present a didactic method for teaching Data Structures on Computer Science undergraduate course. An approach using func- tional along with procedural languages (Haskell and ANSI C) is presented, and adequacy of such a method is discussed. Authors are also concerned on how functional language can help students to learn fundamental concepts and acquire competence on data typing and structure for real programming. 1.1 INTRODUCTION Computer science and Information Technology (IT) undergraduate courses have its main focus on software development and software quality. Albeit recent in- troduction of Object Oriented Programming (OOP) have been enphasized, the preferred programming style paradigm is based on imperative languages. FOR- TRAN, Cobol, Algol, Pascal, C and other procedural languages were frequently used to teach computer and programming concepts [Lev95]. Nowadays, Java is the choice for many computer science teaching programs [KW99, Gri00, Blu02, GT98], although “the novelty and popularity of a language do not automatically imply its suitability for the learning of introductory programming” [Had98]. Inside undergraduate curricula, Data Structures courses has some specific re- quirements that depends on mathematical formalism. In this perspective, concepts 1Remote Experimentation Laboratory, Informatics and Statistics Department (INE), Universidade Federal de Santa Catarina (UFSC), Florianopolis,´ SC, Brazil, CEP 88040-900; Phone: +55 (48) 331 7511; Fax: +55 (48) 331 9770; Email: [email protected] and [email protected] 1 on discrete mathematics is very important on understanding this formalism. These courses’ syllabuses include concept attainment and competence development on expression evaluation, iteration, recursion, lists, graphs, trees, and so on.
    [Show full text]
  • Vivado Design Suite User Guide: High-Level Synthesis (UG902)
    Vivado Design Suite User Guide High-Level Synthesis UG902 (v2018.3) December 20, 2018 Revision History Revision History The following table shows the revision history for this document. Section Revision Summary 12/20/2018 Version 2018.3 Schedule Viewer Updated information on the schedule viewer. Optimizing the Design Clarified information on dataflow and loops throughout section. C++ Arbitrary Precision Fixed-Point Types: Reference Added note on using header files. Information HLS Math Library Updated information on how hls_math.h is used. The HLS Math Library, Fixed-Point Math Functions Updated functions. HLS Video Library, HLS Video Functions Library Moved the HLS video library to the Xilinx GitHub (https:// github.com/Xilinx/xfopencv) HLS SQL Library, HLS SQL Library Functions Updated hls::db to hls::alg functions. System Calls Added information on using the __SYNTHESIS__ macro. Arrays Added information on array sizing behavior. Command Reference Updated commands. config_dataflow, config_rtl Added the option -disable_start_propagation Class Methods, Operators, and Data Members Added guidance on specifying data width. UG902 (v2018.3) December 20, 2018Send Feedback www.xilinx.com High-Level Synthesis 2 Table of Contents Revision History...............................................................................................................2 Chapter 1: High-Level Synthesis............................................................................ 5 High-Level Synthesis Benefits....................................................................................................5
    [Show full text]
  • Json Schema Type Number Or Null
    Json Schema Type Number Or Null decreeInflectionless ablaze. and Intermittently parsonical cavalierly,Penn frescos: Vassili which reinter Benjamen highlighting is strapless and unfeudalizes enough? Happiest sarcoplasm. Thaddius boobs his Tucana May also takes precedence over each json null values passed to be submitted as described by calling either as geo. Rfc will crash if not of type number. The json type? Schemas and Types GraphQL. Means any worse at jail so little is support one quality from my chosen set followed by any character not number of times. JSON Data Types REST API Tutorial. Example 47 a string-valued annotation a Boolean-valued annotation a slender float-valued annotation. Computing whether it has a number type of the schema to be appreciated, by related resources. 3 Answers You want also specimen type number null as Adam suggests but always think anyOf is cleaner as long as he use demand draft-04 implementation and ties the minimum and maximum declaration to purchase number explicitly Disclaimer I don't know instead about the python implementation my flip is about json schema. Where crazy is now string specifying any valid JSON Schema type boolean integer number of array decay and null Unless creating an empty schema. Currently the null type number or edit my web url to work for? Given named types can also several different way to help, type schema number or json null values: just describes the schema validator criteria are some examples. Numeric multipleOf exclusiveMaximum exclusiveMinimum. Relatively systematic ways json object; the number or null type number or unknown properties.
    [Show full text]
  • Scripting Layer for Android: Updated and Expanded Support
    POLITECNICO DI MILANO School of Industrial and Information Engineering Master of Science in Computer Science and Engineering SCRIPTING LAYER FOR ANDROID: UPDATED AND EXPANDED SUPPORT Master graduation thesis: Miguel Angel Palacio Delgado – Student ID: 816355 Supervisor: Dr. Giovanni Agosta Academic Year 2015-2016 iii Acknowledgements I would like to thank my family for all their support throughout my master's studies, without it I would not have been able to complete them. I would also like to express my gratitude to those friends that somehow helped me during my stay in Milan. I specially thank my supervisor Giovanni Agosta for all his understanding, cooperation and availability during the development of this work. Milan, April 2016 iv Abstract The Scripting Layer for Android (SL4A) is a software suite that brings scripting languages to Android by allowing the creation, edition and execution of scripts and the use of interactive interpreters directly on Android devices. These scripts have access to many of the APIs available to traditional Android applications, with the inherent ease of scripting languages. Despite being initially developed at Google, SL4A was never an official project and it is currently not maintained. The main purpose of this work is to update the SL4A libraries to support the most recent versions of the Android operative system as well as to extend the support for missing components in the user interface library. Lo Scripting Layer for Android (SL4A) è una suite di software che porta linguaggi di scripting ad Android, permettendo la creazione, edizione ed esecuzione di scripts e anche l'uso di interprete interattivi direttamente su dispositivi Android.
    [Show full text]
  • Friend Documentation Release 0.2.1
    Friend Documentation Release 0.2.1 Joseph Wright Mar 19, 2021 Contents: 1 Introduction 1 1.1 What is Friend?..............................................1 2 API Reference 3 2.1 friend package..............................................3 3 Indices and tables 11 Python Module Index 13 Index 15 i ii CHAPTER 1 Introduction 1.1 What is Friend? Friend is all of those of utilities you keep reimplementing across your Python projects, that all got together and decided to live in harmony. Maybe you just parsed some YAML that contained some configuration in “snake_case”, and you want to pass this configuration to a boto3 function which takes the same values but in “PascalCase”. Then you might find snake_to_pascal_obj or one of its variants to come in handy. with open('conf.yml') as f: conf= yaml.load(f) ec2= boto3.resource('ec2') ec2.create_instances( ImageId='ami-12345678', BlockDeviceMappings=snake_to_pascal_obj(conf['block_device_mappings']), .... ) Or you need to add a retry to that script that keeps breaking your Jenkins job because the corporate proxy fails about 5% of the time. Sure, you can add a try/except and wrap it in a for loop, but putting the retryable decorator on top of that problematic function will do that for you in one configurable line. @retryable(times=5) def flaky_function(): status= requests.get('https://service.corp/v2/status').json() if 'error' in status: send_important_email(status['error']) 1 Friend Documentation, Release 0.2.1 2 Chapter 1. Introduction CHAPTER 2 API Reference 2.1 friend package 2.1.1 friend.collections module friend.collections.select_dict(coll, key, value) Given an iterable of dictionaries, return the dictionaries where the values at a given key match the given value.
    [Show full text]
  • The Rust Programming Language
    The Rust Programming Language The Rust Programming Language Steve Klabnik and Carol Nichols, with Contributions from the Rust Community The Rust Programming Language, © Steve Klabnik and Carol Nichols, with Contributions from the Rust Community. Contents I Getting started 7 1 Introduction 9 1.1 Contributing to the book ................. 10 1.2 ................................ 10 1.3 ................................ 12 2 Guessing Game 21 2.1 Setting Up a New Project ................. 21 2.2 Processing a Guess ..................... 22 2.3 Generating a Secret Number ............... 27 2.4 Comparing the Guess to the Secret Number ....... 33 2.5 Allowing Multiple Guesses with Looping ......... 38 2.6 Summary .......................... 44 3 Common Programming Concepts 45 3.1 ................................ 46 3.2 ................................ 50 3.3 ................................ 58 3.4 ................................ 65 3.5 ................................ 66 4 Understanding Ownership 77 4.1 ................................ 77 4.2 ................................ 90 4.3 ................................ 97 5 Using Structs to Structure Related Data 105 5.1 ................................ 105 5.2 ................................ 111 5.3 ................................ 117 6 6 Enums and Pattern Matching 123 6.1 ................................ 123 6.2 ................................ 132 6.3 ................................ 138 II Basic Rust Literacy 143 1 Using Modules to Reuse and Organize Code 145 1.1 ...............................
    [Show full text]
  • Package 'Lettercase'
    Package ‘lettercase’ March 3, 2016 Title Utilities for Formatting Strings with Consistent Capitalization, Word Breaks and White Space Version 0.13.1 Date 2016-03-03 Description Utilities for formatting strings and character vectors to for capitalization, word break and white space. Supported formats are: snake_case, spine-case, camelCase, PascalCase, Title Case, UPPERCASE, lowercase, Sentence case or combinations thereof. 'lettercase' strives to provide a simple, consistent, intuitive and high performing interface. Depends R (>= 3.1.0), stringr (>= 1.0.0) Suggests testthat, knitr, magrittr (>= 1.5) License GPL-2 | file LICENSE LazyData true Collate 'lettercase-package.R' 'make_names.R' 'make_str_replace.R' 'patterns.R' 'str_cap_words.R' 'str_collapse_whitespace.R' 'str_delete.R' 'str_functions.R' 'str_is.R' 'str_lowercase.R' 'str_sentence_case.R' 'str_snake_case.R' 'str_spine_case.R' 'str_title_case.R' 'str_transform.R' 'str_ucfirst.R' 'str_uppercase.R' 'utils.R' 'zzz.R' VignetteBuilder knitr NeedsCompilation no Author Christopher Brown [aut, cre], Decision Patterns [cph] Maintainer Christopher Brown <[email protected]> Repository CRAN Date/Publication 2016-03-03 23:54:35 R topics documented: lettercase . .2 make_names . .3 1 2 lettercase make_str_replace . .4 pattern_whitespace . .5 str_cap_words . .5 str_collapse_whitespace . .6 str_delete . .7 str_delete_whitespace . .8 str_is . .9 str_lowercase . 10 str_sentence_case . 12 str_snake_case . 13 str_spine_case . 13 str_title_case . 14 str_transform . 15 str_ucfirst . 16 Index 17 lettercase lettercase Description Utilities for formatting strings according to common cases: upper case, lower case, snake case, camel case, spine case, title case, sentence case etc. Details The lettercase package provides utilities that help manage and maintain string formats related to: • capitalization • whitespace / word separating characters • special characters • acronyms Most often, the common convenience functions will be used.
    [Show full text]
  • C++ Object-Oriented Library User's Manual [COOL]
    TEXAS I NSTRUMENTS C++ Object-Oriented Library User’s Manual MANUAL REVISION HISTORY C++ Object-Oriented Library User’s Manual (2566801-0001) Original Issue. March 1990 Copyright © 1990, 1991 Texas Instruments Incorporated Permission is granted to any individual or institution to use, copy, modify, and distribute this document, provided that this complete copyright and permission notice is maintained, intact, in all copies and supporting documentation. Texas Instruments Incorporated makes no representations about the suitability of this document or the software described herein for any purpose. It is provided ”as is” without express or implied warranty. Texas Instruments Incorporated Information Technology Group Austin, Texas C++ OBJECT-ORIENTED LIBRARY USER’S MANUAL CONTENTS Paragraph Title Page About This Manual . xi 1 Overview of COOL 1.1 Introduction. 1-1 1.2 Audience. 1-1 1.3 Major Attributes. 1-1 1.4 Macros. 1-2 1.5 Parameterized Templates. 1-2 1.6 Symbols and Packages. 1-3 1.7 Polymorphic Management. 1-3 1.8 Exception Handling. 1-4 1.9 Classes. 1-4 1.10 Class Hierarchy. 1-7 2 String Classes 2.1 Introduction. 2-1 2.2 Requirements. 2-1 2.3 String Class. 2-1 2.4 String Example. 2-7 2.5 Auxiliary char* Functions. 2-8 2.6 Regular Expression Class. 2-10 2.7 Regular Expression Example. 2-12 2.8 General String Class. 2-13 2.9 General String Example. 2-20 3 Number Classes 3.1 Introduction. 3-1 3.2 Requirements. 3-1 3.3 Random Class. 3-1 3.4 Random Class Example.
    [Show full text]