« first day (1301 days earlier)      last day (1346 days later) » 

5:35 AM
@ngn Maybe I'm missing something. Doesn't this give February 31 days?
 
5:53 AM
Is there a way to route APL answers over here?
would be great to learn from
like how the nineteenth byte gets answers from sandbox and things like that
 
@Razetime Ah, that's an interesting idea. We have an automatic feed of questions with the tags and , but there's no easy way to filter answers. There is a data explorer where one can do SQL queries, though.
 
Oh, theres questions, nice.
What is APL cultivation exactly?
 
@Razetime See APL Wiki.
 
sure!
So it's text based lessons on APL topics
 
Exactly.
 
6:06 AM
Sounds great, works in my timezone as well.
I registered
 
⋄ 'Does the bot work?'
 
@Adám Does the bot work?
 
⋄ hello there
 
@Razetime VALUE ERROR
 
lmao
how do i type a backtick normally in the APL keyobard?
⋄'Hello, World!'
 
6:12 AM
@Razetime Hello, World!
 
@Razetime Assuming you're using my in-browser language bar then backtick,space should do it.
 
I'd like to add on to the in broswer bar
 
You mean add backtick to it?
 
that, and add the descriptions I see in the Dyalog app
the ones you see when you hover over the symbols
 
That'll be harder. It already pushes the limits of the HTML tooltip (title attribute).
 
6:16 AM
Maybe change the :after element on hover
I'll try to find a way
 
By all means.
 
You shoulda told me about your AP⌷ website
it's a goldmine
 
Which site?
 
abrudz.github.io
Never knew about APLcart
 
Oh. Thank you.
 
6:19 AM
and the font
Should be pinned up somewhere
 
@Razetime Which one do you like? (Btw, this APL Wiki article may interest you.)
 
6:42 AM
APL386 is perfect for programming
 
Happy you like it :-)
 
It's basically what I expected in Fantasque sans mono
but better
I'd much rather stare at this font for hours
 
7:02 AM
How to I get the digits of a number?
 
@Razetime An natural number (strictly positive integer)?
If so, then the safe way is to do 10⊥⍣¯1⊢ and the golfy way is ⍎¨⍕
 
7:24 AM
⋄⍎¨⍕2300
 
@Razetime 2 3 0 0
 
⋄10⊥⍣¯1⊢2300
 
@Razetime DOMAIN ERROR
 
huh.
yes, it's a strictly positive integer
 
That's odd. Hang on.
 
7:26 AM
sure.
I thought I could convert a number to its digits and filter out the zeros
but my method removes all zeroes
is there a way to use RegEx?
 
I should be checking aplcart before I ask around here
 
Now, you're learning :-)
@Razetime I remember (well, looked at the code) now. I disabled inverse function application since it can be dangerous to the server.
However, I think I can re-enable just this inverse, since it is so useful.
 
I'll execute it step by step on the application
 
It'll work fine offline. The error is only because the bot needs to protect itself against malicious code.
 
7:33 AM
good idea to keep it then
I'll be mashing F1 on this function in the meantime
so the execute each format method doesnt seem to work on big numbers
⋄⍎¨⍕312312300000000000000
 
@Razetime (no output)
 
Even if its golfier it doesnt work for the required task
but the safer way also gives an odd output
⋄10⊥⍣¯1⊢265252859812191058636308480000000
 
@Razetime The reason that fails is because the number becomes a string with exponential notation, 3.123123E20 and then executing each character of course fails on . and E.
 
⋄10⊥⍣¯1⊢265252859812191058636308480000000
 
@Razetime DOMAIN ERROR
 
7:40 AM
I get 2 6 5 2 5 2 8 5 9 8 1 2 1 9 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 in the editor
 
@Razetime No, that'd work, if not for the bot's paranoia.
@Razetime Right, is that "odd output"?
 
1058636308480000000 isnt exactly coming up
It's too big I guess
 
@Razetime Yeah, the number looses precision right away. Try setting ⎕FR←1287 first. This enables 128-bit decimal floats which have about 34 digits of precision.
 
ohhhhh
yep now it works correctly
so ⍕X gives character representation of X
but it gives it in E notation
so how to get a full string of a number
 
For an integer, you can use 1↓0⍕X but if any digits are unknown (due to the limited precision of the currently used floats), it'll put underscores to tell you. So you can do '_'⎕R'0'⊢1↓0⍕X to replace underscores with 0s.
 
7:49 AM
I was thinking of taking the digits and collapsing to string
the underscore substitution trick is cool
 
@Razetime I'm not sure what you mean by that.
 
