@Uriel I don't know who's idea it was. Maybe Iverson's. Anyway, The pairings certainly make sense: ⍳ index/indices ⍸ interval-index/indices-of-ones. ∊ and ⍷ as you know. Monadic ∊ is enlist, and I'll lobby for monadic ⍷ to be prototype, i.e. both are partial info about an array. One is just the data, the other just the structure.
So Hurricane Ophelia avoided #Dyalog HQ ... although it did get a bit breezy and we had a very strange reddish sky!
http://www.bbc.co.uk/news/uk-england-41635906
While Jelly atoms have fixed arity/valence, APL functions are often ambivalent. They may be monadic (prefix), dyadic (infix) or both. tradfns may also be niladic (not taking any arguments).
Indeed, most primitive functions, like + - × ÷ are ambivalent (i.e. monadic/dyadic).
@Mr.Xcoder No. Square in terms of × would be to use the sole argument also as left argument. This can be specified for any function by using the ⍨ operator. ×⍨ is a monadic function; square. +⍨ is a monadic function; double.
Speaking of absolute value. Mathematics uses a mixture of prefix, postfix, and enclosing notation. APL uses only prefix for functions. So while math uses |N| for abs(), APL uses just |N
@Mr.Xcoder so 1 2 3=2 2 2 gives 0 1 0. If you want to compare whether two arrays are identical, just add an underbar: ≡. And ≢ is of course the opposite.
The first expression which isn't an assignment causes the function to terminate with that value as result. This is only the case for dfns and dops, not for tradfns and tradops. Tacit functions can only have a single expression.
Oh, and the arguments. The right argument of a dfn/dop is ⍵ (Omega, the rightmost letter in the greek alphabet)
@Mr.Xcoder Yeah, but print to stdout is implicit in most cases, so no need for the ⎕←
@Mr.Xcoder Also ⍞ is a pictograph of your console with a quote in it. It is for sending messages, i.e. ⍞← is print to stderr and querying ⍞ reads text from stdin.
@Mr.Xcoder TryAPL resembles a real installed APL system more, but is rather limited. You can only use dfns, dops, and tacit functions. And you cannot use line breaks.
The rules are very simple. Operators are left-associative and go before functions, which are right-associative. Sounds complex? Works out nicely in practice.
@Mr.Xcoder Unfortunately, I have to go. I may have wifi in the train. Otherwise I'll probably be back online later tonight. I surely will be tomorrow. Hope you enjoyed the first lesson.
@J.Salle No. the list will be passed as-is as ⍵. The problem is that the Boolean condition before : will be a list too, and you can't have both true and false!
You don't need parentheses (but may use them) to apply a function, but functions are right-associative, so the leftmost ∇ sees (⍵-1)+∇(⍵-2) as its argument!
@Adám Nice! I was trying to solve a challenge in APL but apparently Tryapl wasn't working properly? I was getting a message like "couldn't process your request" or something like that. It's working now though
@J.Salle Unfortunately TryAPL isn't always so stable. It is being worked on as we speak. Hopefully it will have gotten a total backend overhaul by the end of the year. TIO should be fine though (but doesn't have a keyboard).
@J.Salle Maybe you should get the desktop version of Dyalog APL?
@Adám well, registration just makes you feel more obligated, like somebody watching over your shoulder looking what you do with the program. the info ain't that much of a nuisance to me
@Uriel Oh, but I can assure you that dyalog.exe does not in any way register what you do with the program. Your installer package is identical to everyone else's and you don't even have to put in your actual license number when installing. We do not use any kind of DRM or license checking whatsoever.
It doesn't even check for updates or offer to send bug reports home.
@Uriel We will never give out your information, and we only send you information relevant to your install (although you can just ask not to be on the mailing list). We do need your contact info to be able to sue you in case you use the product for commercial purposes.
@Uriel Oh, I see. But we actually have no way of controlling that. It would only be in the rare case that we stumble upon a commercial product which clearly uses Dyalog and there is no trace of licensing. It has happened that people contacted us for support in regards their commercial system made with Dyalog, but without commercial licence. When we asked for their license number we could see that they only had a non-commercial one. Then we kindly ask that they purchase full rights or cease.
First, let me introduce you to ⍳. The monadic function generates the first N indices. E.g. ⍳5 is 1 2 3 4 5 (Dyalog APL counts from 1 by default, but you can switch to 0 if you want).
Mnemonic: ⍳ is Greek Iota, like Latin I, for Indices.
@J.Salle Sure, that's what's happening. But I mean how it works: ∘.× derives a new unnamed dyadic function ("multiplication table") which is then modified by ⍨ to become monadic.
@J.Salle No problem. Happens on occasion by me too.