1. Trang chủ
  2. » Công Nghệ Thông Tin

Hacking ebook landoflisp learntoprgraminlisp

508 244 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 508
Dung lượng 22,62 MB

Nội dung

Lisp has been hailed as the world’s most powerful programming language, but its cryptic syntax and academic reputation can be enough to scare off even experienced programmers Those dark days are finally over —  brings the power of functional programming to the people! Land of Lisp With his brilliantly quirky comics and out-of-this-world games, longtime Lisper Conrad Barski teaches you the mysteries of Common Lisp You’ll start with the basics, like list manipulation, I/O, and recursion, then move on to more complex topics like macros, higherorder programming, and domain-specific languages Then, when your brain overheats, you can kick back with an action-packed comic book interlude! Along the way you’ll create (and play) games like Wizard’s Adventure, a text adventure with a whiskey-soaked twist, and Grand Theft Wumpus, the most violent version of Hunt the Wumpus the world has ever seen You’ll learn to: * Master the quirks of Lisp’s syntax and semantics * Write concise and elegant functional programs * Use macros, create domain-specific languages, and learn other advanced Lisp techniques * Create your own web server and use it to play browser-based games * Put your Lisp skills to the test by writing brainmelting games like Dice of Doom and Orc Battle Land of Lisp With , the power of functional programming is yours to wield T H E F I N E ST I N G E E K E N T E RTA I N M E N T ™ w w w.nostarch.com “ I L I E F L AT ” This book uses a lay-flat binding that won't snap shut FSC LOGO $49.95 ($57.95 CDN) shelve in: programming languages/lisp Barski Games! Comics! Programming! Conrad Barski, M.D Lisp_02.book Page i Wednesday, January 5, 2011 11:18 AM LAND OF LISP Lisp_02.book Page ii Wednesday, January 5, 2011 11:18 AM Lisp_02.book Page iii Wednesday, January 5, 2011 11:18 AM LAND OF LISP Learn to Program in Lisp, One Game at a Time! by Conrad Barski, M.D San Francisco Lisp_02.book Page iv Wednesday, January 5, 2011 11:18 AM LAND OF LISP Copyright © 2011 by Conrad Barski, M.D All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher Printed in Canada 14 13 12 11 10 123456789 ISBN-10: 1-59327-281-2 ISBN-13: 978-1-59327-281-4 Publisher: William Pollock Production Editors: Ansel Staton and Serena Yang Developmental Editor: Keith Fancher Technical Reviewers: Philip Fominykh and Heow Eide-Goodman Copyeditor: Marilyn Smith Compositor: Susan Glinert Stevens Proofreader: Linda Seifert Indexer: Nancy Guenther For information on book distributors or translations, please contact No Starch Press, Inc directly: No Starch Press, Inc 38 Ringold Street, San Francisco, CA 94103 phone: 415.863.9900; fax: 415.863.9950; info@nostarch.com; www.nostarch.com Library of Congress Cataloging-in-Publication Data Barski, Conrad Land of Lisp : learn to program in Lisp, one game at a time! / by Conrad Barski p cm Includes index ISBN-13: 978-1-59327-281-4 ISBN-10: 1-59327-281-2 Computer games Programming COMMON LISP (Computer program language) LISP (Computer program language) I Title QA76.76.C672B3693 2010 794.8'1526 dc22 2010026755 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc Other product and company names mentioned herein may be the trademarks of their respective owners Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The information in this book is distributed on an “As Is” basis, without warranty While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it Lisp_02.book Page v Wednesday, January 5, 2011 11:18 AM For Lauren Lisp_02.book Page vi Wednesday, January 5, 2011 11:18 AM Lisp_02.book Page vii Wednesday, January 5, 2011 11:18 AM BRIEF CONTENTS Acknowledgments xvii Introduction SECTION I: LISP IS POWER Chapter 1: Getting Started with Lisp 15 Chapter 2: Creating Your First Lisp Program .21 Chapter 3: Exploring the Syntax of Lisp Code 31 SECTION II: LISP IS SYMMETRY Chapter 4: Making Decisions with Conditions 49 Chapter 5: Building a Text Game Engine 67 Chapter 6: Interacting with the World: Reading and Printing in Lisp 85 Chapter 6.5: lambda: A Function So Important It Deserves Its Own Chapter .103 Chapter 7: Going Beyond Basic Lists .107 Chapter 8: This Ain’t Your Daddy’s Wumpus 129 Chapter 9: Advanced Datatypes and Generic Programming 153 Lisp_02.book Page viii Wednesday, January 5, 2011 11:18 AM SECTION III: LISP IS HACKING 191 Chapter 10: Looping with the loop Command 195 Chapter 11: Printing Text with the format Function 221 Chapter 12: Working with Streams .237 Chapter 13: Let’s Create a Web Server! 253 Functional Programming Is Beautiful 269 SECTION IV: LISP IS SCIENCE Chapter 14: Ramping Lisp Up a Notch with Functional Programming 291 Chapter 15: Dice of Doom, a Game Written in the Functional Style 303 Chapter 16: The Magic of Lisp Macros 339 Chapter 17: Domain-Specific Languages 355 Chapter 18: Lazy Programming 375 Chapter 19: Creating a Graphical, Web-Based Version of Dice of Doom 401 Chapter 20: Making Dice of Doom More Fun .417 Epilogue 429 Index 465 viii Brief Contents ... Programming 153 Lisp_02.book Page viii Wednesday, January 5, 2011 11:18 AM SECTION III: LISP IS HACKING 191 Chapter 10: Looping with the loop Command 195 Chapter 11: Printing

Ngày đăng: 05/11/2019, 21:32

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN