Search the Community
Showing results for tags 'apl'.
-
Hi there. Abstract This UDF enables the use of all reference APL features in AutoIt. Is uses the original APL symbols. The code is interpreted via a sandbox ngn-apl interface which relies on JavaScript. Execution is done via IE objects. What's APL? APL is a formal, imperative language. Because it is imperative, a sentence may be called an instruction, and may be executed to produce a result. StringAPL() has one main parameter, which is the APL source code. Thus: StringAPL("2×(3+4)") = "14"Unlike traditionally structured programming languages, code in APL is typically structured as chains of monadic or dyadic functions and operators acting on arrays. As APL has many nonstandard primitives (functions and operators, indicated by a single symbol or a combination of a few symbols), it does not have function or operator precedence. The APL environment is called a workspace. In a workspace the user can define programs and data, i.e. the data values exist also outside the programs, and the user can manipulate the data without the necessity to define a program. For example, StringAPL("N ← 4 5 6 7")will initialize a vector "N" containing 4 elements according to the command. After each StringAPL call, the workspace is deleted completely, so you have to use multi-instructions if you want to reuse macros, functions or variables. Now that we have "N" we can manipulate it. Here's just a small example, you can do much more with APL (later more): N+4Will perform an addition. Every element in N is increased by (int)4. Easy, at least for now ;-) What's possible? Everything. If you feel like it, just draw a mandelbrot fractal using only one line 'o code. Or solve the n-Queen problem, or determine the first hundred prime numbers, or parse a html file. APL is like RegEx on crack. Some really advanced examples are included within the example file. Now, why isn't APL more popular? Because it uses a very, very strange charset. In fact, you have to install the APL Unicode font (https://sites.google.com/site/baavector/fonts) and set SciTe to use this font (CTRL+1 -> Change Monospace Font), before you can even view the examples! In addition to that, you scripts have to be UTF8 BOM encoded, which in return causes Au3Check to crash whenever custom includes are used. I'm planning on replacing the APL chrs with hum-readable english commands, but that may take some time :-) Just look at the mandelbrot drawing code, it's absolutely ridiculous!: I'd call it abstract art . Examples There are a few examples included. For the basic stuff please visit the Wikipedia APL page und Wikipedia APL reference: Remarks Please do not use the second parameter yet, it is unfinished and experimental. Also, to use multiline-code, use . in-command to start a new line, just like the examples. Download Example file (INSTALL APL FONT AND ENCODE UTF8BOM!!!) UDF (doesn't need any special treatment, doesn't contain APL chrs) https://github.com/Perseus-Developers/StringAPL Does not work in 3.3.9.5. Developed in 3.3.8.1. No further testing, please report bugs only if they occur in a stable version.