« first day (364 days earlier)      last day (2283 days later) » 
00:00 - 20:0020:00 - 23:00

ngn
12:46 AM
@J.Sallé I tried to golf it further, this is the best so far: (⊂|¨∘-∘⍳∧/)⍳∘⊂⊢|⍳∘≢ The challenge itself seems to be off by one, and that prevents shorter solutions. I think the answer for [15] should be 0.
 
 
12 hours later…
12:19 PM
@ngn Wow, thanks a bunch man. I have to confess though, I've absolutely no idea what's going on in this function >.>
 
ngn
12:38 PM
@J.Sallé It's the "upper bound" idea I mentioned before. As a dfn: {((⊂⍵)|¨-⍳∧/⍵)⍳⊂⍵|⍳≢⍵}
 
@ngn While I have no idea what it does, how can you need ¨ on the scalar function | ?
 
ngn
@Adám you're right, I don't
@Adám my brain must have been asleep last night when I wrote this, and I've mixed up k and APL...
 
@ngn I personally like that scalar functions penetrate (unlike in J, and K apparently).
 
ngn
@Adám in k residue (x!y) is a special case, it also acts as an "I-beam" (-n!x), so it requires each (') with lists
 
@ngn Oh, but all other scalar functions don't?
 
ngn
12:45 PM
@Adám all other arith funcs penetrate, only x!y doesn't penetrate on the left
 
@ngn Weird.
 
@ngn oh, that's more readable. I get it now, but what is the upper bound derived from?
 
ngn
@Adám how often do you use multiple moduli...
 
@ngn Irrelevant.
 
ngn
@J.Sallé the upper bound is the LCM (least common multiple: ∧/) of "a"
@Adám x!y is also "map" - it creates a dictionary with keys x and values y
@Adám it's hard to squeeze a useful language into ASCII, actually
 
12:51 PM
@ngn Yeah, I know. That's fine, imho, as that just overloads due to data type. You can't mod-char.
 
ngn
@Adám I think it depends on whether x is a list, not on its type (char vs number)
 
@ngn Ugh, yeah, that's what I don't like. I'd happily overload ⌊⍵ and ⌈⍵ to be case-folding, and maybe even |⍵ to be TitleCase.
 
-⍵ could even be flip-case…
 
ngn
@Adám generally in k arithmetic on chars converts them to ints (except floor - "_"), I think that's a good thing
@Adám APL's (Dyalog's?) ⎕UCS is awkward
 
12:56 PM
@ngn I don't like implicit type conversions (other than between numeric types).
@ngn Why?
 
ngn
@Adám too long :)
 
@ngn APL is not a golfing language, and after seeing that name once, you never forget it!
 
ngn
@Adám it's a bad name
 
@ngn Why?
 
ngn
@Adám misleads me into thinking it always converts from/to UCS-2 or something
 
12:59 PM
@ngn Wow. I've never thought that. The dyadic form is obscure, but probably necessary for some.
 
ngn
@Adám UTF-8 is what most people care about these days :)
 
@ngn No, UTF-8 is what most people shouldn't have to worry about these days.
 
ngn
@Adám k doesn't even bother with UTF-8
@Adám We should all abandon our roots and become American? :D
 
@ngn No, I mean in Dyalog APL, characters are just characters. You need not worry about representation, and monadic ⎕UCS converts back and forth between characters and integers.
@ngn If an application needs ⎕DR then I'd question its methods.
 
@Adám Yeah tell me about it. I got a whole application developed that runs on any physical machine (unix and pc alike), but when we Docker it into our cloud server the underlying DB breaks because it's not UTF-8.
 
1:12 PM
@J.Sallé Wouldn't have happened if you used APL…
 
ngn
@J.Sallé surely, a matter of configuration?
 
@Adám Hahahah! I'd love to convince the whole company to switch from Delphi and Java to APL but I highly doubt that's gonna happen.
@ngn our DBA said it shouldn't happen at all because the original DB we backed up to use in the Docker environment is encoded in UTF-8, but apparently the VM disagrees vehemently.
 
