« first day (287 days earlier)      last day (2366 days later) » 
08:00 - 20:0020:00 - 23:00

Gil
8:03 AM
right, I need to test this bot of yours
⍞←⍳6
 
@Gil 1 2 3 4 5 6
 
Gil
:)
I'll have to show the team this, love it
 
 
5 hours later…
1:06 PM
A further informal APL learning session is taking place this evening at 18:30 UTC - you can join Adam at https://chat.stackexchange.com/rooms/52405/apl Reading along is open to everyone, but 20 StackExchange reputation points are required to contribute messages to the chat.
 
 
1 hour later…
2:24 PM
@Adám happen to know why this doesn't work?
      {⊂⍵}⌺3 3⊢4 4⍴⍳16
┌→──────────────────────────────────────────┐
↓ ┌→────┐   ┌→────┐    ┌→────┐    ┌→────┐   │
│ ↓0 0 0│   ↓0 0 0│    ↓0 0 0│    ↓0 0 0│   │
│ │0 1 2│   │1 2 3│    │2 3 4│    │3 4 0│   │
│ │0 5 6│   │5 6 7│    │6 7 8│    │7 8 0│   │
│ └~────┘   └~────┘    └~────┘    └~────┘   │
│ ┌→─────┐  ┌→──────┐  ┌→───────┐ ┌→──────┐ │
│ ↓0 1  2│  ↓1  2  3│  ↓ 2  3  4│ ↓ 3  4 0│ │
│ │0 5  6│  │5  6  7│  │ 6  7  8│ │ 7  8 0│ │
│ │0 9 10│  │9 10 11│  │10 11 12│ │11 12 0│ │
│ └~─────┘  └~──────┘  └~───────┘ └~──────┘ │
look at the bottom
 
2:47 PM
@EriktheOutgolfer Because the operand is called dyadically with the subarray as right argument and padding information as left argument:
⎕←{⊂⍺ ⍵}⌺3 3⊢3 4⍴⍳12
 
@Adám
┌─────────────┬──────────────┬───────────────┬───────────────┐
│┌───┬─────┐  │┌───┬─────┐   │┌───┬─────┐    │┌────┬─────┐   │
││1 1│0 0 0│  ││1 0│0 0 0│   ││1 0│0 0 0│    ││1 ¯1│0 0 0│   │
││   │0 1 2│  ││   │1 2 3│   ││   │2 3 4│    ││    │3 4 0│   │
││   │0 5 6│  ││   │5 6 7│   ││   │6 7 8│    ││    │7 8 0│   │
│└───┴─────┘  │└───┴─────┘   │└───┴─────┘    │└────┴─────┘   │
├─────────────┼──────────────┼───────────────┼───────────────┤
│┌───┬──────┐ │┌───┬───────┐ │┌───┬────────┐ │┌────┬───────┐ │
 
2 messages moved to trash
@EriktheOutgolfer … and you don't want 1 1⊂submatrix. However, you can use ⊢∘⊂ which is equivalent to {⍺⊢⊂⍵} and therefore to {⊂⍵}:
⎕←⊢∘⊂⌺3 3⊢3 4⍴⍳12
 
@Adám
┌──────┬───────┬────────┬───────┐
│0 0 0 │0 0 0  │0 0 0   │0 0 0  │
│0 1 2 │1 2 3  │2 3 4   │3 4 0  │
│0 5 6 │5 6 7  │6 7 8   │7 8 0  │
├──────┼───────┼────────┼───────┤
│0 1  2│1  2  3│ 2  3  4│ 3  4 0│
│0 5  6│5  6  7│ 6  7  8│ 7  8 0│
│0 9 10│9 10 11│10 11 12│11 12 0│
├──────┼───────┼────────┼───────┤
│0 5  6│5  6  7│ 6  7  8│ 7  8 0│
│0 9 10│9 10 11│10 11 12│11 12 0│
│0 0  0│0  0  0│ 0  0  0│ 0  0 0│
└──────┴───────┴────────┴───────┘
 
