@elliptic00 The “columns” are the last axis always, the rows are the axis that precedes it, and what I think you are calling the “z-axis” is actually the first one. Take a look at this 3D array: ⋄ 2 3 4⍴⍳24
Its shape is 2 3 4. It has 2 slices, that we see here as two matrices separated by a blank line. The leading axis contains these slices, so the leading axis here has length 2.
Then each “matrix” or “slice” or “plane” contains 3 rows (the second axis) and 4 columns (the third, and last, axis).
Take a look at the diagram in here: https://course.dyalog.com/Array-model/#rank-vs-axis It should help you out. The diagram uses the 3D array `2 3 4⍴⎕A` instead of the integers.
@elliptic00 You are right, ⌽ and ⊖ do the “same” thing, except they have a different default axis. But you can use axis specification on both.
You could delete one, or the other, from the APL keyboard :P But it's a nice amenity, to have ⌽ to rotate along the last axis. You can always write ⊖ as ⌽[1], but writing ⌽ in terms of ⊖ requires that you take a look at the array: ⌽array ←→ ⊖[≢⍴array] array
@elliptic00 You can specify an axis for ⌽: ⋄ ⌽[1]3 4⍴⎕A
@elliptic00 You're absolutely right, but ⌽ precedes the invention of the rank operator by a long time. In fact, originally, Iverson had 64 functions like ⌽⍉⊖ but it was found that those three were enough to express most things without it becoming too awkward. Just ⌽ and ⍉ would have worked too, but ⍉⌽⍉M to flip vertically was apparently too verbose.
Announcement:APL Campfire in six hours, featuring Zbigniew Stachniak (Computing historian, associate professor of computer science at York University in Toronto, and author of Inventing the PC).
Could someone help me? I would need to write a string to memory buffer in Windows.
I tried it like this: ⎕na 'P msvcrt|malloc U8' addr←malloc 256 'put' ⎕na 'P msvcrt|memcpy P <0T[] U8' put addr 'test string' 255 74952720 'get' ⎕na 'P msvcrt|memcpy >0T[] P U8' get 255 addr 255 ┌────────┬───────────┐ │18746816│test string│ └────────┴───────────┘ 'len' ⎕NA'P dyalog64|STRLEN P' len addr 1 'getstr'⎕NA'msvcrt|wcsncpy >0T[] P U8' getstr 256 addr 256 test string 'getstrd'⎕NA'dyalog64|STRNCPY >0T[] P U8' getstrd 256 addr 256 t
As you can see memcpy can read the buffer but STRLEN notice only the first character and the same with STRNCPY.
@KamilaSzewczyk Does the name Zbigniew Stachnia look like something you'd be comfortable pronouncing? If so, does Google Translate's pronunciation sound right to you?
OK, then Dyalog APL has something known as ⎕WC which is basically a cover for WinForms and allows direct OO-based graphics. Cross-platform, there's also an HTML renderer (Chromium Embedded Framework) which allows you do do anything using HTML/JS/CSS and all such libraries.
Hm, no, it seems I remembered that wrong. It is in the Python code that ⎕ is the placeholder for APL arguments: '⎕+⎕' py.Eval 2 2 on the APL side uses Python to evaluate 2+2
Whereas APL functions are exposed as Python functions of 0/1/2 argument on the Python side.
Going back to using ⎕XML with the HTML renderer, if m is the matrix:
You can do 'h'⎕WC'HTMLRenderer'(⎕XML m) to create the above-shown window.
So you can use APL's array manipulation to build up your DOM tree represented in this matrix form (the first column is the node level, the second is the node type, the third is the content, and the fourth is a matrix of attribute-value pairs), which you then convert to XHTML and render.
APL is very powerful language.. hope more ppl will play with it.. and appreciate the power of APL.. good IDE is first step for someone who want to play around with ..
@elliptic00 Meanwhile, if you create the directory /tmp/mysrc and start coding by entering ]link.create # /tmp/mysrc then the functions you create and edit using the editor should automatically be saved to text files there.
Firstly, you should understand that RIDE is "dumb". It is just a graphical interface to the interpreter. The interpreter is doing all the work, including loading and saving things.
If you use the above method of ]link.create then the exact same command will load your code next time.
@elliptic00 If you install .NET then you can even edit the source files and your changes will automatically be picked up by APL. Otherwise, I think that if you open the item in the APL editor, it'll ask you to re-read the file. You can also do ]link.refresh to read in all changes.