ngn
@J.Sallé I assume there are only two alternatives for Portuguese - UTF-8 and Latin-1, so it should be easy to tell
 
@ngn There's also "Portuguese.1252" and "Portuguese_Brazil.1252" which seem to be relevant. My boss said he's found a fix, but he's not in until later this afternoon.
 
ngn
1:31 PM
@J.Sallé for Cyrillic we have this brilliant website: 2cyr.com/decode :)
@J.Sallé you paste any misencoded text and it tells you what's wrong with it and what the correct decoding is
 
@ngn whoa that's cool. I've never thought of a DB in Cyrillic but now that I think of it, sounds cool.
 
Informal APL learning session tonight at 18:30 UTC in https://chat.stackexchange.com/rooms/52405/apl. See https://chat.stackexchange.com/transcript/message/41299896 if you don't have 20 Stack Exchange rep points.
 
I'm gonna learn me some Russian some day
 
 
2 hours later…
3:12 PM
is there some way to get all the sizes of an array? i.e. {⍵ ⍵ ⍵ ⍵}(3 1⍴⊂(1 2 3)(4 5 6)) would give (4) (3 1) (2) (3) or similar (if I've understood my code correctly)
 
Ven
@dzaima you want each size?
 
@Ven I want the sizes and depths in one comprehensible array
 
Ven
your code gives a scalar with 3 scalar with 2 scalars in it
 
ooh {⍵∘{⍴ (⊃⍣⍵) ⍺}¨¯1+⍳≡⍵} seems to work
 
Ven
3:17 PM
ô.o
 
@dzaima What id the array is not uniform, e.g. (1 2)(1 2 3) ?
 
@Adám then I don't care what happens. I just want to understand what mess of an array I've made to fix it :p
 
@dzaima Is ⍴↑⍣≡ acceptable?
 
@Adám I specifically want the boundaries from depths to shapes
because comprehending those is still pretty difficult for me
 
@dzaima I'm not sure I understand what that means.
@dzaima May dfns' displayr can help you visualise and enumerate the structure?
@dzaima Top left corner is the shape, bottom left corner is the depth: Try it online!
 
3:25 PM
@Adám heh, that's cool. Going down-right from the top-left corner I see my 4;3 1;2;3 :D
 
@dzaima Yup. And this will even handle ragged arrays. And hint about the data types.
 
@Adám actually, that probably just made me realize that the boxed output makes much more sense than I previously thought :o
 
@dzaima Good. Unfortunately ]box will not give you the numbers in the frames. Although I've suggested that we fold all the various display tools from dfns into ]box.
 
3:53 PM
is there a simple way to execute a function on an array 1..x times? e.g. get all 90 degree rotations of a matrix. ((⌽⍉)⍣⍳4) sadly doesn't work
 
Ven
@dzaima from 0 to 90 degrees?
 
@Ven 0, 90, 180, and 270 degree rotations of the same matrix
 
@dzaima you mean (⌽⍉)⍣(⍳4) but yeah it won't work
because Dyalog isn't a golfing language :P
 
Ven
@dzaima (3 3⍴⍳9)∘{⍵⌽⍺}¨0 90 180 270? But that's not what does
 
@Ven huh what is that
 
Ven
3:57 PM
@EriktheOutgolfer ⌽-ing 3 3⍴⍳9 with 4 different values
 
of course you can't just rotate an array e.g. 30 degrees ;)
 
Ven
@EriktheOutgolfer Obviously :-)
 
⌽⍉ is rotate 90 degrees cw
 
Ven
⍞←((3 3⍴⍳9)∘{⍵⌽⍺})¨⍳4
 
@Ven  2 3 1  3 1 2  1 2 3  2 3 1
 
3:58 PM
no he means a 2D array
 
@Ven I meant literally rotate a matrix on numbers :p
(of course turning them upwards afterwards :p)
 
Ven
ah!
 
{⌽⍉⍵}\4⍴⊂ seems to work, but probably is pretty inefficient
 
or ⊢∘⌽∘⍉\4⍴⊂ for 100% tacit
 
ngn
@dzaima are you solving "rotation summation"?
 
