« first day (1215 days earlier)      last day (1432 days later) » 

12:00 AM
I'm curious whether it's ever been considered to add truth/falsy values to APL
 
Uh, what? APL already has truth and falsy values.
 
Never found anything on the matter, but I imagine there aren't as ~n raises domain error for n≠0,1
Ah, 'twas why I asked!
@Adám But what's the with the ~n≠0,1 deal?
 
@AviF.S. Oh, you mean that every array should be considered either truthy or falsy, but never a domain error?
 
RGS
@Adám thanks :)
 
@Adám Maybe arrays too, why not! I was more thinking about scalars though
What's an example of where truth/falsy values do work?
 
12:04 AM
@AviF.S. {⍵:'T' ⋄ 'F'} gives 'T' for all simple singletons that contain a 1.
… which means that e.g. Dyalog APL currently has 16 truthy and 16 falsy values.
 
> @AviF.S. {⍵:'T' ⋄ 'F'} gives 'T' for all simple singletons that contain a 1.
Very interesting, never occurred to me to check! Why doesn't the behavior extend to monadic `~`, then?
 
RGS
@Adám I think I just solved it :') now I only have to prove it works for sure!
 
@AviF.S. Monadic ~ is a scalar function, so it simply maps 0→1 and 1→0 (and domain errors on all other values) for all simple scalars anywhere in the given array, preserving the structure as-is.
 
@Adám Re ~: Why not map N -> {0,1} though? It would still preserve the array's structure, but simply be more robust?
For that matter, why not C -> {0,1}?
 
12:20 AM
@AviF.S. I think K does that, but it doesn't really make sense. What would you think if you saw code that said :If 2.5 ? Doesn't that elicit understanding along the lines of :Select myVar ⋄ :Case 2.5 ?
 
Truthy/falsy values are very common in most languages, I thought. Even if not always recommended, they can be helpful
@JeffZeitlin Phew!!! Thanks for that :)
 
RGS
@Adám ok it works; will write it on my blog tomorrow and send it to Roger :)
 
Sorry for continuing this conversation here. I'll try to stay more on-topic.
 
Sorry about that, I feel badly! I think we were pretty much at the end anyway :)
I alway manage to derail this room... (sad-face)
 
Small excursions are fine. I only move large ones, especially if they interfere with on-topic chat, as happened here.
@AviF.S. I don't see how it is helpful, only confusing. APL makes it very easy to specify what you mean, usually using no more than 3 characters: 0≠ or 0< or ~0∊ etc.
 
12:33 AM
@Adám Alright, fair enough. Only useful if one is concerned with brevity I suppose
Definitely useful for golfing though...
So I imagine Dzaima has a different philosophy in his dialect?
I do personally find it more elegant to not need the 1=, doesn't really seem like anything can be lost by including it. One can always add 1= but one can't simply take it away
 
@AviF.S. How so?
 
I suppose it just makes it safer, by catching domain errors?
@Adám Uh oh, I blabbered so much! How so, what?
 
@AviF.S. That's what reply indicators are for. Use them! I did. It points at your statement about dzaima.
 
@Adám Oh my goodness, thanks a mill! Super neat; didn't know
How do you reply, been trying to figure out for ages!
@Adám Ugh, now I see it. The star and flag are so big, bright & perfectly centered; the reply so light grey & awkwardly stuck at the top
@Adám Was under the impression that dzaima (& extended APL) were primarily for golfing...
I thought most of what dzaima did was to extend the functionality of operators as much as possible, and make even more conducive to golfing. Maybe I'm confusing it with extended though...
 
@AviF.S. Neither is. Extended is mainly focused on extending domains of primitives. dzaima is to an extent, but also makes breaking changes to restore consistency.
I'm still not sure what to do with Extended when Dyalog 18.0 comes out, as it has an extension of a primitive that collides with my extension.
 
12:44 AM
@Adám My bad again! Darn, that's a bummer. What's the conflict?
@Adám Also, does Extended extend the domain of ~ then?
 
@AviF.S. I extended all scalar comparisons with a default left argument which is the type of the right argument (i.e. 0 for numbers and space for characters). Dyalog 18.0 extends monadic to be ⍳⍨=⍳∘≢
@AviF.S. Yes, but to be 1∘-
@AviF.S. However, then you can use Extended's monadic = instead of ~ to map 0→1 and all other numbers to 0.
 
@Adám Very neat! Finally-- there's what we're looking for :)
 
Well, it still doesn't allow you to use non-zero values as "true"; you'd have to prepend which is "is non-zero".
 
@Adám Even better! Though as long as there's truthy/falsy, I'm content!
@Adám In general, do you think Dyalog will continue to extend its primitives slowly, or is it contrary to its philosophy?
 
/me is generally opposed only to breaking changes.
 
12:57 AM
@JeffZeitlin Those are changes which are not backward-compatible?
 
@AviF.S. - Yes.
 
@JeffZeitlin It does seem unlikely somehow that they'd accept something as 'radical' as ⌈ string making the string uppercase (maps each character in vector to upper case). Despite the fact that currently ⌈/⌊ are useless for chars...
Is it not the case that they wouldn't be all over such 'radical' changes?
Sorry for the double negative, haha
 
@AviF.S. That's dead now that we get ⎕C and I can see why it isn't the best idea anyway.
 
@Adám Is it a domain-error-desired issue again?
That it's easier to debug?
/harder to err
 
@AviF.S. - I can't speak for Dyalog, obviously, but radical need not be breaking - your example of using ⌈ and ⌊ on character vectors is definitely radical, but since it wouldn't change the behavior of those primitives with numbers, and there's no previous code that applied them to characters (other than stuff done with Adam's unofficial extensions), it's not breaking.
 
1:03 AM
@Adám And what about the aforementioned =/≠? Is it likely that there should ever be monadic extensions for solely dyadic operators?
 
@AviF.S. No, but rather the ability to compare two mixed-type arrays caselessly without rounding. E.g. you'd want 'Adam'1.5 to match 'adam'1.5 without also matching 'adam'¯1.5 or 'adam'1
 
@Adám Ah, this is a very good point! Never occurred to me! What about the dyadic→monadic?
@JeffZeitlin Agree completely! Exactly why I asked! Bc you said you'd support not-breaking changes, so I specifically chose a non-breaking, yet radical, example. To see if there were still some non-breaking cases you wouldn't support
Although as Adam points out, it turns out it is breaking!
 
@AviF.S. Doing anything general with the comparisons is out of the question now due to , and in any case it wouldn't be very complicated to write without these extensions. However, we might well "overload" some of the dyadic-only functions to do other things when monadic. E.g. I'd like to see be "type" and and for sorting.
 
Sorry, didn't understand 'Doing anything general with the comparisons is out of the question now due to ≠'
 
@AviF.S. - As to whether radical changes/extensions should be embraced, that's a matter of company and user philosophy. My position tends to be that any changes should fit the 'philosophical mold' that the language is already in. It's one of the reasons I never liked the idea of grafting objects onto Pascal (for example), and one of the things I see as a problem with the :If, :While, etc., constructs.
 
1:08 AM
@AviF.S. I think it'll slow down now. I imagine (hope) we'll get the depth operator next, and I imagine we'll extend to be a bit more flexible. We might also get around to do full prefix agreement for scalar functions, and various minor extensions to other primitives, like allowing short Boolean masks in @ short right arguments for N-wise Reduce, any-length left arguments for and etc.
@AviF.S. I made an across-the-board extension to <≤=≥>≠. But now that ≠Y is doing something unrelated to X≠Y, this kind of general extension cannot be made.
@JeffZeitlin Yes, and Dyalog is quite careful about that. It has happened, though, when realising that a result was "wrong", and has caused problems even then. In fact, 18.0 fixes a "wrong" result.
 
@JeffZeitlin Totally agree with what you're saying. That's why I asked re: Dyalog & you guys. Agree with the :ControlStructure bit, though @Adám has, in the past, said he believes it's helpful in some cases. Personally, extending the notation seems to me to be exactly the philosophy of Iverson.
So that the notation should be able to express as many ideas as possible elegantly/succinctly, and even if radical, that people will catch on eventually and eventually never be able to imagine another way.
@Adám That all sounds wonderful! What do you mean 'it'll slow down,' though?
 
@AviF.S. - Which is one of the reasons I don't object to radical per se.
 
@Adám Would super love to see that too! The ⍒/⍋ seem redundant. Does that mean you're agreeing Dyalog will continue to extend monadic≠dyadic → monadic∧dyadic?
 
