{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "(Introduction-Introduction---Will-You-Play-APL-With-Me)=\n", "# Introduction - Will You Play APL With Me?\n", "\n", "(Introduction-Will-You-Follow-Us)=\n", "## Will You Follow Us?\n", "\n", "We would like to have you discover a new land, a land where people who may or may not be specialists in programming can process their data, build computerised applications, and take pleasure in using a programming language which is an extremely elegant and powerful tool of thought.\n", "\n", "(Introduction-Beware-Dyalog-APL-is-Addictive)=\n", "### Beware: Dyalog APL is Addictive!\n", "\n", "Among the hundreds of programming languages which have been created, most of them share the same fundamentals, the same basic instruction set, approximately the same functions, and by and large the same methods to control the logic of a program. This greatly influences the way people imagine and build solutions to computing problems. Because the languages are so similar, the solutions are similar. Does it mean that these are the only ways of solving problems? Of course not!\n", "\n", "Dyalog APL is there to open doors, windows, and minds, prove that original new methods do exist, and that mathematics is not limited to four basic operations. Using APL will expand and extend the range of mental models that you use to solve problems, but beware: once you are hooked on APL, there is a real risk that you will no longer accept the limitations of \"traditional\" programming languages.\n", "\n", "\n", "(Introduction-Setup)=\n", "### Setup\n", "\n", "If you are reading this book online, chances are you can make the most of the interactivity provided by the book format: code snippets can be run by you and you can invent your own data and calculations by modifying those same snippets.\n", "\n", "If you are reading this book in a non-interactive format, you can experiment on your own computer by installing Dyalog APL, which you can download from [here](https://www.dyalog.com/download-zone.htm). You can refer to the [Getting Started](Getting-Started.ipynb) chapter for installation help. If you do not wish to install Dyalog APL right away you can also follow along online at [TryAPL], where a large subset of APL is supported.\n", "\n", "If none of these options suit you, you should still be able to gain an appreciation of the language from these pages and, we hope, enjoy the experience.\n", "\n", "As you will see in the following pages, APL uses special symbols, like `\u2349`, `\u2374`, and `\u2193`, which you can enter in a variety of ways:\n", "\n", " - you can install a special APL keyboard layout, which will work everywhere. Dyalog APL comes with the option of installing such a layout;\n", " - you can use the [APL language bar](https://abrudz.github.io/lb/apl), which works on your browser;\n", " - you can use the software's built-in language bar, which relies on the software having a language bar. The Dyalog APL interpreter and [TryAPL] have such a built-in language bar.\n", " \n", "The snippet below uses some APL incantations to display the US keyboard layout, and other layouts (as well as Mac layouts) can be found [here](https://dfns.dyalog.com/n_keyboards.htm).\n", "\n", "[TryAPL]: https://tryapl.org/ " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "C:\\Program Files\\Dyalog\\Dyalog APL-64 18.0 Unicode\\ws\\dfns.dws saved Tue Dec 1 20:08:40 2020\n", "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" }, { "data": { "text/html": [ "Dyalog APL/en-US keyboard \n", "\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af\u00af \n", "\u250c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n", "\u2502~ \u233a \u2502! \u2336 \u2502@ \u236b \u2502# \u2352 \u2502$ \u234b \u2502% \u233d \u2502^ \u2349 \u2502& \u2296 \u2502* \u235f \u2502( \u2371 \u2502) \u2372 \u2502_ ! \u2502+ \u2339 \u2502Backspace\u2502 \n", "\u2502` \u22c4 \u25021 \u00a8 \u25022 \u00af \u25023 < \u25024 \u2264 \u25025 = \u25026 \u2265 \u25027 > \u25028 \u2260 \u25029 \u2228 \u25020 \u2227 \u2502- \u00d7 \u2502= \u00f7 \u2502 \u2502 \n", "\u251c\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \n", "\u2502Tab \u2502Q \u2502W \u2502E \u2377 \u2502R \u2502T \u2368 \u2502Y \u2502U \u2502I \u2378 \u2502O \u2365 \u2502P \u2363 \u2502{ \u235e \u2502} \u236c \u2502| \u22a3 \u2502 \n", "\u2502 \u2502q ? \u2502w \u2375 \u2502e \u220a \u2502r \u2374 \u2502t ~ \u2502y \u2191 \u2502u \u2193 \u2502i \u2373 \u2502o \u25cb \u2502p * \u2502[ \u2190 \u2502] \u2192 \u2502\\ \u22a2 \u2502 \n", "\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \n", "\u2502Caps \u2502A \u2502S \u2502D \u2502F \u2502G \u2502H \u2502J \u2364 \u2502K \u2338 \u2502L \u2337 \u2502: \u2261 \u2502\" \u2262 \u2502Enter \u2502 \n", "\u2502Lock \u2502a \u237a \u2502s \u2308 \u2502d \u230a \u2502f _ \u2502g \u2207 \u2502h \u2206 \u2502j \u2218 \u2502k ' \u2502l \u2395 \u2502; \u234e \u2502' \u2355 \u2502 \u2502 \n", "\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \n", "\u2502Shift \u2502Z \u2286 \u2502X \u2502C \u2502V \u2502B \u2502N \u2502M \u2502< \u236a \u2502> \u2359 \u2502? \u2360 \u2502Shift \u2502 \n", "\u2502 \u2502z \u2282 \u2502x \u2283 \u2502c \u2229 \u2502v \u222a \u2502b \u22a5 \u2502n \u22a4 \u2502m | \u2502, \u235d \u2502. \u2340 \u2502/ \u233f \u2502 \u2502 \n", "\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2534\u2500\u252c\u2500\u2500\u2534\u2500\u2500\u2500\u252c\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u252c\u2500\u2500\u2500\u2534\u2500\u2500\u252c\u2500\u2534\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \n", "\u2502Ctrl \u2502Win \u2502Alt \u2502 \u2502Alt Gr\u2502Win \u2502Menu \u2502Ctrl \u2502 \n", "\u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \n", "\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \n", "" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ ")copy dfns notes.keyboards\n", "18\u2191k\u2193\u2368\u00af1+\u2283\u2283\u2378'APL/en-US keyboard'\u2377k\u2190\u2395fmt keyboards" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is how the keyboard is to be used:\n", "\n", " - all the standard English letters, numerals and symbols are typed as usual; and\n", " \n", " - the majority of the APL symbols are obtained by pressing the APL key, in conjunction with another key. The APL key is the key you use to access the symbols on the right half of the keycaps above; the APL key is system dependent and is usually one of Ctrl, Alt or AltGr (or right Alt):\n", " \n", " - the symbols on the bottom-right corner of the keycap are accessed by pressing the APL key, for example APL+r gives `\u2374` and APL+e gives `\u220a`;\n", " - if you look at the E key in the figure above, you can see that the symbol `\u2377` appears on top of the symbol `\u220a`. To type the symbols on the top-right corner of a keycap, one uses the APL+Shift combo, so that APL+Shift+E types an `\u2377`.\n", " \n", "You may notice that some symbols appear twice on the keyboard. This is the case, for example, for the symbols `<` `=` `>`. These symbols are all part of a normal keyboard but they have been repeated on the APL keyboard, mostly in order to group the symbols used for _comparison functions_ together (look at the bottom-right corner of the keycaps for the numbers 3 to 8). Do not worry: no matter which key you use to produce one of the duplicated symbols, you'll obtain the same result." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
< \u2264 = \u2265 > \u2260