hmm, nice
well, I saw the webinar and some solutions there missed some trivial golfs...
 
You could probably fit a huge APL program in 280 chars
 
2:56 PM
speaking of golfs...
 
@EriktheOutgolfer Really? The submissions are available. Which do you have in mind?
 
@Adám for example the CompleteTeams one by Stefano Lanzavecchia
(∊{2=≢⍵}⌸⊆∪)
without the () it's 10 chars long
but I don't see why it can't be ∊2∘=∘≢⌸⊆∪ instead
or ∊(2=≢)⌸⊆∪
 
@EriktheOutgolfer this one would take ⌸⊆∪ as 2=≢ 's right argument instead of the actual argument
 
Actually I think both of these will
 
3:00 PM
is an operator
 
@EriktheOutgolfer For the same reason as above with . The operand gets a left argument which is the unique major cell.
To contribute in tonight's APL learning session without having 20 SE rep, send an email to adam@ or contact us through our website dyalog.com
 
...even though adam himself can't add access :p
 
@EriktheOutgolfer Well, I can't tell them to email a mod.
 
@EriktheOutgolfer Sure as in Sure you can! or as in Sure, that's right.?
 
3:11 PM
> Sure, that's right.
 
@Adám For this learning session, is there anything I need to set up ahead of time?
 
lol I expected that question
 
@Potato44 If you want to try things locally on your own computer, you should install Dyalog APL. However, there is an bot in this chat room which will evaluate any APL expression that begins with ⎕← or ⍞← (just don't put backticks around your code). You may want to have an APL keyboard layout set up. You can also use the on-screen keyboard found on TryAPL.
⍞←'This is an example of the bot evaluating',2+3
 
@Adám This is an example of the bot evaluating 5
 
@Adám thanks, I will have a look into getting the keyboard set up.
 
3:19 PM
@Potato44 Oh, and the character (U+2262) doesn't render well on Win/macOS Chromium (i.e. Chrome and Opera), so you may want to use a different browser.
 
I'm using linux firefox, so I should be fine for that
 
3:31 PM
Yay I'll be able to participate in today's lesson \o/
 
@EriktheOutgolfer Did you understand why Stefano's couldn't be shortened? Any other examples?
 
@Adám nah
 
@EriktheOutgolfer I assume that's a nah to the second question :-)
 
worked out how to activate the apl keyboard, It took me a while becayse the apl keyboard doesn't appear in xfce's keyboard menu by default
 
3:46 PM
@Potato44 If you send us an email about it, and how you fixed the problem, we can add this valuable info the that web page.
 
Will do, just got to see if I can find how to quick swap back to english, currently I have to go all the way back to keyboard settings to change layout
 
@Potato44 Back to English? Does you APL layout not let you type English too?
 
@Adám maybe with shift or something, haven't checked yet
well, I have worked out how to get it to toggle with win-space (or any other key combination that XFCE offers)
 
@Potato44 winkey+space is the default for windows OSs
 
@Potato44 So when your APL layout is active, you don't use any shifting key to produce APL symbols? E.g. just pressing 4 gives you ≤ ?
@J.Sallé Potato44 is on Linux.
 
3:57 PM
@Adám correct
 
@Adám for my ubuntu 16.04 that's how you change languages too
 
@Potato44 You may want to review the previous lessons if you didn't attend them.
 
@Adám thanks, will have a look
@J.Sallé I chose win-space for that reason, I used to use a Japanese IME as my normal keyboard on windows, but sometimes I needed to swap back to the normal US keyboard to use the WSL bash prompt without typing japanese
 
@Potato44 I see. Took me ages to figure out why sometimes my keyboard layouts changed without me doing anything, turns out I was pressing win-space by accident when I typed too fast
 
4:13 PM
@Potato44 You should be able to map layers so that plain gives 4, Shift gives $, Win gives ≤ and Win+Shift gives ⍋.
 
@Adám I know that should be the case, but I'll leave that for afterwards, What I have is sufficient for now.
well, the numpad still works when i'm in APL mode, so at least I don't have to switch to enter numbers
 
ngn
4:55 PM
@Potato44 a quick and dirty way to set up the "windows key" as APL key is
setxkbmap -layout us,apl -variant ,dyalog -option grp:win_switch
(replace "us" with the layout you normally use and optionally include its variant before ",dyalog")
 
@ngn Will try that
That appears to have worked
 
ngn
@Potato44 great
@Potato44 usually they don't include APL in configuration UIs because we don't have our own country and flag
@Potato44 yet :)
 