4:08 PM
@ngn nope, trying to make a rail creator for formic functions :p
 
4:19 PM
@dzaima Like this?
⎕←(3 3⍴⍳9)∘{⌽∘⍉⍣⍵⊢⍺}¨⍳4
 
@Adám
┌─────┬─────┬─────┬─────┐
│7 4 1│9 8 7│3 6 9│1 2 3│
│8 5 2│6 5 4│2 5 8│4 5 6│
│9 6 3│3 2 1│1 4 7│7 8 9│
└─────┴─────┴─────┴─────┘
 
@Adám yeah, that was my first attempt at doing this
 
@dzaima We really need to extend ⍣n to take vector ns like in J.
 
@Adám oh, so my random idea wasn't actually nonsense (but only in J) :p
 
ngn
@dzaima an "iterate operator" is near the top of my wishlist for APL :)
 
4:28 PM
@ngn How would you want it to work? Like one of J's three? Memoing? Syntax?
 
ngn
@Adám like in k (I'll show in a moment), but probably with other syntax - more suitable for apl
 
:42469161 markup doesn't work in multiline
 
ngn
@dzaima thanks :)
@Adám the first form (n f\ a) specifies how many times (n) to iterate the function (f) over the array (a); the second form iterates until convergence - like apl's "fixed point" operator but preserving intermediate results
 
4:45 PM
@ngn Wouldn't ⎕IO←0 ⋄ {⌽⍉⍵}⍣(⍳4)⊢3 3⍴⍳9 work fine for the first form?
 
ngn
@Adám yes
 
@ngn The second form isn't until convergence, but rather until seen before. (I implemented that in Stencil.)
 
ngn
@Adám almost correct - until it matches the first or last in the already existing sequence
 
@ngn Ah, so if two inputs can give the same output, then it could potentially end up running forever?
 
ngn
@Adám yes
 
4:47 PM
@ngn I think "seen before" is more generally applicable.
 
ngn
@Adám most likely arthur wanted to avoid O(n^2) performance
 
@ngn Ah, makes sense.
@ngn The second form is unfortunately more tricky without having some special value indicating repetition until seen-before/first∨last. Didn't we discuss this before?
 
ngn
@Adám I may have said this before: I think k's / and \ show genius-level skills of language design
 
@ngn Did you ever think that Arthur Whitney was not a genius‽
 
ngn
@Adám when met him for the first time, I assumed he was marketing just another apl clone :)
 
4:55 PM
@ngn But, but, he's the Arthur Whitney!
 
ngn
@Adám a legend in the APL/J/k/Wall-Street-criminals community, but virtually unheard of elsewhere
@Adám I like the symmetry: / decode, \ encode, / reduce, \ scan, / repeat, \ iterate, / comment, \ command (also: close multiline comment)
 
@ngn Sure, that is very nice.
 
ngn
@Adám ⍣(⍳n) loses some of the appeal, but I don't have a better suggestion
@Adám maybe use a different symbol for the variant that preserves intermediate results - is there a quad-star?
 
@ngn I'm thinking f⍢n but that still doesn't solve the problem of until-seen/first∨last.
 
ngn
5:11 PM
@Adám either way it would be useful
 
@ngn Ah, wait, yes it does, as then a special value (e.g. ) could mean until…
Since, ⍣⍬ would just mean 0⍴⊂
 
ngn
@Adám an empty result is a valid result, it might be what the programmer intended
@Adám I mean, that zilde might be the result of some expression which just happens to return an empty result. In that case the result from ⍣ should be empty too.
 
@ngn No, I mean, if we extend to handle vectors (or for that sake any simple array) then ⍣⍬ clearly means none. But if we instead let ⍢n mean all iterations from 0 to n, then ⍢⍬ can mean until repeat.
 
ngn
@Adám ah, I see
@Adám there would be no symmetry between ⍣≡ and ⍢⍬
 
@ngn I'm currently proposing f⍤g:atop; f⍥g:over; f⍥n:depth; f⍢g:under.
@ngn True. But it doesn't make sense to iterate until re-appearing using any other function than .
 
ngn
5:17 PM
@Adám what's "depth"?
APL vendors should sign a Sguiggle Non-proliferation Treaty :)
 
@ngn Basically the same as f⍤n but for depth instead of rank. J has it which is strange, as it is much more central to APL than to J.
 
ngn
@Adám aha, ok
 
@ngn AFAIK, only Dyalog and NARS add.
@ngn It is one operator that I find it extremely tricky to write. And basically impossible to write cleanly.
 
ngn
@Adám k's tetradic .
 
@ngn K's what is tetradic?
 
ngn
5:25 PM
@Adám I'm not sure if you're refering to something equivalent, but k has a tetradic version of dot (.) that can amend an array at depth
 
@ngn It isn't amending (like @?), just function application.
 
ngn
@Adám well, yes, @[a;i;f;y] amends at breadth (if that's the correct term?) and .[a;i;f;y] at depth
 
@ngn bredth? That's not a word.
@ngn But K only has one type of array-in-array.
 
ngn
@Adám true
 
@ngn Wait, can i not be negative?
 
ngn
5:30 PM
@Adám I don't know what it would do with out-of-range indices
.[a;i;f;y] is to @[a;i;f;y] like APL's a⊃b is to a⌷b
 
@ngn In J and APL, negative rank means begin at the top instead of at the bottom.
 
ngn
@Adám ... sometimes
@Adám not when indexing
 
@ngn Don't get it.
 
ngn
⎕←⎕a[¯1]
 
@ngn
INDEX ERROR
 
5:34 PM
@ngn Not indices, rank: ⍤¯2 is apply on the cells of the major cells. ⍤2 is apply on the leaf rank-2 cells.
 
ngn
⎕←1 2 ¯1⍉3 4 5⍴⎕a
 
@ngn
DOMAIN ERROR
 
ngn
@Adám ok, anyway, so what's your idea?
 
@ngn Not axes either. Only ranks!
 
ngn
@Adám agreed, I understand
 
5:36 PM
@ngn ⍢2 applies to the elements of the elements. ⍢¯2 applies to the leaf elements of elements.
(or the other way around, doesn't really matter)
 
ngn
@Adám I was confused because you asked about the i in .[a;i;f;y]
@Adám this depth operator is not high on my wishlist :)
@Adám though I can see how it would make sense
 
@ngn Neither is it on mine. Highest priority is atop. Then Over and Under. Only then things like Depth and Obverse.
@ngn It is rarely needed (but so is Rank). Only when you end up with craziness like A f¨¨¨¨ ⊂⊂B do I wish I had it. Rare though.
 
ngn
@Adám Why is atop so important? You already have it.
 
@ngn Not as an operator. Because it makes many trains so much simpler, and because it cures schizophrenia.
 
6:12 PM
@ngn well, you can implement it as atop ← {⍺←⊢⋄⍺(⍺⍺ ⍵⍵)⍵}, but as a primitive it would make stuff really simpler...next step is to, of course, be able to assign to primitives (maybe primitive∘←function or primitive(⊢←)function should be allowed)
@ngn another way to see it is that, well, why have compose () but not atop ()?
@ngn and, as Adám said, ((this(((is((schizophre((n((ia))))))))))) ;)
 
@EriktheOutgolfer Uh, or just atop ← {⍺←⊢⋄⍺⍺ ⍺ ⍵⍵ ⍵}. But Dyalog will never allow assignment to primitives like ngn/apl does. There is, however, a possibility we'll allow custom overloading of primitives for classes:
∇result←a plus b
  :implements +
  result←
etc.
or just:
∇result←a + b
  result←
