>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  J for C Programmers

Contents

Foreword. ii

Acknowledgements. iii

Change History. iii

1.   Introduction. 13

2.   Culture Shock. 14

Programming In J  17

3.   Preliminaries. 18

Notation Used in This Book. 18

Terminology. 18

Sentences (statements) 19

Comments. 19

Word Formation (tokenizing rules) 19

Numbers. 20

Adjacent Numbers Form a Single Word. 20

Adjacent Named Nouns Do NOT Form a Single Word. 21

Characters. 21

Valence of Verbs (Binary and Unary Operators) 21

How Names (Identifiers) Get Assigned. 22

Order of Evaluation. 23

How Names Are Substituted. 23

What a verb (function) looks like. 24

Running a J program.. 25

Interrupting Execution. 27

Errors. 27

The Execution Window; Script Windows. 27

Names Defined at Startup. 28

Step-By-Step Learning: Labs. 28

J Documentation. 28

Reference Card. 29

Getting Help. 29

4.   A First Look At J Programs. 30

Average Daily Balance. 30

Calculating Chebyshev Coefficients. 33

5.   Declarations. 35

Arrays. 35

Cells. 36

Choosing Axis Order 37

Negative Cell-Rank; Items. 37

Lists. 38

Phrases To Memorize. 38

Constant Lists. 39

Array-creating Verbs. 39

Dyad $ ($hape) and monad $ ($hape Of) 39

Monad # (Tally) 44

Monad i. (Integers) 44

6.   Loopless Code I: Verbs Have Rank. 46

Examples of Implicit Loops. 46

The Concept of Verb Rank. 48

Verb Execution--How Rank Is Used (Monads) 48

Controlling Verb Execution By Specifying a Rank. 50

Examples Of Verb Rank. 51

Fills. 54

fndisplay--A Utility for Understanding Evaluation. 54

Negative Verb Rank. 55

Rank Makes Verbs Automatically Extensible. 56

Verb Execution--How Rank Is Used (Dyads) 56

Concatenating Lists: Dyad , (Append) 59

When Dyad Frames Differ: Operand Agreement 60

Order of Execution in Implied Loops. 64

Nested Loops. 64

A Mistake To Avoid. 66

7.   Starting To Write In J. 68

8.   More Verbs. 71

Arithmetic Dyads. 71

Boolean Dyads. 72

Min and Max Dyads. 72

Arithmetic Monads. 72

Trigonometric Functions. 72

Boolean Monad. 73

Operations on Arrays. 73

Dyads. 73

Monads. 80

9.   Loopless Code II: Adverbs / and ~.. 84

Modifiers. 84

What 'Monadic' and 'Dyadic' Mean For Modifiers. 84

The Adverb Monad u/ (Insert) 85

The adverb ~. 87

10. Continuing to Write in J. 89

Example: Counting Words and Lines. 93

11. Boxing (structures) 95

Terminology. 97

Boxing As an Equivalent For Structures In C.. 98

12. Compound Verbs. 99

Verb Sequences--u@:v and u@v.. 99

The Difference Between u@:v and u@v