@ngn huh
do azerty and dvorak keyboards have countries and flags for example ;p
so something else can be "en-US (APL)" or something like that
 
okay, I finished reading the first part of that stuff Adam linked, ⍴ reshapes (dyadic), ⍴ gets the shape(monadic). ≢ gets the number of items in a vector. ≡ gets the depth of a vector. , concatenates vectors. ↑ and ↓ exchange depth and rank (monadically). ↑ and ↓ are take and drop (dyadically). Is that all correct?
@EriktheOutgolfer dvorak is a subclass of en (US )in the XFCE keyboard dialog
 
@Potato44 yes
@Potato44 so can't apl be?
 
5:06 PM
@EriktheOutgolfer That is where I went looking for it, but I had to add it by the command line because it was not there in the menu
 
ngn
@EriktheOutgolfer Dvorak has a good reason to be under US - Mr Dvorak who designed it was an American. Why would APL be? If anything, it should be under CA :)
 
once it was added it was shown as "apl" in the menu
 
@ngn dyalog moved to UK
 
ngn
@EriktheOutgolfer headquartered in DK
@Potato44 That's interesting, I'm using xfce too (on Debian) and I don't see it in the list when I press "Add".
 
@ngn well it isn't in the language list, it just appears as one of my current layouts, probably from doing setxkbmap apl earlier
 
ngn
5:14 PM
@Potato44 ah, I see. I have it there too.
 
5:51 PM
Okay just read the second lesson, I don't quite get the syntax of tradfns, how does it work?
 
@Potato44 Tradfns need a header line to indicate their syntax. e.g. r←function rarg indicates a monadic function which returns a result. In the body of the function the right argument can be references with rarg and the result with r.
 
@Adám So what is wrong with this? I based it off the example you gave in the lesson tio.run/##SyzI0U2pTMzJT///v@hR24S0/HyFvNLcYi4QR90jtShVIRGIK/…
 
36 messages moved to trash
@Potato44 Nothing, but due to TIO's interface, you need to enclose tradfns in s. Try it online!
 
@Adám okay, thanks are ∇ some kind of block delimeter?
 
@Potato44 In an APL session (REPL) opens and closes the ancient line editor (called the "Del Editor"). In an APL object script, it marks beginning and end of tradfns and tradops, so that you can have multiple in a single script.
@Potato44 I should mention that due to TIO being strictly non-interactive, the Code field is an object script representing the workspace (environment) wherein the Input field's content will be "typed" into the REPL.
 
6:11 PM
@Adám I already knew it didn't work like the other languages, now I know what the differences between the fields are
 
waits 12 minutes
 
@Adám How does ⍴ work, I can't figure it out. The tooltip just says 'shape'.
 
beeps and throws the bot around a few hundred times first before the next session
 
@Pavel Monadic it gives you the shape of its argument, i.e. the length of each axis. Dyadic it makes a new array with shape indicated by left argument, filled with elements taken from right argument.
⎕←2 3⍴'ABCDEF'
 
@Adám
ABC
DEF
 
6:25 PM
Ooh neat
10/10 bot
 
⍞←⍴2 3⍴'ABCDEF'
 
@Adám 2 3
 
⎕←2 4⍴'ABCDEF'
⎕←2 4⍴'ABCDEF'
 
@Pavel
ABCD
EFAB
 
Cool
 
6:27 PM
@Adám is there a difference between star (from the APL primer) and ASCII asterisk?
 
@cairdcoinheringaahing In Dyalog APL they are the same.
 
