Kotlin In Action

E-Book Overview

<em>Kotlin in Action teaches you to use the Kotlin language for production-quality applications. Written for experienced Java developers, this example-rich book goes further than most language books, covering interesting topics like building DSLs with natural language syntax. The authors are core Kotlin developers, so you can trust that even the gnarly details are dead accurate.

E-Book Content

Dmitry Jemerov Svetlana Isakova FOREWORD BY Andrey Breslav MANNING Kotlin in Action Licensed to Édouard WILLISSECK Licensed to Édouard WILLISSECK Kotlin in Action DMITRY JEMEROV AND SVETLANA ISAKOVA MANNING SHELTER ISLAND Licensed to Édouard WILLISSECK For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email: [email protected] ©2017 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Development editor: Review editor: Technical development editor: Project editor: Copyeditor: Proofreader: Technical proofreader: Typesetter: Cover designer: Dan Maharry Aleksandar Dragosavljevic´ Brent Watson Kevin Sullivan Tiffany Taylor Elizabeth Martin Igor Wojda Marija Tudor Marija Tudor ISBN 9781617293290 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – EBM – 22 21 20 19 18 17 Licensed to Édouard WILLISSECK brief contents PART 1 INTRODUCING KOTLIN ................................................... 1 1 2 3 4 5 6 ■ ■ ■ ■ ■ ■ Kotlin: what and why 3 Kotlin basics 17 Defining and calling functions 44 Classes, objects, and interfaces 67 Programming with lambdas 103 The Kotlin type system 133 PART 2 EMBRACING KOTLIN ................................................... 171 7 8 ■ 9 10 11 ■ ■ ■ ■ Operator overloading and other conventions 173 Higher-order functions: lambdas as parameters and return values 200 Generics 223 Annotations and reflection 254 DSL construction 282 v Licensed to Édouard WILLISSECK vi BRIEF CONTENTS Licensed to Édouard WILLISSECK contents foreword xv preface xvii acknowledgments xix about this book xxi about the authors xxiv about the cover illustration PART 1 1 xxv INTRODUCING KOTLIN .................................... 1 Kotlin: what and why 1.1 1.2 3 A taste of Kotlin 3 Kotlin’s primary traits 4 Target platforms: server-side, Android, any
You might also like

Lexikon Der Informatik
Authors: Peter Fischer , Peter Hofer    119    0


Computer Science Handbook
Authors: Allen B. Tucker    172    0


Scientific Visualization: The Visual Extraction Of Knowledge From Data
Authors: Georges-Pierre Bonneau , Thomas Ertl , Gregory M. Nielson    109    0




Rigid Body Dynamics Algorithms
Authors: Roy Featherstone    72    0


Molecular Evolution: Computer Analysis Of Protein And Nucleic Acid Sequences
Authors: Abelson J.N. , Simon M.I. , Doolittle R.F. (eds.)    104    0



Mining Fuzzy Association Rules In A Bank-account Database
Authors: Au W.-H. , Chan K.C.C.    90    0


Collision Detection In Interactive 3d Environments
Authors: Gino van den Bergen    35    0