performing ⋄10⊥⍣¯1⊢ on the number and converting to character array
but thats too long
Removing trailing zeroes is this ⋄{⍵↓⍨-⊥⍨' '=⍵}1↓0⍕265252859812191058636308480000000
hopefully that works
 
@Adám Why does zilde-reshape do what pick does, and why can you trust ⊃ to be disclose if you couldn't trust it to be pick?
 
@Razetime 1) the both won't pick up inline code unless backticked. 2) Are you sure you mean ' '=⍵ with a space?
 
like, how is it a thing to reshape nested character vectors to ... an empty numeric vector
 
7:56 AM
yeah it was initially meant to remove trailing spaces so it's got to be changed to zero
 
@TessellatingHeckler ⍬⍴ does not do what pick (first, actually) does. First unpacks the first element, while ⍬⍴ doesn't. In that sense, ⍬⍴X is exactly like X[1]. The reason I can trust to be disclose is that the two meanings of , first and mix have the same effect on a scalar. See APL Wiki.
@TessellatingHeckler What is the shape of a scalar?
 
⋄{⍵↓⍨-⊥⍨'0'=⍵}1↓0⍕265252859812191058636308480000000
 
@Razetime 2652528598121911_________________
 
⋄ ⎕FR←1287 ⋄ {⍵↓⍨-⊥⍨'0'=⍵}1↓0⍕265252859812191058636308480000000
 
@Adám 26525285981219105863630848
 
7:58 AM
@Razetime You could also use regex:
⋄ ⎕fr←1287 ⋄ '0*$'⎕R''⊢1↓0⍕265252859812191058636308480000000
 
@Adám 26525285981219105863630848
 
@Adám if it's exactly like X[1] can you do X[⎕IO] to get the same effect more clearly?
@Adám is it the sound of one hand clapping?
 
regex yay
 
@TessellatingHeckler Sure, but that's 7 characters instead of 2, and I only use this for golfing…
 
that's a few bytes smaller, nice
 
8:01 AM
@TessellatingHeckler How many dimensions does a scalar have?
 
So the DOMAIN ERROR and all that is from the use of dyalog-safe-exec, cool
 
Yeah.
 
@Adám rho on a scalar returns nothing, which presumably means it returns an invisible thing which is equal to zilde, which kind of means they have no shape or a shape placeholder, and none of that suggests "reshaping an array to that non-shape should take the first element" to me
 
@TessellatingHeckler A scalar has 0 dimensions. You need 0 indices to pinpoint an element of a scalar. The list of lengths along all dimensions is then an empty numeric list (which is the value of ). Now we know that the shape of X⍴Y is X, so if X is the shape of a scalar, then X⍴Y is a scalar filled with scalar(s) from Y. The shape of a scalar is , therefore ⍬⍴Y returns the first scalar of Y.
 
@Adám "so if X is the shape of a scalar, then X⍴Y is a scalar filled with scalar(s) from Y" that feels like a leap. If X is the shape of a thing with no dimensions, then X⍴Y could plausibly be the same as ⊂Y a scalar reference to Y, couldn't it?
 
8:11 AM
@TessellatingHeckler No, that's not the definition of X⍴Y. it simply uses the scalars of Y in ravel order to fill an array of shape X. It never encloses anything. If it did, then 2 3⍴Y should be a matrix of Ys, rather than a matrix of Y's scalars.
The existing definition of is more versatile. If you want an array of Ys, just write X⍴⊂Y. If X⍴Y meant that, there'd be no way to fill arrays with anything but a constant value.
@TessellatingHeckler Maybe this progression helps:
      Y←2 3⍴⍳6
      (3⍴2)⍴Y
1 2
3 4

5 6
1 2
      (2⍴2)⍴Y
1 2
3 4
      (1⍴2)⍴Y
1 2
      (0⍴2)⍴Y
1
 
@Adám I knew you could overshape 10⍴⍳3 and it would "loop", I don't think I realised that you could undershape like 3⍴⍳10 and it would "drop" the unneeded ones
so the 1⍴1 is similar to ,1 a 1-vector, and the 1⍴Y is the first item as a 1-vector, and the step down from that is the scalar reshape which is weird; isn't it weird to describe "fill an array of shape X" when shape X is a scalar which isn't an array?
 
@TessellatingHeckler Hold it right there! In APL, a scalar very much is an array.
 
@Adám that is approximately what I thought would be coming next :D
 
@TessellatingHeckler Do you know how to get a list of all the valid indices for a given array?
 
@Adám is it ⍳⍴X ?
 
8:23 AM
@TessellatingHeckler Yes, so what are the valid indices of a scalar?
 
@Adám mu, the question doesn't make sense
⍳⍴3
┌┐
││
└┘
 
@TessellatingHeckler Why not? A scalar is an array!
@TessellatingHeckler Right, that's ⊂⍬, and lo:
      42[⊂⍬]
42
      42[⍬ ⍬ ⍬]
42 42 42
      42[2 3⍴⊂⍬]
42 42 42
42 42 42
 
"A Sommelier Showdown Pairing Champagnes made by Nicolas Feuillatte with an array of foods will be the challenge facing sommeliers" - if that "array of foods" turned out to be one item, I think everyone in the audience would feel misled. >_>
 
@TessellatingHeckler Not as much as if the array was empty, and I think all agree that (or in JSON, []) is an array.
 
@Adám why is it enclosed<interrobang> didn't we just go over reshape not enclosing anything? so is iota enclosing the shape?
 
8:28 AM
is a valid index into a scalar. Indeed, it is the only valid index into a scalar. That it doesn't contain any information reflects on the fact that you don't need any information to know which data of a scalar you want (since there's only one).
@TessellatingHeckler (Enclosed zilde.) Indeed, nominally returns an array of vectors, each vector representing an index. ( on a one-element vector is an anomaly for historic reasons.)
 
@Adám in JSON, [] is a 1-dimensional vector with no elements in it, and scalars aren't vectors
 
@TessellatingHeckler in APL, is a 1-dimensional vector with no elements in it, and scalars aren't vectors
 
8:43 AM
Nice: X-⍥≢Y -- my first over.
 
Difference of lengths. Cool.
 
@Adám the shape of a scalar is a 1-dimensional vector with no elements in it. a 1-dimensional vector with no elements in it is the only valid index into a number because numbers are arrays with no dimensions and if you go looking inside a 0-dimensional thing with an empty 1-dimensional thing, you'll find something. 😖
gah
 
@TessellatingHeckler Another way to look at it is that (using ⎕IO←0) the element with index i in the array Y is the nth element of the ravel of Y where n←(⍴Y)⊥i and when ⍴Y is and i←⍬ (the only choice) we get n←⍬⊥⍬ which is 0, and indeed, the sole element of the ravel of Y is (,Y)[0]
 
9:11 AM
Ooh, a bookmarklet to force all <code> and <pre> to use APL385 Unicode:
javascript:(d=>{d.getElementsByTagName("head")[0].innerHTML+="<style>code,pre{font-family:'APL385 Unicode'!important}</style>"})(document)
 
ngn
9:21 AM
@Adám oops
@Adám here's a shorter one
 
9:46 AM
@Adám huh, ⍕∘⊥⍣¯1⊢'' doesn't break
 
@dzaima What do you mean?
 
@Adám i assumed your re-enabling would look like allowing ⊥⍣¯1 (though now that i think about it, you already have a cover function for )
 
@dzaima I wonder if there's anything one could put on the left of ⊥⍣¯1 that would make it unsafe.
@Moonchild You may want to pull the safe executor.
 
10:03 AM
⋄ 2⍕⍤⊥⍣¯1⊢'⎕DL 1'
^ can execute arbitrary code, though it DOMAIN ERRORs eventually
 
@Bubbler Uh oh. Maybe if I require a digit or to the left of ?
Actually, anything but should be fine, since causes what's to the left to be run in reverse first.
 
@Adám checking for something like '⊥'=source of ⍺⍺ in would make more sense
 
@dzaima Yeah, maybe I'll do that instead. I also want to allow ⍸⍣¯1 and f\⍣¯1 where f is any of +-×÷=≠.
 
@Adám ⍕∘⊥⍣¯1⊢'⎕DL 1' works too
 
Of course, since is atop there too. Thanks!
 
10:11 AM
@Adám What's so bad about `f\`?
 
@Bubbler Clarified.
 
Ah, OK.
 
@dzaima But then I can't handle 10∘⊥⍣¯1
@dzaima Yeah well, it is really hard to inspect the definition of ⍺⍺.
 
@Adám you do already override actually
 
@dzaima Oh, right, I do. And too. No worries then. Good catch.
 
10:16 AM
do you need to even disallow inverses then?
 
@Adám ok it makes sense that ⍴ can make arbitrary shaped arrays, (empty 3D array?), so 3D, 2D, 1D. And it makes sense from there that it can make 0D. And it makes sense that a 1D vector can have 3 things, 2 things, 1 thing, and next would be 0 things and that would make an empty 1D vector.
and yes ⍬≡0⍴⍳3 is 1
and it makes sense that if ⍴ can make any array, and that includes 0D, there has to be another way to distinguish that from 0⍴
 
@dzaima Hm, no. So I'll separate out the absolute value and then apply the inverse. Nice.
@TessellatingHeckler And what would be more natural as left argument for reshape to create a scalar, than the shape of a scalar?
 
and the sole element to (,Y)[0] makes sense
@Adám no, I gotta go the other way; if 0⍴ is an empty vector, and there needs to be a different thing for a 0D array, and the left side of ⍴ is a shape, that forces a symbol which is not a number, and is the shape of a scalar, which is ⍬
 
OK, if that does it for you. It didn't have to be a symbol, though. Before the addition of people could use (0⍴0) or even '' (ugh).
 
[z y x]⍴ [y x]⍴ [x]⍴ []⍴ counting down the number of dimensions and needing something to go on the left of ⍴ to indicate none (although if shape and reshape were different symbols, would monadic-reshape reshape to no dimensions?)
 
10:26 AM
@TessellatingHeckler Uh, [] is (or 0⍴0), APL just doesn't have an array notation for it.
@TessellatingHeckler Btw, it'd be better to say "if (1⍴0)⍴ is an empty vector" since a shape is always a vector. is just lenient and allows a scalar as stand-in for a 1-element vector.
 
@Adám 0⍴ of anything at all would work?
 
Yes.
 
@Adám I know now, I'm just connecting it up in my head
 
⋄ (0⍴⎕NULL)⍴⎕A
 
@Adám Illegal code
 
10:30 AM
@DyalogAPL Oh, of course. Though ⎕NULL isn't really dangerous, is it?
 
@Adám and (1⍴0)≡,0
 
Yup. Also 1↑0 and 1↑⍬ (!) and 1/0 etc.
 
because take one from zilde overtakes and fills with the prototype?
 
Yes.
 
10:35 AM
Heh, even 0↓0 and 0~1 and ∪0 and ∪⍨0 and ∩⍨0 work.
⍳0 and 1?1 in ⎕IO←0 :-)
 