@AviF.S. 14.0, 16.0 and 18.0 have added a lot of new things. For various reasons (some of which I'm not free to discuss here) I think we'll see a lower rate of new primitives going forward, even in 20.0.
 
@Adám Understood, thanks! That's all super interesting. Also, had no idea such seemingly innocent things were trade secrets :)
 
1:15 AM
@AviF.S. and are redundant‽ How in the world would you grade things without them?
 
@AviF.S. - I can see where the use of the :ControlStructures can be useful or helpful, but as implemented, it appears to me to be outside the boundaries of the language philosophy. They wouldn't be as easy to read, but I suspect that most of them could be implemented with extant primitives (like they were in APL\360!)
 
@JeffZeitlin +←1
 
@JeffZeitlin f course they can be. Dyalog (like all other main APL implementations today) are pretty much backwards compatible with APL\360.
 
@JeffZeitlin Interesting! I'll have to read up on APL\360's approach!
 
@AviF.S. It isn't unique to \360. It is simply using labels and conditional gotos.
 
1:17 AM
@Adám - Nor am I suggesting otherwise.
 
@JeffZeitlin But I was, he was correcting me :)
@Adám I see, well still curious to look at some examples of how it looked!
 
@AviF.S. - I more-or-less refer to APL\360 for a 'core' implementation of the language - minimal, unextended, etc.
 
BTW, the ≠ in monadic≠dyadic → monadic∧dyadic was meant to be an xor. Dyalog is a little stingy though with giving me one :p
 
You could use the APL in the 5110 emulator I've linked to here previously as more-or-less the same thing.
 
@JeffZeitlin Then I better look at it so I can see how it was originally!
@JeffZeitlin Tried the emulator, but it gives me errors every time
 
1:20 AM
@AviF.S. Oh, now I understand. Could be. I'd also love to see monadic and become 2⊥ and 2∘⊥⍣¯1
 
@AviF.S. - What sort of errors, and what were you trying to do?
 
@JeffZeitlin Why use the awkward and speed of the emulator? You can write any \360 code into a modern APL IDE.
 
Can't figure out how to get it working. ⍳3 & ⎕←⍳3 give errors. Didn't try anything else, to be entirely honest
 
@AviF.S. Did you switch it to APL mode? It defaults to BASIC.
 
@Adám What a dream come true that would be!!!!!
 
1:22 AM
(The keyboard mapping is a little wonky on it, and don't forget to switch it into APL mode and hit the RESTART switch)
 
@Adám How silly, thanks; will do
@JeffZeitlin Thanks a mill!
Also, couldn't figure out why backspace doesn't work. Neither on my keyboard nor on the emulator...
Is that supposed to be the case?
 
@AviF.S. Here's an example of original \360 code, only ported to Unicode without changing anything whatsoever. The minimal changes required to make it run today are here.
 
@Adám Yes, but I can also write stuff that isn't \360, that will work, but which will throw an error in the emulator. Helpful if I don't have docs handy, and am not sure whether something goes back that far.
@AviF.S. - Yes, and I think some of the notes on that page say so. Use left-arrow, as though you were going to overstrike.
 
@JeffZeitlin Heh, we could easily make a tryapl.org/360 that simply bans non-\360 language features.
 
/me decides that using a APL-ized Times font for the APL code in Wiedmann was ... not a good idea.
 
1:27 AM
@JeffZeitlin Ah, didn't see such a thing! Figured out the left arrow bit but how to delete afterwards? Replace with a space?
 
@Adám - Or set a checkbox/switch/whatever that would let you put TryAPL into \360 mode.
 
@JeffZeitlin ?
 
@AviF.S. - Yes. Or overtype with something that isn't a valid overstrike.
 
@Adám And a game! Even better! Thanks a bunch @Adám, super neat
@Adám Would be a neat idea, for certain!
@JeffZeitlin Why remove the message? Clarification is never evil :)
@JeffZeitlin Now that's a super bright idea! Thanks
 
@Adám - The font that they used for the APL code is proportional, essentially Times Italic, and some of the characters do not look well that way, for example ≤
@AviF.S. - Linked to the wrong comment. Thought @Adám was questioning my comment on TryAPL, not Wiedmann
 
1:30 AM
@AviF.S. Btw, if you start the repo as a MiSite then it localhost:8080 will let you play the game using visuals that closely emulate the original experience, and localhost:8080/compare will highlight the differences between the original, the updated, and the browser-enabled code.
 
@JeffZeitlin @Adám Well thanks a bunch for all the fun stimulus, guys! Did really enjoy the Shabbos conversation too, and learned a fair bit! Am tired out now, and am going to go mess around with APL360, though I must admit not having defns/trains is a big turnoff! Especially the defns though, big hole in my heart!
 