@Adám How does the bot work?
The TIO API?
 
@Pavel It was written by SocraticPhoenix and is hosted by ThomasWard. It has its own chat room with more info.
Welcome to the APL learning session
To contribute in tonight's APL learning session without having 20 SE rep, send an email to adam@
Last time we went through some operators. I'll continue with more operators if nobody protests.
 
Sounds good
Isn't like every built in an operator though?
 
6:33 PM
@Pavel No, in APL symbols are called functions or operators depending on their nature.
 
an operator generates a function
 
Before we begin, let me introduce you to our very clever chat bot:
#help
 
@EriktheOutgolfer Ah
 
#about
 
6:34 PM
@Adám You can evaluate an APL expression by typing it into chat prefixed by ⍞←. Use ⎕← instead for boxed display and multi-line results. Do not use markdown. Commands: #lb for language bar, #help for table of language elements, #docs for full documentation, #ref for PDF reference card.
 
⎕←'test'
 
@Potato44
test
 
If you do not have an APL keyboard layout (or can't remember the location of a symbol) you can copy and paste from:
#lb
 
@Adám ← +-×÷*⍟⌹○!? |⌈⌊⊥⊤⊣⊢ =≠≤<>≥≡≢ ∨∧⍲⍱ ↑↓⊂⊃⊆⌷⍋⍒ ⍳⍸∊⍷∪∩~ /\⌿⍀ ,⍪⍴⌽⊖⍉ ¨⍨⍣.∘⍤@ ⍞⎕⍠⌸⌺⌶⍎⍕ ⋄⍝→⍵⍺∇& ¯⍬
 
@Adám waves
let me know if the bot explodes
 
6:35 PM
@ThomasWard OK.
 
i'm working on the host node the server running the bot now is on right now, so... :P
 
Is there a range builtin?
 
@cairdcoinheringaahing Yes:
⍞←⍳10
 
@Adám 1 2 3 4 5 6 7 8 9 10
 
Let's do the "Jot" operator.
 
6:37 PM
@Adám Thanks
 
That's the function composition one, right?
 
comes from function composition, like f(g(x)) can be written f∘g(x) (in mathematics).
So too in APL, if f and g are functions, then f∘g x is the same as f g x (APL doesn't need parentheses for function application).
This is of course not very interesting. However, APL also has dyadic (infix) functions.
A f∘g B is A f g B
 
or f(A, g(B))
 
@EriktheOutgolfer Yes, but that isn't APL syntax for a dyadic function f.
 
6:41 PM
sure
I just clarified
 
Both of these are very important when writing tacit APL code.
E.g. If we want to write a function which adds its left argument to the reciprocal (monadic ÷) of its right argument, it can be written as f ← +∘÷
 
@Adám Since ÷ can have multiple be dyadic or monadic, how is the arity resolved?
 
The golden ratio (phi) can be calculated with the continued fraction
@Potato44 If there is an array on its left it is dyadic.
 
@Adám I'm getting Image not found
 
@Adám he meant ÷...
 
6:46 PM
@Pavel https://snag.gy/qWV3fd.jpg
@EriktheOutgolfer What?
@Potato44 So 2÷3 is division and ÷3 is reciprocal.
 
@Adám he probably meant how is the arity of ÷ resolved within composition
 
@Adám Thanks
 
I confused myself because where you have it adding right arguments reciprocal to the left argument. I misread it as adding its reciprcal to itself
 
What if I compose two dyadic functions together?
 
@Potato44 Ah, so in A f∘g B f is always dyadic, and g is always monadic.
 
6:47 PM
I understand how it works since i read ir properly
 
@Adám is there a modulo builtin or do you have to implement it yourself?
 
@Pavel Functions are usually ambivalent and can be called monadically or dyadically. will make sure to call them the right way.
 
ಠ_ಠ I can't read
 
@cairdcoinheringaahing | but the arguments are reversed of what you might expect (opposite of ÷).
 
@cairdcoinheringaahing |⍨
where will reverse the arguments to what you'd expect from other languages
 
6:49 PM
… So phi is 1+÷1+÷1+÷…
We can insert the same function between elements of a list with the / operator, e.g.
 
@EriktheOutgolfer = Jelly's @?
 
⍞←+/ 1 1 2 3
 
@Adám 7
 
I guess we are going to approximate it by reducing with a composition?
 
@cairdcoinheringaahing A g⍨ B == B g A
 
6:51 PM
@Potato44 Yes, we want to insert …+÷…, but that isn't a single function. However, we can use +∘÷:
 
for monadic functions it's something else
 
⍞←+∘÷/1 1 1 1 1 1 1 1 1 1
 
@Adám 1.618181818
 
X⍴Y reshapes Y into shape X:
⍞←+∘÷/1000⍴1
 
@Adám 1.618033989
 
6:52 PM
That's phi ^
That's really all there is to say about . However a warning is in place: (f g)Y is the same as f∘g Y which may fool you into thinking that X(f g)Y is the same as X f∘g Y. However, they are not the same!
 
well, you can make a parameterized function that takes a number being precision (although apl has kinda small float size): +∘÷/⍴∘1
 
@EriktheOutgolfer Nice, but you can actually switch to 128 bit decimal floats:
 
@Adám yeah X(f g)Y is f(X, g(X, Y)) right?
 
⍞←÷7⊣⎕PP←34⊣⎕FR←1287
 
@Adám 0.1428571428571428571428571428571429
 
6:56 PM
@EriktheOutgolfer No, X(f g)Y is f(g(X, Y))
 
there are a lot of train rules...
 
@Adám This is getting into the rules for tacit functions, right?
 
And a nice golfing trick using is having the left operand (which we've called f) be . This allows using a monadic function on the right argument while ignoring the left argument.
This is equivalent to the more intuitive (f⊢)
 
@Adám why does TryAPL not like this?
 
⊢ is ID the identity function, or is that ⊣?
 
7:01 PM
@cairdcoinheringaahing Because that would prompt for input on the server :-)
@Potato44 Both are. is the identity of the right argument, and is of the left.
(Monadically they are the same, though.)
 
@Adám So... they give us a command, and then refuse to let us run that command?
 
@cairdcoinheringaahing TryAPL is not a full APL for technical reasons. The Primer still has a full APL reference. does work on TIO.
Are we (relatively) clear about ? Questions?
 
@Adám I still don't understand the interface with TIO. Why do you enter code into the Input section?
 
um tio doesn't really work like that with apl
 
@cairdcoinheringaahing Input is the immediate execution mode. Each line will get executed by itself. You can also use it to "respond" to and prompts. The Code field will let you define multi-line functions and objects.
Can we continue with the @ operator?
 
7:08 PM
yes
 
(Note: TryAPL is running an old version of APL which doesn't have @. TIO's APL does have @)
 
ooh, new command
 
The @ "At" operator does exactly what it says. What's on its left gets done at the position indicated by its right operand.
⍞←('X'@2 5) 'Hello'
 
@Adám HXllX
 
so is it 'apply at index'?
 
7:11 PM
So we put an X at positions 2 and 5 (APL is 1-indexed by default – you can change to 0-indexing if you want)
@Potato44 Yes. Well, at position. You'll see…
We can also give an array which matches the selected elements:
⍞←('XY'@2 5) 'Hello'
 
@Adám HXllY
 
@Adám sorry to interrupt again, but can you tell me why this is a syntax error?
 
@cairdcoinheringaahing Sure works by me.
 
@cairdcoinheringaahing there's no error in there
 
@cairdcoinheringaahing Ah, try )erase abs first.
 
7:14 PM
@Adám Ah, now it works. Thanks!
Is abs a builtin?
 
there are no "reserved words" in apl
 
@cairdcoinheringaahing To prevent losing your code and data, APL will not let you use the name of a function for data or vice versa without you explicitly erasing them first.
 
@Adám that doesn't happen for me
 
@EriktheOutgolfer TIO link or it did happen :-)
 