and my comment about an empty 3D array would be 0 0 0⍴ it has three dimensions, and extends no distance in any of them
 
Right, but there are infinitely many empty 3D arrays, since they can extend in up to two dimensions.
 
1@⍬⊢0
LENGTH ERROR
hm
if zilde is an index into a scalar, I want to put a 1 @ that place
I don't really, but I guessed it would work
@Adám thank you for patiently going over that :)
 
@TessellatingHeckler @ takes an array of indices as right operand:
⋄ 1@(⊂⍬)⊢0
 
@Adám 1
 
10:48 AM
So @⍬ makes no changes:
⋄ 42@⍬⊢1 2 3
 
@Adám 1 2 3
 
Really, it should be 0⍴⊂,0 in this case, but it doesn't care about prototypes.
 
@Adám oh I only tried 1@⊂⍬⊢0 still thinking of ⊢ as a magic separator (something dzaima (?) corrected me on recently). Parens are the syntactic separator / group.
 
Indeed. Funny how is the simplest possible function, yet it is so often misunderstood.
 
@TessellatingHeckler yeah. that's the same as 1@⊂⍬{⍵}0 (≡ (1@⊂) (⍬{⍵}0))
 
11:16 AM
@dzaima I see that now! :)
 
12:04 PM
so how do use the method shown in this: dfns.dyalog.com/n_pco.htm
`⋄3 pco 144` says
`VALUE ERROR: Undefined name: pco`
 
@Razetime The safe executor won't let you. (Btw, you do realise that you don't need a leading outside the bot, right?) It is a function contained in the dfns library workspace. You can import it with 'pco'⎕CY'dfns'
 
@Adám ``
 
@DyalogAPL Shh!
 
12:23 PM
yup i used the `` symbol for the bot, no worries
 
ngn
12:39 PM
⋄'⋄1 2+3'
 
@ngn (no output)
 
ngn
the bot saw through my cunning plan
 
Hm, it looks like the bot's diamond-splitter doesn't ignore quoted diamonds.
⋄'⋄''⋄'
 
@Adám (no output)
 
@Moonchild Can you fix that?
 
ngn
12:48 PM
⋄(⎕ucs 8900),'1 2+3'
 
@ngn ⋄1 2+3
 
ngn
doesn't pick up own msgs :(
 
I'd consider that a feature.
 
 
8 hours later…
8:32 PM
@gvaf Hey there. Interested in APL?
 

« first day (1301 days earlier)      last day (1346 days later) »