The Java™ Language Specification Second Edition

Total Page:16

File Type:pdf, Size:1020Kb

The Java™ Language Specification Second Edition diffs.book Page i Thursday, March 2, 2000 3:58 PM The Java™ Language Specification Second Edition DRAFT diffs.book Page ii Thursday, March 2, 2000 3:58 PM The Java™ Series Lisa Friendly, Series Editor Bill Joy, Technical Advisor The Java™ Programming Language Ken Arnold and James Gosling ISBN 0-201-63455-4 The Java™ Language Specification, Second Edition James Gosling, Bill Joy, Guy Steele and Gilad Bracha ISBN 0-201-31008-2 The Java™ Virtual Machine Specification, Second Edition Tim Lindholm and Frank Yellin ISBN 0-201-63452-X The Java™ Application Programming Interface, Volume 1: Core Packages James Gosling, Frank Yellin, and the Java Team ISBN 0-201-43294-3 The Java™ Application Programming Interface, Volume 2: Window Toolkit and Applets James Gosling, Frank Yellin, and the Java Team ISBN 0-201-63459-7 The Java™ Tutorial: Object-Oriented Programming for the Internet Mary Campione and Kathy Walrath ISBN 0-201-63454-6 The Java™ Class Libraries: An Annotated Reference Patrick Chan and Rosanna Lee ISBN 0-201-63458-9 TheDRAFT Java™ FAQ: Frequently Asked Questions Jonni Kanerva ISBN 0-201-63456-2 diffs.book Page iii Thursday, March 2, 2000 3:58 PM The Java™ Language Specification Second Edition James Gosling Bill Joy Guy Steele Gilad Bracha DRAFT ADDISON-WESLEY An imprint of Addison Wesley Longman, Inc. diffs.book Page iv Thursday, March 2, 2000 3:58 PM iv THE JAVA LANGUAGE SPECIFICATION Reading, Massachusetts ● Harlow, England ● Menlo Park, California Berkeley, California ● Don Mills, Ontario ● Sydney Bonn ● Amsterdam ● Tokyo ● Mexico City DRAFT diffs.book Page v Thursday, March 2, 2000 3:58 PM Copyright 1996-2000 Sun Microsystems, Inc. 901 San Antonio Road, Mountain View, California 94303 U.S.A. All rights reserved. Duke logo™ designed by Joe Palrang. Sun Microsystems, Inc has intellectual property rights relating to implementations of the technology described in this publication. In particular, and without limitation, these intel- lectual property rights may include one or more U.S. patents, foreign patents, or pending applications. Sun, Sun Microsystems, Sun Microsystems Computer Corporation, the Sun logo, the Sun Microsystems Computer Corporation logo, Solaris, Java, JavaSoft, JavaS- cript, HotJava, JDK, and all Java-based trademarks or logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX® is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. Apple and Dylan are trademarks of Apple Computer, Inc. All other product names mentioned herein are the trademarks of their respective owners. U.S. GOVERNMENT USE: This specification relates to commercial items, processes or software. Accordingly, use by the United States Government is subject to these terms and conditions, consistent with FAR 12.211 and 12.212. THIS IS A DRAFT SPECIFICATION FOR COMMUNITY REVIEW AND MAY CHANGE ACCORDINGLY. YOUR COMMENTS ARE ENCOURAGED, BUT MUST BE PROVIDED WITHOUT RESTRICTION. THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPO- GRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFOR- MATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN ANY TECHNOLOGY, PRODUCT, OR PROGRAM DESCRIBED IN THIS PUBLICATION AT ANY TIME. Credits and permissions for quoted material appear in a separate section on page 519. diffs.book Page vi Thursday, March 2, 2000 3:58 PM vi / diffs.book Page ix Thursday, March 2, 2000 3:58 PM Table of Contents Table of Contents . ix Series Foreword . xxi Preface . xxiii 1 Introduction. 1 1.1 Example Programs . 5 1.2 Notation . 5 1.3 Relationship to Predefined Classes and Interfaces . 6 1.4 References . 6 2 Grammars . 9 2.1 Context-Free Grammars . 9 2.2 The Lexical Grammar. 9 2.3 The Syntactic Grammar . 10 2.4 Grammar Notation . 10 3 Lexical Structure. 15 3.1 Unicode. 15 3.2 Lexical Translations . 16 3.3 Unicode Escapes. 16 3.4 Line Terminators . 17 3.5 Input Elements and Tokens. 18 3.6 White Space . 19 3.7 Comments. 19 3.8 Identifiers . 21 3.9 Keywords . 22 3.10 Literals . 23 3.10.1 Integer Literals . 23 DRAFT3.10.2 Floating-Point Literals . 26 3.10.3 Boolean Literals . 27 3.10.4 Character Literals. 28 3.10.5 String Literals. 29 3.10.6 Escape Sequences for Character and String Literals . 31 ix diffs.book Page x Thursday, March 2, 2000 3:58 PM TABLE OF CONTENTS 3.10.7 The Null Literal. 31 3.11 Separators . 32 3.12 Operators . 32 4 Types, Values, and Variables. 35 4.1 The Kinds of Types and Values . 36 4.2 Primitive Types and Values . 36 4.2.1 Integral Types and Values . 37 4.2.2 Integer Operations . 37 4.2.3 Floating-Point Types, Formats, and Values. 39 4.2.4 Floating-Point Operations . 41 4.2.5 The boolean Type and boolean Values . .44 4.3 Reference Types and Values . 45 4.3.1 Objects. 45 4.3.2 The Class Object . .48 4.3.3 The Class String . .49 4.3.4 When Reference Types Are the Same. 49 4.4 Where Types Are Used . 49 4.5 Variables . 51 4.5.1 Variables of Primitive Type. 51 4.5.2 Variables of Reference Type . 51 4.5.3 Kinds of Variables. 52 4.5.4 final Variables. 53 4.5.5 Initial Values of Variables . 54 4.5.6 Types, Classes and Interfaces . 55 5 Conversions and Promotions . 59 5.1 Kinds of Conversion . 62 5.1.1 Identity Conversions . 62 5.1.2 Widening Primitive Conversion . 62 5.1.3 Narrowing Primitive Conversions . 63 5.1.4 Widening Reference Conversions . 66 5.1.5 Narrowing Reference Conversions . 67 5.1.6 String Conversions . 68 5.1.7 Forbidden Conversions . 68 5.1.8 Value Set Conversion . 69 5.2 Assignment Conversion. 70 5.3 Method Invocation Conversion . 75 5.4 String Conversion . 76 5.5 Casting Conversion . 76 5.6 Numeric Promotions . 82 5.6.1 Unary Numeric Promotion . 82 DRAFT5.6.2 Binary Numeric Promotion . 83 6 Names . 87 6.1 Declarations . ..
Recommended publications
  • The Performance Paradox of the JVM: Why More Hardware Means More
    Expert Tip The Performance Paradox of the JVM: Why More Hardware Means More As computer hardware gets cheaper and faster, administrators managing Java based servers are frequently encountering serious problems when managing their runtime environments. JVM handles the task of garbage collection for the developer - cleaning up the space a developer has allocated for objects once an instance no longer has any references pointing to it. Some garbage collection is done quickly and invisibly. But certain sanitation tasks, which fortunately occur with minimal frequency, take significantly longer, causing the JVM to pause, and raising the ire of end users and administrators alike. Read this TheServerSide.com Expert Tip to better understand the JVM performance problem, how the JVM manages memory and how best to approach JVM Performance. Sponsored By: TheServerSide.com Expert Tip The Performance Paradox of the JVM: Why More Hardware Means More Expert Tip The Performance Paradox of the JVM: Why More Hardware Means More Table of Contents The Performance Paradox of the JVM: Why More Hardware Means More Failures Resources from Azul Systems Sponsored By: Page 2 of 8 TheServerSide.com Expert Tip The Performance Paradox of the JVM: Why More Hardware Means More The Performance Paradox of the JVM: Why More Hardware Means More Failures By Cameron McKenzie The Problem of the Unpredictable Pause As computer hardware gets cheaper and faster, administrators managing Java based servers are frequently encountering serious problems when managing their runtime environments. While our servers are getting decked out with faster and faster hardware, the Java Virtual Machines (JVMs) that are running on them can't effectively leverage the extra hardware without hitting a wall and temporarily freezing.
    [Show full text]
  • Java (Programming Langua a (Programming Language)
    Java (programming language) From Wikipedia, the free encyclopedialopedia "Java language" redirects here. For the natural language from the Indonesian island of Java, see Javanese language. Not to be confused with JavaScript. Java multi-paradigm: object-oriented, structured, imperative, Paradigm(s) functional, generic, reflective, concurrent James Gosling and Designed by Sun Microsystems Developer Oracle Corporation Appeared in 1995[1] Java Standard Edition 8 Update Stable release 5 (1.8.0_5) / April 15, 2014; 2 months ago Static, strong, safe, nominative, Typing discipline manifest Major OpenJDK, many others implementations Dialects Generic Java, Pizza Ada 83, C++, C#,[2] Eiffel,[3] Generic Java, Mesa,[4] Modula- Influenced by 3,[5] Oberon,[6] Objective-C,[7] UCSD Pascal,[8][9] Smalltalk Ada 2005, BeanShell, C#, Clojure, D, ECMAScript, Influenced Groovy, J#, JavaScript, Kotlin, PHP, Python, Scala, Seed7, Vala Implementation C and C++ language OS Cross-platform (multi-platform) GNU General Public License, License Java CommuniCommunity Process Filename .java , .class, .jar extension(s) Website For Java Developers Java Programming at Wikibooks Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few impimplementation dependencies as possible.ble. It is intended to let application developers "write once, run ananywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to rurun on another. Java applications ns are typically compiled to bytecode (class file) that can run on anany Java virtual machine (JVM)) regardless of computer architecture. Java is, as of 2014, one of tthe most popular programming ng languages in use, particularly for client-server web applications, witwith a reported 9 million developers.[10][11] Java was originallyy developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems'Micros Java platform.
    [Show full text]
  • The Java® Language Specification Java SE 8 Edition
    The Java® Language Specification Java SE 8 Edition James Gosling Bill Joy Guy Steele Gilad Bracha Alex Buckley 2015-02-13 Specification: JSR-337 Java® SE 8 Release Contents ("Specification") Version: 8 Status: Maintenance Release Release: March 2015 Copyright © 1997, 2015, Oracle America, Inc. and/or its affiliates. 500 Oracle Parkway, Redwood City, California 94065, U.S.A. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. The Specification provided herein is provided to you only under the Limited License Grant included herein as Appendix A. Please see Appendix A, Limited License Grant. To Maurizio, with deepest thanks. Table of Contents Preface to the Java SE 8 Edition xix 1 Introduction 1 1.1 Organization of the Specification 2 1.2 Example Programs 6 1.3 Notation 6 1.4 Relationship to Predefined Classes and Interfaces 7 1.5 Feedback 7 1.6 References 7 2 Grammars 9 2.1 Context-Free Grammars 9 2.2 The Lexical Grammar 9 2.3 The Syntactic Grammar 10 2.4 Grammar Notation 10 3 Lexical Structure 15 3.1 Unicode 15 3.2 Lexical Translations 16 3.3 Unicode Escapes 17 3.4 Line Terminators 19 3.5 Input Elements and Tokens 19 3.6 White Space 20 3.7 Comments 21 3.8 Identifiers 22 3.9 Keywords 24 3.10 Literals 24 3.10.1 Integer Literals 25 3.10.2 Floating-Point Literals 31 3.10.3 Boolean Literals 34 3.10.4 Character Literals 34 3.10.5 String Literals 35 3.10.6 Escape Sequences for Character and String Literals 37 3.10.7 The Null Literal 38 3.11 Separators
    [Show full text]
  • A Pairwise Abstraction for Round-Based Protocols
    A Pairwise Abstraction for Round-Based Protocols Lonnie Princehouse Nate Foster Ken Birman Department of Computer Science, Cornell University f lonnie, jnfoster, ken [email protected] Distributed systems are hard to program, for a number of make predictable use of the network. As such, they are reasons. Some of these reasons are inherent. System state “good neighbors” in massive multi-tenant data centers, such is scattered across multiple nodes, and is not random ac- as those that drive Amazon’s EC2. Many cloud computing cess. Bandwidth is an ever-present concern. Fault tolerance services have relaxed consistency requirements in favor of is much more complicated in a partial-failure model. This availability, and this also plays to the strengths of round- presents both a challenge and an opportunity for the pro- based protocols. gramming languages community: What should languages Our goal with CPG is to design abstractions for describ- for distributed systems look like? What are the shortcom- ing these protocols that make it easy to develop richer proto- ings of conventional languages for describing systems that cols via composition and code re-use. The fundamental unit extend beyond a single machine? seen by programmers in CPG is a pair of nodes. A protocol Prior work in this area has produced diverse solutions. in CPG is defined using a select function, which identifies The DryadLINQ [7] language expresses distributed compu- pairs of nodes to communicate in each round, and an up- tations using SQL-like queries. BLOOM [1] also follows a date function, which takes the states of the selected nodes data-centric approach, but assumes an unordered program- as input and produces their updated states after communica- ming model by default.
    [Show full text]
  • In This Day of 3D Graphics, What Lets a Game Like ADOM Not Only Survive
    Ross Hensley STS 145 Case Study 3-18-02 Ancient Domains of Mystery and Rougelike Games The epic quest begins in the city of Terinyo. A Quake 3 deathmatch might begin with a player materializing in a complex, graphically intense 3D environment, grabbing a few powerups and weapons, and fragging another player with a shotgun. Instantly blown up by a rocket launcher, he quickly respawns. Elapsed time: 30 seconds. By contrast, a player’s first foray into the ASCII-illustrated world of Ancient Domains of Mystery (ADOM) would last a bit longer—but probably not by very much. After a complex process of character creation, the intrepid adventurer hesitantly ventures into a dark cave—only to walk into a fireball trap, killing her. But a perished ADOM character, represented by an “@” symbol, does not fare as well as one in Quake: Once killed, past saved games are erased. Instead, she joins what is no doubt a rapidly growing graveyard of failed characters. In a day when most games feature high-quality 3D graphics, intricate storylines, or both, how do games like ADOM not only survive but thrive, supporting a large and active community of fans? How can a game design seemingly premised on frustrating players through continual failure prove so successful—and so addictive? 2 The Development of the Roguelike Sub-Genre ADOM is a recent—and especially popular—example of a sub-genre of Role Playing Games (RPGs). Games of this sort are typically called “Roguelike,” after the founding game of the sub-genre, Rogue. Inspired by text adventure games like Adventure, two students at UC Santa Cruz, Michael Toy and Glenn Whichman, decided to create a graphical dungeon-delving adventure, using ASCII characters to illustrate the dungeon environments.
    [Show full text]
  • Bibliography of Concrete Abstractions: an Introduction To
    Out of print; full text available for free at http://www.gustavus.edu/+max/concrete-abstractions.html Bibliography [1] Harold Abelson, Gerald J. Sussman, and friends. Computer Exercises to Accom- pany Structure and Interpretation of Computer Programs. New York: McGraw- Hill, 1988. [2] Harold Abelson and Gerald Jay Sussman. Structure and Interpretation of Com- puter Programs. Cambridge, MA: The MIT Press and New York: McGraw-Hill, 2nd edition, 1996. [3] Alfred V. Aho and Jeffrey D. Ullman. Foundations of Computer Science.New York: Computer Science Press, 1992. [4] Ronald E. Anderson, Deborah G. Johnson, Donald Gotterbarn, and Judith Perville. Using the new ACM code of ethics in decision making. Communica- tions of the ACM, 36(2):98±107, February 1993. [5] Ken Arnold and James Gosling. The Java Programming Language. Reading, MA: Addison-Wesley, 2nd edition, 1998. [6] Henk Barendregt. The impact of the lambda calculus in logic and computer science. The Bulletin of Symbolic Logic, 3(2):181±215, June 1997. [7] Grady Booch. Object-oriented Analysis and Design with Applications.Menlo Park, CA: Benjamin/Cummings, 2nd edition, 1994. [8] Charles L. Bouton. Nim, a game with a complete mathematical theory. The Annals of Mathematics, 3:35±39, 1901. Series 2. [9] Mary Campione and Kathy Walrath. The Java Tutorial: Object-Oriented Pro- gramming for the Internet. Reading, MA: Addison-Wesley, 2nd edition, 1998. Excerpted from Concrete Abstractions; copyright © 1999 by Max Hailperin, Barbara Kaiser, and Karl Knight 649 650 Bibliography [10] Canadian Broadcasting Company. Quirks and quarks. Radio program, Decem- ber 19, 1992. Included chocolate bar puzzle posed by Dr.
    [Show full text]
  • The Evolution of Lisp
    1 The Evolution of Lisp Guy L. Steele Jr. Richard P. Gabriel Thinking Machines Corporation Lucid, Inc. 245 First Street 707 Laurel Street Cambridge, Massachusetts 02142 Menlo Park, California 94025 Phone: (617) 234-2860 Phone: (415) 329-8400 FAX: (617) 243-4444 FAX: (415) 329-8480 E-mail: [email protected] E-mail: [email protected] Abstract Lisp is the world’s greatest programming language—or so its proponents think. The structure of Lisp makes it easy to extend the language or even to implement entirely new dialects without starting from scratch. Overall, the evolution of Lisp has been guided more by institutional rivalry, one-upsmanship, and the glee born of technical cleverness that is characteristic of the “hacker culture” than by sober assessments of technical requirements. Nevertheless this process has eventually produced both an industrial- strength programming language, messy but powerful, and a technically pure dialect, small but powerful, that is suitable for use by programming-language theoreticians. We pick up where McCarthy’s paper in the first HOPL conference left off. We trace the development chronologically from the era of the PDP-6, through the heyday of Interlisp and MacLisp, past the ascension and decline of special purpose Lisp machines, to the present era of standardization activities. We then examine the technical evolution of a few representative language features, including both some notable successes and some notable failures, that illuminate design issues that distinguish Lisp from other programming languages. We also discuss the use of Lisp as a laboratory for designing other programming languages. We conclude with some reflections on the forces that have driven the evolution of Lisp.
    [Show full text]
  • Allegro CL User Guide
    Allegro CL User Guide Volume 1 (of 2) version 4.3 March, 1996 Copyright and other notices: This is revision 6 of this manual. This manual has Franz Inc. document number D-U-00-000-01-60320-1-6. Copyright 1985-1996 by Franz Inc. All rights reserved. No part of this pub- lication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, by photocopying or recording, or otherwise, without the prior and explicit written permission of Franz incorpo- rated. Restricted rights legend: Use, duplication, and disclosure by the United States Government are subject to Restricted Rights for Commercial Software devel- oped at private expense as specified in DOD FAR 52.227-7013 (c) (1) (ii). Allegro CL and Allegro Composer are registered trademarks of Franz Inc. Allegro Common Windows, Allegro Presto, Allegro Runtime, and Allegro Matrix are trademarks of Franz inc. Unix is a trademark of AT&T. The Allegro CL software as provided may contain material copyright Xerox Corp. and the Open Systems Foundation. All such material is used and distrib- uted with permission. Other, uncopyrighted material originally developed at MIT and at CMU is also included. Appendix B is a reproduction of chapters 5 and 6 of The Art of the Metaobject Protocol by G. Kiczales, J. des Rivieres, and D. Bobrow. All this material is used with permission and we thank the authors and their publishers for letting us reproduce their material. Contents Volume 1 Preface 1 Introduction 1.1 The language 1-1 1.2 History 1-1 1.3 Format
    [Show full text]
  • Common Lisp - Viel Mehr Als Nur D¨Amliche Klammern
    Einf¨uhrung Geschichtliches Die Programmiersprache Abschluß Common Lisp - viel mehr als nur d¨amliche Klammern Alexander Schreiber <[email protected]> http://www.thangorodrim.de Chemnitzer Linux-Tage 2005 Greenspun’s Tenth Rule of Programming: “Any sufficiently-complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp.” Alexander Schreiber <[email protected]> Common Lisp - viel mehr als nur d¨amliche Klammern 1 / 30 Einf¨uhrung Geschichtliches Die Programmiersprache Abschluß Ubersicht¨ 1 Einf¨uhrung 2 Geschichtliches 3 Die Programmiersprache 4 Abschluß Alexander Schreiber <[email protected]> Common Lisp - viel mehr als nur d¨amliche Klammern 2 / 30 Einf¨uhrung Geschichtliches Die Programmiersprache Abschluß Lisp? Wof¨ur? NASA: Remote Agent (Deep Space 1), Planner (Mars Pathfinder), Viaweb, gekauft von Yahoo f¨ur50 Millionen $, ITA Software: Orbitz engine (Flugticket Planung), Square USA: Production tracking f¨ur“Final Fantasy”, Naughty Dog Software: Crash Bandicoot auf Sony Playstation, AMD & AMI: Chip-Design & Verifizierung, typischerweise komplexe Probleme: Wissensverarbeitung, Expertensysteme, Planungssysteme Alexander Schreiber <[email protected]> Common Lisp - viel mehr als nur d¨amliche Klammern 3 / 30 Einf¨uhrung Geschichtliches Die Programmiersprache Abschluß Lisp? Wof¨ur? NASA: Remote Agent (Deep Space 1), Planner (Mars Pathfinder), Viaweb, gekauft von Yahoo f¨ur50 Millionen $, ITA Software: Orbitz engine (Flugticket Planung), Square USA: Production tracking
    [Show full text]
  • Advanced Use of Lisp's FORMAT Function
    Advanced Use of Lisp’s FORMAT Function Gene Michael Stover created 22 January 2004 updated Saturday, 30 October 2004 Copyright c 2004 Gene Michael Stover. All rights reserved. Permission to copy, store, & view this document unmodified & in its entirety is granted. Contents 1 Introduction 1 2 Wanted & To Do 2 3 How to Print a Row 2 4 How to Print a Table 3 5 How to Use Format for Word Wrap 4 6 How to Print a Comma-Separated List 6 7 HowtoUseCommasinEnglishStyle 7 8 Conclusion 7 A Change Log 8 B Other File Formats 8 1 Introduction Lisp’s format function is analogous to C’s printf function, but format can do a whole lot more. format can iterate, use conditionals, process nested format strings, & recurse into format strings embedded into its arguments. The more-or-less official documentation for format is at the Common Lisp Hyperspec[X3J]. There is a complete if terse description of it in Paul Graham’s ANSI Common Lisp[Gra96], but my favorite description of format is in Franz’s Common Lisp The Reference[Inc88]. 1 Knowing the details of how something works isn’t the same as knowing how to use it well. Good applications of format aren’t obvious from its documentation. Thus this article. 2 Wanted & To Do Read the original article about format[Wat89]. Possibly incorporate ideas from it, or refer to them. Definitely refer to it in this article so people know it exists. (I didn’t know it existed at all even though I searched the web for such articles before I wrote this one.
    [Show full text]
  • Hannes Mehnert [email protected] December
    Introduction Dylan Going Further Dylan Hannes Mehnert [email protected] December 16, 2004 Hannes Mehnert [email protected] Dylan Introduction Dylan Going Further Introduction Overview Hello World History Dylan Libraries and Modules Classes Generic Functions Types Sealing Going Further Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History Overview I DYnamic LANguage Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History Overview I DYnamic LANguage I Object Oriented: everything is an object Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History Overview I DYnamic LANguage I Object Oriented: everything is an object I Safe: type-checking of arguments and values, no buffer overruns, no implicit casting, no raw pointers Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History Overview I DYnamic LANguage I Object Oriented: everything is an object I Safe: type-checking of arguments and values, no buffer overruns, no implicit casting, no raw pointers I Efficient: can compile to code nearly as efficient as C Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History Hello world define method hello-world () format-out(``Hello world\n''); end method; Hannes Mehnert [email protected] Dylan Introduction Overview Dylan Hello World Going Further History factorial define method factorial ( i ) if (i = 0) 1 else i
    [Show full text]
  • Towards Rogue-Soar: Amulet of Yendor Using Its Levitation Capabilities.” Combining Soar, Curses and Micropather
    Gameplay The purpose of Rogue is “to descend into the Dungeons of Doom, defeat monsters, find treasure, and return to the surface with the Towards Rogue-Soar: amulet of Yendor using its levitation capabilities.” Combining Soar, Curses and Micropather Johnicholas Hines Advisor: Clare Bates Congdon May 17, 2010 Figure: The player (‘@’) is fighting a bat (‘B’). History Novelty I In the late 1970s, Ken Arnold designed a library (later named Rogue does not seem like a novel environment for Soar. curses[1]) to put characters at specific locations, enabling a I Discrete-Space crude form of interactive graphics. I Discrete-Time / Synchronous I Using this library, Michael Toy and Glen Wichman designed I Two-Dimensional Rogue[4]. I Single-Agent I In 1983, Rogue became popular when it was included in BSD Unix 4.2. Why should you be interested? I In 1984, Michael L. Mauldin, Guy Jacobson, Andrew Appel, and Leonard Hamey published “Rog-o-matic: A belligerent expert system”[3]. I In 1987, John Laird, Paul Rosenbloom, and Allen Newell published “Soar: An Architecture for General Intelligence”[2]. Is writing an Rog-o-matic-competitive agent easy now? Why you should be interested Rogue-Soar I/O I Rogue is a real human activity; people played it. ˆio I Rogue has been previously studied. ˆinput-link ˆspot I Because Rogue was written decades ago, it is now fast. ˆrow <0..23> I The generic I/O link could be reused for other curses-based ˆcolumn <0..79> roguelikes (ADoM, Angband, Crawl, Moria, NetHack). ˆcontents <char> I The generic I/O link could be reused for other curses-based ˆoutput-link applications (vi, emacs, lynx, w3m).
    [Show full text]