("dfns" without an "e")
 
Before I go though, @Adám, how're you still up? It's 2:30 and you've a family and all sorts of other sophisticated, responsible grown-up things! How do you manage?
(@JeffZeitlin Assuming you're back in the states though?)
@Adám Ah, thanks!
 
@AviF.S. - Yes, I'm a New Yorker.
 
@AviF.S. I got some good rest since Friday. I should probably go to bed though.
 
1:33 AM
It's only about 2130 for me
 
@JeffZeitlin Ah, very neat! California (me, usually) is quite a different world!
@Adám Good point! I see!
 
@JeffZeitlin Should depend on the exact font used, no? I never cease to be amazed how big a difference the font choice makes on the impression.
 
@AviF.S. - Indeed. We are, after all, a continent apart.
 
@JeffZeitlin Haha, this is a good point :)
Well, I'm off. Thanks a bunch everyone, and have a great rest of evening/morning ⍥
 
@Adám - There's no colophon in the book, so no definite indication of what the font is. But it's a proportional serif font, and it looks to my eye like Times. It's readable, but I would call it suboptimal. A monospace font, even "Courier" with APL, would have been better for code. (APL386 Unicode wouldn't have been an option in 1974.)
Incidentally, the touch-ups and the slightly wider spacing of APL386 vs APL385 makes a good difference in the relative readability of the two.
 
2:03 AM
@Adám@JeffZeitlin Afraid I lied! Any recommended way to ensure all elements in a vector are scalars? I imagine it's something to do with ↑ but don't see an obvious way without some sort of recursion/⍣. Any elegant ways, or ideas of how to find it in APLCart? Couldn't find anything with 'scalar'/'scarify'/'rank'/variations
TBH, I don't even know if that's what I should be doing. Getting unexpected behavior when I get something of the form (1 1⍴s) instead of simply s in my input vector, and I'm having trouble fixing it
The best I can do is ⊃⍣=. Curious if there isn't a better way!
Nevermind! Still doesn't work, because if it hits a string, it returns the first char. Strings should stay strings (even though technically vectors)
Really hate to do recursion/complicated ⍣, but maybe the only way?
 
2:40 AM
@AviF.S. I guess you should check out Depth . IIRC the depth of a non-scalar simple array is always 1.
 
@Bubbler Thanks, yes, it is true. But I was hoping to do have a function do it without needing to check if it was done. Don't know if that makes sense! AKA, no recursion/iteration.
Is it necessary to do so?
Also, what operator to use to do it? Neither ⊃ nor ↓ are working very well...
 
 
1 hour later…
4:07 AM
@AviF.S. I don't understand what you mean. What are you trying to achieve while "ensuring all elements in a vector are scalars"?
 
4:31 AM
@Bubbler Honestly not super sure, though I do have to go to bed now super; can't believe I didn't already. But before I'm off, I'm really just confused by input vectors containing elements of the form 1 1 ⍴ whatever. Don't remember encountering such shapes, and the whole thing is odd to me! The function handles any integers or strings in the vector, but elements of ⍴ 1 1 throw it off. Essentially just wondering what to make of such elements, and how to handle them neatly!
Thanks a mill for the help (or starting to help/pending help :))
 
 
2 hours later…
6:11 AM
@AviF.S. I imagine you meant to check that all elements are simple scalars. ∧/0=≡¨ checks if all elements are simple, but it seems that you want to not only test, but also rectify. However, then it looks like you realised that elements should be either simple numeric scalars or simple character vectors, i.e. "classic database data", or a non-nested array in non-APLs, e.g. [1,"Hello",2,"World"] in JSON. That's more complicated to test for, and even worse to rectify.
What do you want to return from e.g. ⍬ (2 2⍴'OhNo') ?
How about 1 'H' 2 'W'?
At least you can test a vector for containing all numeric scalars and character vectors with ∧/1=≡¨+2|⎕DR¨ assuming it has no refs. You can modify this to suit your needs. E.g. if you want to allow character scalars, you can do ∧/1≥≡¨+2|⎕DR¨
 
 
3 hours later…
ngn
9:19 AM
@Adám that's a good one :) i'll keep quiet
 
:-D
 
RGS
9:49 AM
@ngn did you know it already or did you solve it "now"?
And up to the explanation, do these types of challenges have unique solutions? Or has anyone ever heard a challenge for which people came up with different solutions
 
