APL: The Language and Its Usage

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Raymond P. Polivka, Sandra Pakin
Publisher: Prentice-Hall
Year: 1975

Language: English
Pages: 606

Contents ix
List of Illustrations xiv
Preface xx
Acknowledgments xxiii
@=28
1 Basic APL: A Working Set of APL Functions 1
...1.1 Four Familiar Functions 1
...1.2 Data Representation 8
...1.3 Vectors 11
......1.3.1 Vectors Introduced 11
......1.3.2 A Vector of Consecutive Integers \em Index Generator 14
...1.4 Variables and System Commands 17
......1.4.1 Variables 17
......1.4.2 System Commands 21
...1.5 Errors 24
...1.6 Catenation 27
...1.7 Types of Functions and Conformability Rules 33
...1.8 Summary 34
2 Function Definition and Function Editing 37
...2.1 Function Definition 37
...2.2 Function Ediing 41
...2.3 Arguments of a Defined Function 45
...2.4 Local and Global Variables 53
...2.5 Nested Functions and Local Variables 56
...2.6 Line Editing 59
...2.7 Summary 64
3 The Shape of Data 68
...3.1 Arrays 68
...3.2 Shape and Rank 72
...3.3 Building Arrays 74
...3.4 The Scalar 80
...3.5 Indexing 87
......3.5.1 Indexing Vectors 87
......3.5.2 Indexing Arrays 90
...3.6 Index-of 101
...3.7 Ravel 105
...3.8 Grade-up, Grade-down 108
...3.9 Deal and Roll 113
......3.9.1 Definition 113
......3.9.2 Nature of Random Number Generation 116
...3.10 Summary 118
4 Elementary Functions 121
...4.1 The Scalar Monadic Function: Absolute Value, Negation and Reciprocal 121
...4.2 Functions with Limited Ranges 123
......4.2.1 Floor and Ceiling 124
......4.2.2 Relational Functions 125
......4.2.3 Membership 127
......4.2.4 Logic Functions 128
......4.2.5 Signum 129
...4.3 More Common Functions 135
......4.3.1 Exponentiation 135
......4.3.2 Logarithm 137
......4.3.3 Factorial, Combination, and Residue 138
......4.3.4 Minimum and Maximum 142
......4.3.5 Monadic Plus 144
...4.4 Special Interest Functions 148
......4.4.1 Pi 148
......4.4.2 Circular Functions 149
...4.5 Summary 151
5 Extensions of the Scalar Dyadic Functions to Arrays and other Array Handling Capabilities 156
...5.1 Reduction 156
...5.2 Scan 170
...5.3 Outer Product 175
...5.4 Inner Product 187
...5.5 Two Functions that Replace Common Outer and Inner Product Expressions 197
......5.5.1 Decode 197
......5.5.2 Encode 205
...5.6 Two Matrix Functions 214
......5.6.1 Matrix Inverse 214
......5.6.2 Matrix Division 218
...5.7 Summary 225
6 Additional Techniques and Capabilities of Defining Functions 227
...6.1 Branching 227
...6.2 Comments 242
...6.3 Conversational Input/Output 242
......6.3.1 Output from Within a Function 242
......6.3.2 Formatting Output 244
......6.3.3 Input During Function Execution 250
...6.4 Tracing 260
...6.5 Suspended Execution of a Function 262
...6.6 Locked Functions 273
...6.7 Recursive Functions 273
...6.8 Summary 280
7 Data Selection and Rearrangement 286
...7.1 Data Selection 286
......7.1.1 Compression 286
......7.1.2 Expansion 294
......7.1.3 Take 299
......7.1.4 Drop 305
......7.1.5 Catenation and Lamination 310
...7.2 Rearrangement of Data 318
......7.2.1 Reversal 318
......7.2.2 Rotation 323
......7.2.3 Transposition 332
......7.2.4 Execute 351
...7.3 Summary 356
8 Communications with the APL Supporting System 360
...8.1 Workspace Contents 361
......8.1.1 Copying 361
......8.1.2 Grouping 362
......8.1.3 Inquiring About the Objects in a Workspace 364
......8.1.4 Erasing Objects 365
...8.2 The Library 365
......8.2.1 Library List 366
......8.2.2 Workspace Saving 367
......8.2.3 Loading Workspaces 368
......8.2.4 Dropping Workspaces 369
......8.2.5 Copying from Other Workspaces 369
...8.3 The Workspace, the Work Unit of APL 369
......8.3.1 Name 371
......8.3.2 Storage 372
......8.3.3 Display 373
......8.3.4 Calculations 375
...8.4 On and Off 385
......8.4.1 Signing On 386
......8.4.2 Signing Off 386
...8.5 Messages 388
......8.5.1 Messages to the Operator 388
......8.5.2 Message to Another Terminal 388
......8.5.3 Message Control 390
......8.5.4 Messages Associated with Workspaces 390
...8.6 Trouble Reports 392
...8.7 System Information 393
......8.7.1 System Dependent System Variables 394
......8.7.2 System Dependent Functions 412
...8.8 The System Function 421
......8.8.1 Function-Manipulating System Functions 421
......8.8.2 Information-Yielding System Functions 430
......8.8.3 Execution-Affecting System Functions 433
...8.9 Summary 435
9 Data Communication \em The Shared Variable Facility 439
...9.1 Processors and the Nature of the Shared Variable 439
......9.1.1 Establishment of Sharing 442
......9.1.2 Sharing Inquiries 448
......9.1.3 Access Control for Sharing 450
......9.1.4 Retraction of Sharing 455
......9.1.5 Some Functions for a Reservation System 456
...9.2 TSIO \em An APL.SV Processor for Data Set Manipulation 464
......9.2.1 Terminology and Procedural Overview 464
......9.2.2 The Control Variable and Sequentially Accessed Data Sets 466
......9.2.3 The Data Variable and Direct-Accessed Data Sets 472
......9.2.4 User Levels 475
......9.2.5 Other Features of the TSIO Processor and Summary Tables 476
......9.2.6 A Comprehensive Illustration 484
...9.3 Summary 491
Appendices 497
...A The APL Symbol Set 499
...B Error Reports 512
...C Error Reports Given with System Commands 514
...0 Signing on an IBM 2741 Communications Terminal Equipped with a Data-Phone Acoustic Coupler 516
...E APL*PLUS File Subsystem 517
...F APL/700 File System 533
Bibliography 545
Index 571