etc.
And then it isn't so far off to think:
+←{
  result
etc.
 
@Adám the reason I didn't mention that is because it really looks like a syntax error (monadic modified assignment? no, thanks)
 
@EriktheOutgolfer Well, it is exactly because it is a syntax error that we can make it meaningful.
@EriktheOutgolfer … just like line breaks in parens and (name:value).
 
@Adám inspirational
 
@EriktheOutgolfer Notice that unassigned symbols are syntax errors:
⍞←3 % 5
 
6:19 PM
@Adám SYNTAX ERROR
 
@Adám eugh I can't think of anything dyadic % can represent
 
@Adám why are they syntax errors?
 
they're not valid identifiers...
 
@Cowsquack … so they are syntax (errors)
 
perhaps I should rephrase my question, why were they implemented that way?
 
6:21 PM
that means there's no possibility that's a variable, and it's undefined, that means it can never be defined, so it's always an error, so it's a syntax error
wow good timing
 
@Cowsquack They are not implemented at all. The tokeniser just stops when it sees unknown syntax.
 
uh, Control+Shift+0 doesn't work
 
@EriktheOutgolfer Nand? ?
 
@Adám yes, even though it's in the IME layout
it doesn't work in Dyalog IDE either
 
@EriktheOutgolfer May be blocked/captured/taken by some other application or Windows. That's why I prefer my AltGr keyboard.
 
6:29 PM
@Adám I don't have many keys available, Alt is for NARS2000, AltGr is compose key (WinCompose), Shift is used too often...hm, maybe I'll put it to Right Ctrl, but would be uncomfortable...
 
Welcome to the APL learning session!
We're going through system functions. Let's continue with various such which deal with functions and other items under program control.
If you want to have an application start without having the user enter a command (e.g. a function name) to boot it, you can assign an expression to ⎕LX (Latent eXpression) and then save your workspace with ⎕SAVE. When the workspace is loaded (including from the command line) APL will do ⍎⎕LX.
This is what happens when you load the various workspaces supplied with APL: Try it online!
Since APL does not enforce a naming scheme, you may wonder what a certain name is.
⎕NC (Name Classification) to the rescue!
Each type of item has a number. 2 is variable, 3 is function, 4 is operator, 9 is object.
 
@Adám why those numbers specifically?
 
@EriktheOutgolfer Not really any reason. I guess they go from least to most "complex". Try it online!
0 is undefined (but valid name). ¯1 is invalid name.
 
so I guess (1>⎕NC) can determine if there's anything "attached" to a specific "name"
 
1 is really rare these days. It is a line label, and can only occur while a tradfn/tradop is running or suspended. Try it online!
@EriktheOutgolfer I'd say 0=⎕NC tells you whether a name is available to you.
 
6:40 PM
@Adám available? hm
 
@EriktheOutgolfer As in, you may use it.
Sometimes you want even more info. If the argument to ⎕NC is nested, then the values get a decimal which mean: .1=traditional, .2=field/direct, .3=property/tacit, .4=class, .5=interface, .6=external class, .7=external interface. Try it online!
 
⎕←⎕NC th
 
@RosLuP
VALUE ERROR
 
@RosLuP You need quotes.
 
⎕←⎕NC 'th'
 
6:43 PM
@RosLuP
0
 
@RosLuP There you go! All names will be 0 for the bot, since it is running a new clean session each time. However you can define some things and then look:
⍞←⎕NC'var' 'ref' ⊣ var←42 ⊣ ref←#
 
@Adám 2.1 9.2
 
⎕←⎕NC '⎕NC'
 
@RosLuP
¯1
 
yeah good luck assigning to ⎕NC
 
6:47 PM
Using those same codes, you can also use ⎕NL (Name List) to enquire which items of those name classifications are visible: All of dfns' operators.
@EriktheOutgolfer Right, the beauty of having a language where you never risk clashing with a built-in.
 
@Adám "clashing with a built-in" isn't necessarily bad unless you happen to use that built-in, then you're doomed
 
You can also specify decimals to get just those specific things. and you can get just things beginning with specific letters by giving a list of letters as left argument: Try it online!
 
If you'd rather have a VTV (vector of text vectors, i.e. a list of strings), then use negative numbers. APLers often use this shortcut to list everything: ⎕NL-⍳9
 
6:52 PM
@EriktheOutgolfer You want all dops that begin with satisfy the regex bs*?
 
@Adám uh, bs.*, but there's a DOMAIN ERROR
 
⎕←⎕NL '?'
 
@RosLuP
DOMAIN ERROR
 
@EriktheOutgolfer Yeah, there is no facility for that 'bs' ⎕NL 4.2 just gives you dops that begin with b or with s, but you can do 'bs.*'⎕S'&'⎕NL ¯4.2.
 
6:55 PM
@EriktheOutgolfer ⎕NL is an ISO system function from long before regex. I guess we don't tinker with it.
Anyway, let's move on.
@RosLuP What are you trying to do?
 
is there a more elegant way of getting a single item array of hello than 1⍴⊂'hello'?
 
@dzaima ,⊂'hello'
If you find that the name you want to use is unavailable, you may want to EXpunge its current value with ⎕EX:
⍞←⎕NC'var' ⊣ ⎕EX 'var' ⊣ var←42
 
@Adám 0
 
I created, removed, and enquired ^
 
⍞←⎕EX'+'⋄+
 
6:59 PM
@EriktheOutgolfer 0
 
what, it should say +
⍞←⎕EX,'+'⋄+
 
@EriktheOutgolfer 0
 
In all operator diadic d 1 2 3 4 d 9 is 1 d 9,2 d 9,3 d 9, 4 d 9?
 
@EriktheOutgolfer No, it displays the result of ⎕EX which was 0 to tell you that the name is still unavailable (because it is invalid).
 
⍞←⎕EX'÷'⋄⍞←+
 
7:00 PM
@EriktheOutgolfer 0
 
⎕←EX'+'⋄⎕←+
 
@EriktheOutgolfer
VALUE ERROR
 
@RosLuP Only scalar functions map like that. They are + - × ÷ etc.
 
⎕←⎕EX'+'⋄⎕←+
 
@EriktheOutgolfer
0
+
 
7:01 PM
finally
 
@EriktheOutgolfer What is the difference in what you entered so that it gave you VALUE ERROR instead of the above ^^ ?
 
@Adám missing a ⎕
 
@EriktheOutgolfer No, you cannot expunge built-ins.
@EriktheOutgolfer Oh, right. Silly me.
 
What does it mean 'scalar function' ? That has its arguments each scalar?
 
7:04 PM
If you only want to use an already used name temporarily, then you can use ⎕SHADOW instead of ⎕EX. The name will then be freed up for your use until the current function terminates.
Note that shadowing happens automatically in dfns and dops when you just do regular assignments. I.e. in a dfn, var←42 really means ⎕SHADOW 'var' ⋄ var←42.
I wouldn't recommend using ⎕SHADOW though. It is much better to localise your variables in the function header by putting ;varName at the end of the header.
 
@Adám that caused me headaches multiple times. I ended up doing var⊢← 42 and that works by some reason
 
⎕⊢←var⊢← 42
 
@dzaima Yes, regular assignments. You can access global names, and modify them to with modified assignment, which is why var⊢←42 works. It is just like var+←42 adds 42 to the current value, but instead it replaces the current value completely.
 
@RosLuP bot won't reply since it doesn't start with ⎕← or ⍞←
 
@RosLuP ^ and that wouldn't work anyway, as you cannot modify .
 
7:09 PM
⎕←var⊢← 42
 
@RosLuP
VALUE ERROR
 
⍞←var ⊣ var+←42 ⊣ var←42
 
@Adám 84
 
@Adám I mean I understand why it works, but why that doesn't have the same shadowing is strange
 
@RosLuP You increase var's value when it doesn't already exist.
 
7:09 PM
@RosLuP does var exist
ninja :/
 
@dzaima You wouldn't want to shadow if you explicitly modify the existing variable, would you? If you want a new var based on the global var, but without overwriting the global, do var←var+42
 
@Adám looks like a bug to me?
 
@Adám ok that that works is even more strange.
 
@EriktheOutgolfer @dzaima Why?
 
@Adám either you shadow it or you don't, not only sometimes (even less in the same expression)
 
7:12 PM
@Adám maybe I'm too used to Python's behavior where var+=5 in a function doesn't affect the global var...then again you can't assign to a global var without mentioning it explicitly with global in the function >_>
 
⍞←var ⊣ var+←42 ⊣ var←ava←a
 
@RosLuP VALUE ERROR
 
@dzaima The first (the rightmost) var takes the global value because there is no local value. Then the assignment shadows to create a local.
@RosLuP a needs a value.
 
⍞←var ⊣ var+←42 ⊣ var←ava←3
 
@RosLuP 45
 
7:14 PM
@EriktheOutgolfer Yeah. Well, at least here you have the option to overwrite or shadow.
 
@Adám the problem is that the overwriting option is pretty shadowed itself
 
@dzaima shadowed?
 
maybe some pun...
 
@Adám It took me a couple minutes to think that ⊢← should work
 
@EriktheOutgolfer Btw, there is bug which allows you to assign to an undefined global name from inside a dfn, but I'm not really supposed to tell you, since it may go away without warning.
 
7:17 PM
@Adám uh, what?
 
But, since this is PPCG, and it may save you a byte or two var∘← will set var globally from inside a dfn, even if it was previously undefined.
 
⎕←{xorg⊢←⍵}2⋄⎕←xorg
 
@EriktheOutgolfer
VALUE ERROR
 
@EriktheOutgolfer Wat?
 
⎕←{xorg∘←⍵}2⋄⎕←xorg
 
7:18 PM
@EriktheOutgolfer
2
2
 
oh yeah it does happen
 
@EriktheOutgolfer But it is a quirk of how is implemented, so only use it for golfing, never for production. In FP, you shouldn't set globals, and dfns are designed for FP.
 
@Adám well, in that case, I hope for the "bug" to remain in Dyalog 17.0 :P >_> remembers APL isn't intended for golfing please, please, please make the bug go away ASAP
 
@EriktheOutgolfer It still works in my 17.0 from Jan 17…
 
@Adám I mean when it gets released
 
7:21 PM
@EriktheOutgolfer I'm pretty sure it will stay for a while, as customer production code may use it.
OK, let's say you've build a bunch of functions that call each other, and then you run it, and it stops due to some bug. Now you need some situational awareness.
You already know that ⎕NL will let you check which names are defined, and ⎕NC what type of things they are.
⎕SI (Stack Indicator) will give you a list of function names on the stack: Try it online!
⎕LC (Line Count) will give you a list of corresponding line numbers where each function in ⎕SI is holding: Try it online!
If you get a WS FULL error, you may want to check how much memory is being used to represent a variable. Use ⎕SIZE: Try it online!
And of course you need to know how much Workspace Available (⎕WA) you have: Try it online!
@all Any questions before we move to the miscellaneous category?
Just for reference, you may want to know which non-ASCII characters are allowed in names:
⍞←⎕Á
 
@Adám ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝþãìðòõ
 
isn't that a bit deprecated :P
 
@EriktheOutgolfer The system function is. But not the usage of those characters in names.
@all CMC: List all characters that a name may begin with without piecing it together by yourself (⎕A,⎕Á,'_∆⍙')
 
@Adám you forgot 819⌶⎕A :P
 
@EriktheOutgolfer true. How much more so grounds for the CMC.
Hint: there are actually many more than those.
 
7:34 PM
⎕←xorg←9⋄⎕←{xorg⊢←⍵}2
 
@RosLuP
9
2
 
I can do it in 19 chars.
 
@Adám not the circle (underbar) letters right
 
@EriktheOutgolfer Those too, but there are even more.
Anybody? No?
⍞←n/⍨0≤⎕NC⍪n←⎕UCS⍳1E6
 
@Adám ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüþ∆∇⍙⍵⍺ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ
 
7:37 PM
@Adám argh, I couldn't remember ⎕UCS
 
@dzaima Hm. As in Universal Character Set? Feel free to ask!
 
@Adám I forgot the command name :p
 
@Adám You can't begin a name with ⍺ or ⍵
 
@dzaima again, feel free to ask :p
 
@EriktheOutgolfer eh, asking felt like spoiling part of the solution for others
 
7:39 PM
@H.PWiz in dfns they're actually considered variables...
 
Btw, ⎕AV is the Atomic Vector (the character set or "code page") but you don't need to worry about that, especially now with SBCS.
@H.PWiz Well, in a dfn or dop, you can.
 
@Adám that's what I tried using instead of ⎕UCS⍳1E6 before Erik mentioned underbar letters
 
@dzaima Right, in Classic, it'd be:
⍞←⎕AV/⍨0≤⎕NC⍪⎕AV
 
@Adám ⍺⍵_abcdefghijklmnopqrstuvwxyz∆ABCDEFGHIJKLMNOPQRSTUVWXYZ⍙ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝþãìðòõÀÄÅÆÉÑÖØÜßàáâäåæçèéêëíîïñ∇óôöøùúûü
 
@Adám I guess I was thinking variable names
 
7:41 PM
@Adám well then a more appropriate CMC would've been all possible 1 letter variable names
 
@dzaima ⍺⍺ and ⍵⍵.
 
@Adám but not ⍺hello
 
⎕AV is only really useful to get a quick view at the character set:
⎕←7 32⍴32↓⎕AV
 
@Adám
pqrstuvwxyz¯.⍬0123456789⊢¥$£¢
∆ABCDEFGHIJKLMNOPQRSTUVWXYZý·
⍙ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝþãìðòõ{€}⊣⌷
¨ÀÄÅÆ⍨ÉÑÖØÜßàáâäåæçèéêëíîïñ[/⌿\⍀
<≤=≥>≠∨∧-+÷×?∊⍴~↑↓⍳○*⌈⌊∇∘(⊂⊃∩∪⊥⊤
|;,⍱⍲⍒⍋⍉⌽⊖⍟⌹!⍕⍎⍫⍪≡≢óôöø"#&´┘┐┌└
┼─├┤┴┬│@ùúû^ü`∣¶:⍷¿¡⋄←→⍝)] §⎕⍞⍣
 
@dzaima True.
Btw, the only reason the bot includes and is because I've set it up to run the code inside a dfn:
#tio apl ⎕←n/⍨0≤⎕NC⍪n←⎕UCS⍳1E6
 
7:45 PM
@Adám ooh, that makes much more sense
 
@Adám
ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüþ∆⍙ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ
 
@dzaima ^ see, now it is running on the bare metal.
 
@Adám why doesn't C/⍨0≤⎕NC¨C←⎕UCS⍳128 work
⎕←C/⍨0≤⎕NC¨C←⎕UCS⍳128
 
@EriktheOutgolfer
DOMAIN ERROR
 
(note: 128 to be replaced with 1E5 as soon as I get around this)
 
7:49 PM
@EriktheOutgolfer Because ⎕NC returns a vector (it is intended to run with name lists in the style of ⎕NL's result), and you can't use a vector of vectors to compress.
If you want to create an old school application with a terminal style UI, then you can use ⎕SM (Screen Map). For good reason, I can't demo this on TIO or TryAPL, but Marinus has used it on occasion.
⎕SD are the Screen Dimensions, but since TIO is running head-less:
⍞←⎕SD
 
@Adám 0 0
 
@all Those are really all the basic system functions. If you've paid attention and have perfect memory, then you are basically APL masters now.
 
@Adám can't close ⎕SM...
 
One could use ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ for name of function and operators; the usual letter for variables ... So do not are possible names subscript and top script... If one has name for a function as above one can definitely eliminate spaces for example Ⓓa (as Ⓓ function call; apply to variable a) and compose names the same
 
@EriktheOutgolfer You have to kill it using its window handle.
 
7:56 PM
@RosLuP but those aren't very golfy, Adám's SBCS doesn't support those...
 
Of course, there are still plenty of things we have not covered. OO for instance. Another subject would be programming techniques and keeping order in your APL code. What do you guys want to address next week?
 
@Adám except that when I click the red X it won't close
@Adám keep what? let's get to the meat, OO!
 
@EriktheOutgolfer Are you running Marinus code by any chance? It does a tight loops, creating new windows… Golfing!
 
@Adám no I ran ⎕SM←'lans armstrong'1 1
 
@EriktheOutgolfer Just clear the workspace with ⎕CLEAR.
 
00:00 - 20:0020:00 - 23:00

« first day (364 days earlier)      last day (2283 days later) »