huh
      abs ← ×∘×
      abs ← ×∘+
      abs
×∘+
(I know the functions are wrong :p)
@Adám
 
7:18 PM
@EriktheOutgolfer name of a function for data or vice versa
 
So, is the only way to do absolute value square then square root?
 
@EriktheOutgolfer (These are really useful function in complex math)
@cairdcoinheringaahing No, monadic | because in math that's |x| but APL harmonises all monadic functions to be prefix.
 
> Magnitude (Modulus)
That has no indication for absolute value
 
I;m looking at those docs for the forking rules and they are composing with an array like
⍳∘1
what does tha mean?
 
7:20 PM
@cairdcoinheringaahing looks like tryapl has got it wrong
"Magnitude" is absolute value
 
@cairdcoinheringaahing The absolute value is the magnitude (ignoring the sign). It has to be called that due to complex numbers.
@Potato44 This means the dyadic function but "pre-populate" the right argument with 1. So that gives you a new monadic (prefix) function: (⍳∘1)x is x⍳1 (which is the index of the leftmost 1.
 
@Adám (o_o coincidence?)
 
@Potato44 And right, in discussing I completely forgot mentioning composing with arguments:
g←f∘A where f is a dyadic function and A an array (any data) gives g, a new monadic function which calculates x f A.
 
@Adám so it is partial application, can you partially apply to the left arguent?
 
@Potato44 Similarly g←A∘f makes g a function which calculates A f x
 
7:25 PM
@Adám noteworthy: B(f∘A) isn't valid syntax, (f∘A)B is
 
@EriktheOutgolfer Yes, all monadic functions are prefix.
Btw, for operators you can "curry" their right operand. So WithTwo←∘2 is a new monadic operator which can in turn modify a dyadic function to become monadic (using 2 as its right argument). E.g. + WithTwo 3 will give 5.
This is especially useful with the f⍣n "power operator" which applies its f operand functionn times.
So twice←⍣2 is an operator which applies a function twice. E.g. 2+twice 3 is 7.
 
@Adám and this can be very useful:
 
And inv←⍣¯1 is an operator which will apply a function -1 times, i.e. applies the inverse of that function.
 
inverse ← ⍣¯1
duh ninja :p
 
I'm guessing not, but do all functions have inverses?
 
7:31 PM
@Potato44 No, but surprisingly many do. And if you derive new functions tacitly using only operators and invertible functions, then the resulting function can also (generally) be inverted automatically.
 
@Potato44 no
an example would be monadic | (magnitude)
 
@Potato44 Even structural functions can be inverted:
⍞←('x'∘,⍣¯1) 'x'∘, 'abc'
 
@Adám abc
 
where {|⍣¯1⊢⍵} is an identity function which throws if the argument isn't a positive integer
 
structural?
 
7:33 PM
So what happened here is that we applied the function 'x'∘, which prepends the letter x, and then we applied its inverse, which removes an x from the left side.
@Potato44 Yes, e.g. drops elements and its inverse pads elements (it will use the default fill element):
⍞←3↓⍣¯1⊢'hello'
 
@Adám    hello
 
So I applied the inverse of dropping the first three characters, i.e. pad three characters (spaces) on the left.
 
@Adám is that hardcoded in the interpreter or is there magic in the interpreter?
also, i'm having some connectivity problems at the moment
 
I think it's very noteworthy that you can invent a useful function on accident pretty easily
 
@Potato44 The specific function 'x'∘, is not hardcoded. Instead the interpreter has a bunch of rules which lets it determine the inverse of various compositions.
@EriktheOutgolfer You mean ×∘× (A times the direction of B) and ×∘+ (A times the conjugate of B)?
 
7:39 PM
@Adám and ↓⍣¯1 too :)
I'd say that ⍣A where A < 0 is a very sophisticated feature of apl
 