ngn
@RGS both. i had to solve it again because i had forgotten the solution.
@RGS wdym by "these types of challenges" - challenges with hats? :)
 
RGS
@ngn yes xD challenges with this spirit. X people in some configuration Y will perform task Z but are allowed to discuss some strategy S beforehand. Find S.
 
ngn
@RGS they can be very different
 
RGS
The challenges, of course. Do you know any (X, Y, Z) with non trivial solutions that different? At least different at first sight?
 
ngn
@RGS not off the top of my hat.. er, head
@RGS i believe i won't spoil the challenge if i tell you: this particular one has a solution that simply clicks into place. once you find it, there'll be no point looking for other strategies.
 
RGS
10:07 AM
@ngn but I solved it already :) and it did click into place, it just made sense
 
ngn
@RGS ah, cool :)
 
10:23 AM
@AviF.S. yeah, as Adám said, golfing is not a priority at all (my usage for golfing may influence my decisions otherwise though), its purpose is to be the APL I would want to use. (related to the conversation, i once had a ⎕COND which could change the definition of truthiness, from "only 0 or 1", "0≠" and "0<", but removed it because i found it to be never used and it complicated the implementation a lot, settling on the usual 0 or 1)
 
 
2 hours later…
RGS
12:06 PM
@Adám this is what I'm sending Roger. (cc @ngn)
 
> be the guess the i mathematician writes down
Should be "ith", no?
 
RGS
@Adám you are also a good proofreader :D
 
12:24 PM
@RGS If you want to make Roger smile, then change ⎕IO ← 0 to ⎕IO ← 0 ⍝ ⎕IO delenda est
 
RGS
@Adám does Roger really dislike ⎕IO ← 1 being the default?
 
@RGS Not just it being the default; it being possible to set to 1. He adds that comment pretty much everywhere.
 
RGS
@Adám ahahaha that's really amusing! Will do that, thanks for the tip ;)
 
12:55 PM
@RGS My idea was similar but couldn't figure out how it would prevent everyone from failing. Now I see that each person is covering one of n possibilities (sum of hats modulo n). Neat problem and solution.
 
RGS
@Bubbler ←+ 1
 
ngn
@RGS n|s+⍳n works too
 
RGS
unless you mean to modify something else, as well
 
ngn
1:09 PM
@RGS right, that reverses the indices of 1..n-1 :(
@ngn s definitely needs to be negated there. the order of ⍳n doesn't matter, it could be an arbitrary permutation.
 
RGS
Probably the solution could also be,instead of mathematician i guessing enough to add up to i, mathematician i could guess enough to subtract to i, but then the code would change in two lines I think.
 
ngn
@RGS btw, it works with ⎕io←1 too, but i'd recommend sticking to 0 and keeping the "delenda" comment ;)
 
RGS
1:25 PM
@ngn yup, corresponds to a shift in the numbering of the mathematicians but I prefer to count from 0 to n-1 :)
 
ngn
@RGS 👍
 
 
9 hours later…
RGS
10:49 PM
Hello @Adám , I was given the task change a connectivity matrix into a connectivity list and I was expecting something like this
And the revealed APLCart entry was this one
Could you maybe elaborate a bit on why you replicate the connections in the list the amount of times the connectivity matrix indicates? Also, I'm assuming you return a matrix because that's better than a vector with cells containing 2-elem vectors? Finally, how would you compare the two ways to build the initial pairs of indices? My ∘.,⍨⍳≢⍵ and your 1+s⊤¯1+⍳×/s←⍴⍵
 
I'm off to bed now, but I'll have a look tomorrow morning.
 
RGS
Of course, bye o/
 
@RGS ∘.,⍨⍳≢⍵ can be simplified to ⍳⍴⍵
 
11:14 PM
Also, the terminology used in APLcart could be better. Googling "connectivity matrix" gives adjacency matrix, and "connectivity list" gives nothing related to graph theory. I believe the latter must be adjacency list though the output format is somewhat different from that.
 
RGS
@Bubbler oh wow, I forget iota can take a vector as input
 
cf. dfns graph is a proper example of an adjacency list
 
11:36 PM
The APLcart entry also seems to assume the given adj. matrix is unweighted (so it is a Boolean array). If it is, it must say so in the description.
(Converting an unweighted adj. matrix to a proper adj. list is as simple as ⊂∘⍸⍤1)
(And RGS's is as simple as ⍸×)
@Adám @RGS ^
 

« first day (1215 days earlier)      last day (1432 days later) »