Visual Smalltalk Enterprise ™ ™
Total Page:16
File Type:pdf, Size:1020Kb
Visual Smalltalk Enterprise ™ ™ Language Reference P46-0201-00 Copyright © 1999–2000 Cincom Systems, Inc. All rights reserved. Copyright © 1999–2000 Seagull Systems, Inc. All rights reserved. This product contains copyrighted third-party software. Part Number: P46-0201-00 Software Release 3.2 This document is subject to change without notice. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. Trademark acknowledgments: CINCOM, CINCOM SYSTEMS, and the Cincom logo are registered trademarks of Cincom Systems, Inc. Visual Smalltalk is a trademark of Cincom Systems, Inc., its subsidiaries, or successors and are registered in the United States and other countries. Microsoft Windows is a registered trademark of Microsoft, Inc. Win32 is a trademark of Microsoft, Inc. OS/2 is a registered trademark of IBM Corporation. Other product names mentioned herein are used for identification purposes only, and may be trademarks of their respective companies. The following copyright notices apply to software that accompanies this documentation: Visual Smalltalk is furnished under a license and may not be used, copied, disclosed, and/or distributed except in accordance with the terms of said license. No class names, hierarchies, or protocols may be copied for implementation in other systems. This manual set and online system documentation copyright © 1999–2000 by Cincom Systems, Inc. All rights reserved. No part of it may be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without prior written consent from Cincom. Cincom Systems, Inc. 55 Merchant Street Cincinnati, Ohio 45246 Phone: (513) 612-2300 Fax: (513) 612-2000 World Wide Web: http://www.cincom.com Contents Preface ........................................................................................ xv About This Manual ................................................................xv Notation Conventions ................................................xvii Chapter 1 The Smalltalk Language Overview ................................................................................19 Language Changes .................................................................19 Identifiers ...............................................................................20 Literals ...........................................................................20 Variables ........................................................................26 Variable Shadowing ......................................................30 Pseudovariables ............................................................31 Messages ................................................................................31 Sequences of Messages ................................................35 Cascading Messages .....................................................35 Parsing Expressions ....................................................36 Method Syntax .......................................................................37 Message Pattern ............................................................37 Comments .....................................................................38 Assigning Values to Variables ......................................38 Returning Values ...........................................................39 Blocks ...........................................................................39 Control Structures ..................................................................40 Conditional Execution ..................................................41 Iterative Execution ........................................................41 Boolean Evaluation ......................................................42 Evaluating Blocks .........................................................42 Language Upgrade Support ..................................................43 Compiler Options .........................................................43 Conversion Tools ..........................................................45 Chapter 2 Basic Building Blocks Overview ................................................................................47 Object Class ...........................................................................48 Creating and Destroying Instances ..............................48 Accessing Instances ......................................................49 Equality and Identity ....................................................49 Hash Values ..................................................................50 Visual Smalltalk Enterprise Language Reference iii Contents Testing ...........................................................................50 Copying .........................................................................51 Evaluating Messages .....................................................51 Events ............................................................................52 Reporting Exceptions ...................................................57 Object Descriptions ......................................................57 Object Finalization ........................................................58 Boolean Classes .....................................................................59 Boolean Expressions ....................................................59 Magnitude Classes ..................................................................60 Magnitude .....................................................................61 Character .......................................................................62 Date, Time and TimeStamp .........................................65 Numbers ........................................................................67 Float ...............................................................................70 Fraction .........................................................................71 Integer ...........................................................................71 Collection Classes ..................................................................72 Attributes of the Collection Class .................................73 Enumerating Collections ..............................................74 Converting Collections .................................................76 Creating Instances .........................................................76 Common Protocol .........................................................77 Class Bag .......................................................................78 Class HashedCollection ................................................78 Class Set ........................................................................79 Class Dictionary ............................................................79 Class IdentityDictionary ................................................79 Class IndexedCollection ...............................................79 Class FixedSizeCollection .............................................80 Class OrderedCollection ...............................................81 Class SortedCollection ..................................................82 Stream Classes ........................................................................82 Accessing Protocol ........................................................84 Positioning and Reading Protocol ...............................84 Writing Protocol ............................................................86 File System Interface Classes .................................................87 Files ...............................................................................87 Opening and Accessing Files .......................................88 Directories .....................................................................89 File Association .............................................................89 Pattern ....................................................................................91 PropertyManager ....................................................................92 Accessing Properties .....................................................93 iv Visual Smalltalk Enterprise Language Reference Chapter 3 The Graphics Model Overview ................................................................................95 The Coordinate System .........................................................96 Coordinate System Independence ...............................97 Setting Graphics Display Units ....................................97 Graphic Classes ......................................................................98 Point ..............................................................................98 Rectangle ....................................................................101 GraphicsMedium Classes .....................................................103 GraphicsMedium ........................................................104 Bitmap .........................................................................104 StoredPicture ...............................................................106 Printer .........................................................................107 Screen .........................................................................108 Window ......................................................................109 Graphics Tool Classes .........................................................109