@EriktheOutgolfer is that equivalent to ↑?
 
One of the most useful inverted functions is ⊥⍣¯1 (inverse of convert-from-base) which will use as many positions as needed to represent a number in a given base:
⍞←2⊥⍣¯1⊢123
 
@Adám 1 1 1 1 0 1 1
 
@Potato44 No, is "take":
⍞←3↑'Hello'
 
7:41 PM
@Adám Hel
 
@Adám I meany monadic ↑.
 
@Potato44 Monadic and do something entirely different, namely raising and lowering the rank. That's covered in Lesson 1, iirc.
 
or is that not how ⍣ works?
 
@Adám yep they are
 
@Potato44 No, does not invert the symbol, except where the upside-down symbol happens to be the inverse too :-)
OK, let's see if we can finish @.
Until now, we've only used it to substitute elements. But we can also use it to modify them:
⍞←(-@2 5)10 20 30 40 50 60
 
7:44 PM
@Adám 10 ¯20 30 40 ¯50 60
 
Here we applied the monadic function - (negate) at positions 2 and 5.
 
@Adám so 'map at'
 
⍞←7(+@2 5)10 20 30 40 50 60
 
@Adám 10 27 30 40 57 60
 
like jelly's ¦ (sorta)
 
7:45 PM
And that's the same but using a dyadic function.
@Potato44 I guess so.
 
