Size: 3933
Comment:
|
Size: 5561
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
{{{#!html <div class="borderlesstable"> }}} ||<tableclass="borderlesstable">Back ||[[LearnApl/TutorialContents|Contents]] ||[[LearnApl/TutorialContents|Next]]> || {{{#!html </div> }}} |
|
Line 2: | Line 11: |
<<TableOfContents>> ||'''Note to contributors:''' Additions and corrections to this tutorial are welcome. Please keep in mind that it tries to be vendor neutral : where possible examples should work in any version of APL. Please make it clear when code is specific to a particular interpreter. || |
|
Line 3: | Line 14: |
<<TableOfContents>> | |
Line 5: | Line 15: |
|| '''Note to contributors:''' Additions and corrections to this tutorial are welcome. Please keep in mind that it tries to be vendor neutral : where possible examples should work in any version of APL. Please make it clear when code is specific to a particular interpreter. || | |
Line 9: | Line 19: |
It is adapted from an original version written to accompany MicroAPL's APLX interpreter which is available in [[http://www.microapl.co.uk/apl/LearningAPLwithAPLX.pdf|PDF form]]. | It is adapted from an original version written to accompany MicroAPL's APLX interpreter which is available in [[http://www.microapl.co.uk/apl/LearningAPLwithAPLX.pdf|PDF form]]. |
Line 21: | Line 31: |
* [[http://www.nars2000.org/|NARS2000]] , an Open Source APL. See also [[Nars2000]] |
|
Line 22: | Line 34: |
Once you're familiar with the material covered here, you might also want to check out [[LearnMoreApl/FurtherTopics|Further Topics in APL]] which covers some more advanced topics. |
|
Line 26: | Line 40: |
To download a time-limited evaluation copy of APLX for Windows, Macintosh or Linux, visit MicroAPL's [[http://www.microapl.co.uk/apl/aplx_downloads.html|Download page]] | To download a time-limited evaluation copy of APLX for Windows, Macintosh or Linux, visit MicroAPL's [[http://www.microapl.co.uk/apl/aplx_downloads.html|Download page]]. You can also download an older Linux version which is free for personal use. |
Line 29: | Line 43: |
NARS2000, an Open Source APL, does not compete against the commercially available APL implementations, but it is a fully-fledged APL implmentation. Apart from the last chapter (OO) you can do everything mentioned in this tutorial with NARS2000. APL2000 and IBM offer their respective interpreters 'free' to educational establishments - contact them via their web site. A time limited evaluation copy of Visual APL is available (this requires Visual Studio 2008) - see [[http://www.apl2000.com|www.apl2000.com]]. The Finn APL Idiom library (for first generation APL) and IBM's APL2 Phrases (for second generation APL) are useful references for students and professionals alike. |
|
Line 37: | Line 59: |
* MicroAPL's APLX Upright Unicode font ([[http://www.microapl.co.uk/download/aplx_unicode.ttf|http://www.microapl.co.uk/download/aplx_unicode.ttf]]). If you have installed a desktop version of APLX (full or evaluation copy), you will have this font installed already. | * MicroAPL's APLX Upright Unicode font (http://www.microapl.co.uk/download/aplx_unicode.ttf). If you have installed a desktop version of APLX (full or evaluation copy), you will have this font installed already. |
Line 39: | Line 61: |
* Adrian Smith's APL385 Unicode font ([[http://www.vector.org.uk/resource/apl385.ttf|http://www.vector.org.uk/resource/apl385.ttf]]) | * Adrian Smith's APL385 Unicode font (http://www.vector.org.uk/resource/apl385.ttf) |
Line 41: | Line 63: |
* IBM's "Courier APL2" font which comes with APL2. | |
Line 42: | Line 65: |
* Phil Chastney's "SiMPL" font. * Phil Chastney's "SiMPL medium" font which can be downloaded from the AplCharacters page. NARS2000 is using this font. The fonts are listed in the order in which the APL wiki tries to make use of them. Of course this has an impact only if you have installed more than one font. |
|
Line 45: | Line 73: |
If you do not have either of the APL fonts listed nor a suitable version of Microsoft's Arial font, APL characters will not display properly. | If you do not have either of the APL fonts listed nor a suitable version of Microsoft's Arial font, APL characters will not display properly. |
Line 53: | Line 81: |
|| {{attachment:apl_font_ok.jpg}} || | |
Line 54: | Line 83: |
||{{attachment:apl_font_ok.jpg}}|| | |
Line 59: | Line 89: |
|| {{attachment:apl_font_bad.jpg}} || | |
Line 60: | Line 91: |
||{{attachment:apl_font_bad.jpg}}|| | |
Line 62: | Line 92: |
{{{#!html <div class="borderlesstable"> }}} ||<tableclass="borderlesstable">Back ||[[LearnApl/TutorialContents|Contents]] ||[[LearnApl/TutorialContents|Next]]> || {{{#!html </div> }}} |
|
Line 63: | Line 104: |
[[LearnApl/TutorialContents|Next]] > | |
Line 65: | Line 105: |
CategoryAboutApl CategoryGuides CategoryAplx |
CategoryAboutApl CategoryGuides CategoryAplx |
Learning APL
Note to contributors: Additions and corrections to this tutorial are welcome. Please keep in mind that it tries to be vendor neutral : where possible examples should work in any version of APL. Please make it clear when code is specific to a particular interpreter. |
This tutorial aims to teach some of the basics of the APL language.
It is adapted from an original version written to accompany MicroAPL's APLX interpreter which is available in PDF form.
The present version has been slightly modified so that examples should work with a number of APLs, including:
The core APL language is similar in all these products, although each vendor has added proprietory extensions. Where code is specific to a particular APL interpreter it will usually be indicated in the text.
Once you're familiar with the material covered here, you might also want to check out Further Topics in APL which covers some more advanced topics.
Trying APL
The APL tutorial will be most effective if you actually try the example code in an APL interpreter. Several vendors provide free or low cost evaluation licenses:
To download a time-limited evaluation copy of APLX for Windows, Macintosh or Linux, visit MicroAPL's Download page. You can also download an older Linux version which is free for personal use.
To apply for a free educational license, or a cheap (£50/€75) non-commercial copy of Dyalog APL visit Dyalog's Download zone
NARS2000, an Open Source APL, does not compete against the commercially available APL implementations, but it is a fully-fledged APL implmentation. Apart from the last chapter (OO) you can do everything mentioned in this tutorial with NARS2000.
APL2000 and IBM offer their respective interpreters 'free' to educational establishments - contact them via their web site.
A time limited evaluation copy of Visual APL is available (this requires Visual Studio 2008) - see www.apl2000.com.
The Finn APL Idiom library (for first generation APL) and IBM's APL2 Phrases (for second generation APL) are useful references for students and professionals alike.
Installing the APL font
To display the material in this tutorial properly, you need to ensure that (a) your browser can correctly handle Unicode (UTF-8) encoding, and (b) that you have a suitable APL Unicode font installed on your system. Note that non-Unicode APL fonts like "Dyalog Std" or "Causeway" won't work!
Most modern Browsers (such as Internet Explorer 6 or later, Firefox v2 or later, Safari v3 or later) should be fine. However, we have found problems using Firefox v2 on the Macintosh (the Windows version is OK, and Firefox v3 on the Macintosh is OK).
APL code on this Wiki is encoded using Unicode UTF-8. It should display correctly provided you have at least one of these APL fonts installed on your system:
MicroAPL's APLX Upright Unicode font (http://www.microapl.co.uk/download/aplx_unicode.ttf). If you have installed a desktop version of APLX (full or evaluation copy), you will have this font installed already.
Adrian Smith's APL385 Unicode font (http://www.vector.org.uk/resource/apl385.ttf)
- IBM's "Courier APL2" font which comes with APL2.
- Phil Chastney's "SiMPL" font.
Phil Chastney's "SiMPL medium" font which can be downloaded from the AplCharacters page. NARS2000 is using this font.
The fonts are listed in the order in which the APL wiki tries to make use of them. Of course this has an impact only if you have installed more than one font.
If you don't have either of these fonts installed, the Wiki's style sheets are set to fall back on Microsoft's Arial font. Some versions of this font (e.g. the "Arial Unicode MS" version which ships with the international support component of MS Office) do have the APL characters, but it is not a monospaced font. This means that code samples will display the correct characters, but may not be aligned correctly.
If you do not have either of the APL fonts listed nor a suitable version of Microsoft's Arial font, APL characters will not display properly.
Here's a sample of text which should display in the APL font:
X ← 3 3⍴÷⍳9 ⋄ Y ← DATA[⍋DATA] ⍝ A comment
It should appear in your browser something like this:
|
(this is a picture, not text; it will always display APL chars)
If it looks more like this then you do not have the APL font installed:
|