is @ an operator or a function?
 
operator
 
Now we have been using an array right operand. If we use a function right operand it gets applied to the right argument, and the result must be a Boolean mask instead of a list of indices.
⍞←⎕A ⍝ uppercase alphabet
 
@Adám ABCDEFGHIJKLMNOPQRSTUVWXYZ
 
back in 3 minutes
 
7:48 PM
⍞←'x'@(∊∘⎕A)'Hello World'
 
@Adám xello xorld
 
is membership, so the derived function ∊∘⎕A gives a Boolean for where elements of the right (and only) argument are members of the uppercase alphabet:
⍞←(∊∘⎕A)'Hello World'
 
@Adám 1 0 0 0 0 0 1 0 0 0 0
 
And that is used as mask by @ to determine where to substitute with x.
See e.g.
4
A: Goto the Nth Page

AdámAPL (Dyalog), 83 82 bytes Anonymous infix function taking current as left argument and total as right argument. {('prev '/⍨⍺>1),('x+'⎕R'...'⍕∊(⊂1⌽'][',⍕)@⍺⊢'x'@(~∊∘(1,⍵,⍺+3-⍳5))⍳⍵),' next'/⍨⍺<⍵} Try it online! {…} explicit lambda where ⍺ and ⍵ represent the left and right arguments:  ⍺<⍵ ...

 
i.e. @ uses the result of on it
 
7:51 PM
where I use @ twice.
 
@Adám whatever :p
 
what is ⍸?
 
@Potato44 is the (new) "where" primitive which converts a Boolean array to a list of indices of the 1s.
⍞←⍸1 0 0 0 0 0 1 0 0 0 0
 
@Adám 1 7
 
⍞←(⍸∊∘⎕A)'Hello World' ⍝ i.e. "where uppercase"
 
7:53 PM
@Adám 1 7
 
@Adám um, is there any function to convert to lowercase and/or a "lowercase alphabet" builtin?
 
@EriktheOutgolfer Due to this being dependent on the whims of the Unicode consortium, it is currently a special-access function:
⍞←819⌶⎕A
 
@Adám abcdefghijklmnopqrstuvwxyz
 
@Adám are there any docs with the i-beam functions anywhere?
 
@EriktheOutgolfer I-beams
is a special operator (although it follows normal APL syntax) which uses a positive integer operand to select a functionality.
 
7:59 PM
@Adám aside from the primer on TryAPL, is there a complete list of all functions and operators?
 
Some of the numbers are a little bit mnemonic. E.g. 819 looks a bit like BIg. It takes a Boolean left argument which says whether the right argument should be made big (uppercase) or not (lowercase):
#help
 
@cairdcoinheringaahing ^
 
@Adám Ah, thanks
 
08:00 - 20:0020:00 - 23:00

« first day (287 days earlier)      last day (2366 days later) »