« first day (1079 days earlier)      last day (1558 days later) » 

1:38 AM
An attempt at a branchless, array style, FizzBuzz:
https://tio.run/##SyzI0U2pTMzJT///PzUv5VHbBEMDA66c/Pzs0gIg51HvZqAoV0piSSKQBxHWUXfLrKpSV1B3KgVTIB6YyZWZl1yUmpuaV1IMVKzxqGvx4ekaQBM0HvV0Hd7@qHeFpqYmF9TsaGMFhGoFoJ2xQC1Aq7QNubjSMstSQSaYoimBaQXLg9RraKCKdC4BmqAJtBRkkJGmpjaaAluwhKEmTIkxyD2PeucBjQL5MBqiOPb/fwA
 
2:06 AM
@TessellatingHeckler How about this?
 
2:39 AM
@Bubbler That sure is a lot golfier, shorter and more easily readable; for personal challenge I was trying to avoid 0=3 5| pattern
I imagine you could do your "1 fizz buzz fizzbuzz" "2 fizz buzz fizzbuzz" with a 100x4 array
but damned if I can make one
how hard can it be to (⍪⍳100)⍪'Fizz' 'Buzz' 'FizzBuzz' and not get LENGTH ERROR
 
 
1 hour later…
4:14 AM
typicalAPLsession.txt
nums←⍳16
data←(⍪nums),⍤1⊢ 'Fizz' 'Buzz' 'FizzBuzz'
data
⊂⍤1((⍪⍳15),1++⌿0=3 5∘.|⍳15)
indices
just .. imagine the indices selecting from the data array
because coding it is apparently not possible
 
4:55 AM
well I gave up and went for {⍵⌷data}¨ only to find the indices aren't right either, and I can't make them right, and think I want "prefix agreement" to add the equivalent of
0 1 + (2 3⍴ 0 0 0 1 1 1)
 
ngn
5:18 AM
@TessellatingHeckler try +[⎕io] instead of +
 
5:30 AM
⎕←0 1 +[⎕io] (2 3⍴ 0 0 0 1 1 1)
 
@TessellatingHeckler
0 0 0
2 2 2
 
@ngn ah, that's where that voodoo comes in useful
wait no that's not half axis
 
ngn
@TessellatingHeckler half axes are used when you insert something in the shape, e.g. with "laminate" (⍺,[0.5]⍵) but in your case + needs a specific integer axis.
 
ngn
6:48 AM
@Bubbler '(',(⍺∇r),'|',(⍺∇s),')' -> 1⌽')(',(⍺∇r),'|',⍺∇s -> 1⌽∊')('(⍺∇r)'|',⍺∇s
 
7:12 AM
@ngn That's a nice tip for string construction.
 
@Bubbler Will you add that to ?
 
7:34 AM
@Adám Posted.
 
@Adám Fizzes are appearing at wrong places.
 
@Bubbler Oh, they are indeed.
Stupid me, what was I thinking‽
@Bubbler Btw, in general for surrounding expressions with stuff: 0,(⍳5),0∊0(⍳5)0
 
@Adám So construct a matrix, rotate the rows, and then extract the last column?
 
8:37 AM
@Bubbler Yes. We could index too, but it is more verbose: (1+2⊥0=5 3∘.|⍳)(⌷⍤0 1)'Fizz' 'Buzz' 'FizzBuzz',⍤0 1⍨⍳
 
9:21 AM
@JamesHeslip APL Team Leader? That's an achievement!
 
9:37 AM
@AmirKirsh Hi there. Interested in APL?
 
@Adám browsing chat randomly :-)
 
 
2 hours later…
11:44 AM
@Adám Why, thank you :)
 
 
4 hours later…
3:15 PM
@osuka_ Hello. Interested in APL?
 
3:31 PM
Hello - you could say so, yes. I'm interested in golfing in general, though I mostly golf python
I'm also fairly okay at befunge, but that's really a language that only comes in handy once every decade anyway
 
@osuka_ Right, so APL is a quite golfy language, while also being a real-world production language. How much do you know of/about APL?
 
3:59 PM
APL is a functional language with some really weird syntax, and it's got the whole nested array thing going on
I know a collection of miscellaneous things about it that I've heard or read over time and that may or may not be true. For instance, I'm pretty sure it evaluates right to left (so there seems to be some polish notation happening)
not quite mathematically mind-boggling as haskell, though
 
4:34 PM
@osuka_ Not Polish notation, just the rule for when things have the same precedence, just like traditional mathematics has such rules. Would you like me to give you an intro course?
 
4:50 PM
Sure! Do you have any good resources?
 
@osuka_ Plenty. Have a look here. I can also give you a personalised course right here in the chat, in half an hour, if it fits you, or we can find another time.
 
5:07 PM
I'm working right now, but I'll make sure to hang around and I'll ask any questions I have. Any advice for me?
 
@osuka_ First piece if advice is to use the @Adám syntax to ping people, otherwise your messages go unnoticed. (This explains my long response times.)
 
@Adám That's okay - I'm just conditioned to not @ people unless it really is a bit urgent. I'm just hanging out over here
 
@osuka_ I personally don't mind pings. And by using the reply functionality (as you just did), others can easier follow past conversations.
@osuka_ Now, would you like advice on which resources to use so you can begin learning APL by yourself?
 
5:23 PM
@Adám I'll keep that in mind - and yeah, I'd like some advice on that. My background is in python and c++ (so mostly oop), but functional programming isn't super difficult to wrap my head around
 
@osuka_ That makes you a non-APL programmer.
 
@Adám oh, I know - I'm saying, should I also spend the time on learning functional programming more generally (outside of the context of learning APL)?
Or, should I not bother?
 
@Adám we're currently discussing methods of training our new APL apprentice. We have a lot of internal material including an Optima printed training course. It is basic and very out of date. We've built things up over the years but nothing really compares to the professional APL course delivered by Bernard Legrand himself. Are Dyalog looking to revive this, or are the Jupyter Notebooks a direct replacement?
 
@osuka_ You don't need to. (Dyalog) APL is truly multi-paradigm. You can go all OOP or fully functional. I'd start with understanding the basic syntax of APL.
@JamesHeslip We are looking to (kind-of) revive it. We recorded his last course, and are considering organised courses where participants watch the videos and have a live teacher accessible online to answer questions. They attendees would also be able to meet virtually to discuss matters.
I don't think a single resource will cut it either. People have different backgrounds. That's why the wiki distinguishes between:
1. Non-programmers
2. Non-APL programmers
3. Novice APLers
4. Old APLers
5. Advanced APLers
 
@Adám would it be possible to get a copy of the recording? Would really help with our current situation. I was on the last course if that makes any difference ;)
 
5:32 PM
@JamesHeslip Probably. @RichardPark Do you know where it is?
@JamesHeslip Would Optima be interested in making the printed course available online in electronic form?
 
@Adám if we can source the digital version, then possibly. I would need to speak to Paul as it was originally written by one of the founding directors of the company (I'd never even heard of them...)
 
What other internal material do you have?
Oh, btw, Richard Park and I have found a pretty good formula for getting people, who have never seen APL before, enough knowledge to continue on their own with expanding their vocabulary and skills. It takes about 3 hours and the only pre-requisite is some mathematical knowledge. We've given this course three times at local schools, and I've given it to a handful of people here in the chat room too.
 
@Adám over time we've built up a Confluence library of knowledge transfer. Session plans ranging from an introduction to the IDE to a bunch of projects used to test knowledge. It's lacking in areas, but there's a structure to it.
 
@JamesHeslip Ah, an IDE intro is something we're very much in need of. I'd be awesome if we could cooperate on such matters and have links to all these things from that wiki page.
 
Not sure how that would work currently as it's an internal knowledge base. We've structured it in the form of "things to deliver" when taking a session with a new starter. This could be fleshed out to be more verbose with screenshots, etc. Right now that is one of the session plans that could do with a bit of work.
 
5:47 PM
(Press up arrow key to edit your last message)
 
@Adám I have to head home. Let me know if you can locate that video though- would be really useful.
Ah, thanks, will bear that in mind.
 
I expect Richard to react to the ping tomorrow.
 
6:14 PM
Hi @JeffZeitlin . Interested in APL?
 
6:40 PM
@TessellatingHeckler you need a leading for the bot to react.
 
⋄ end←16 ⋄ nums←⍳end ⋄ data←data←(⍪nums),⍤1⊢ 'Fizz' 'Buzz' 'FizzBuzz' ⋄ ⎕←{⍵⌷data}¨⊂⍤1((⍪⍳end),1++⌿2 1×[1]0=3 5∘.|nums)
 
@TessellatingHeckler
  ┌───┴───┐
  ¨       ⍤
┌─┘      ┌┴┐
{⍵⌷data} ⊂ 1···1·1·
           ····2·1·
           ····3·3·
           ····4·1·
           ····5·2·
           ····6·3·
           ····7·1·
           ····8·1·
           ····9·3·
           ···10·2·
           ···11·1·
           ···12·3·
           ···13·1·
           ···14·1·
           ···15·4·
           ···16·1·
 
um
⎕←{nums←⍳⍵ ⋄ data←data←(⍪nums),⍤1⊢ 'Fizz' 'Buzz' 'FizzBuzz' ⋄ {⍵⌷data}¨⊂⍤1((⍪⍳⍵),1++⌿2 1×[1]0=3 5∘.|nums)} 16
 
@TessellatingHeckler
SYNTAX ERROR
 
works in nars2000
@Adám anyway, combining and what you're doing with base encoding lets me fix why the offsets weren't right
 
6:44 PM
@TessellatingHeckler Because in NARS2000 (APL2, actually) operators bind stronger than stranding:
 
@ngn and whatever integer axis does that rank adjustements don't do
 
⎕←{nums←⍳⍵ ⋄ data←data←(⍪nums),⍤1⊢ 'Fizz' 'Buzz' 'FizzBuzz' ⋄ {⍵⌷data}¨⊂⍤1⊢((⍪⍳⍵),1++⌿2 1×[1]0=3 5∘.|nums)} 16
 
@Adám
┌─┬─┬──────┬─┬──────┬──────┬─┬─┬──────┬──────┬──┬──────┬──┬──┬──────────┬──┐
│1│2│┌────┐│4│┌────┐│┌────┐│7│8│┌────┐│┌────┐│11│┌────┐│13│14│┌────────┐│16│
│ │ ││Buzz││ ││Fizz│││Buzz││ │ ││Buzz│││Fizz││  ││Buzz││  │  ││FizzBuzz││  │
│ │ │└────┘│ │└────┘│└────┘│ │ │└────┘│└────┘│  │└────┘│  │  │└────────┘│  │
└─┴─┴──────┴─┴──────┴──────┴─┴─┴──────┴──────┴──┴──────┴──┴──┴──────────┴──┘
 
I now have valid coordinates into the fizzbuzz matrix
@Adám sooo is there a way to use rank to make {⍵⌷data}¨ into data⌷___ without the lambda and each?
 
⎕←{nums←⍳⍵ ⋄ data←data←(⍪nums),⍤1⊢ 'Fizz' 'Buzz' 'FizzBuzz' ⋄ data⌷⍤1 99⍨(⍪⍳⍵),1++⌿2 1×[1]0=3 5∘.|nums} 16
 
6:46 PM
@Adám
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┐
│1│2│Buzz│4│Fizz│Buzz│7│8│Buzz│Fizz│11│Buzz│13│14│FizzBuzz│16│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┘
 
@Adám ah a right tack to separate the rank of enclose, I see
 
Hi, @Adám! Saw a reference to the chat in the comments to one of your APL solutions in CodeGolf, so I stuck my head in. I'm a non-APL programmer who has had some exposure to APL, but TradAPL rather than the current model where you can the kind of anonymous closures that you often post. You were the one that got one of my APL solutions in CodeGolf to work on TIO. :)
 
@JeffZeitlin Ah, I remember now. How about we teach you some modern APL?
 
@Adám how come that version doesn't need a right tack after the squad rank adjustment? Is it because commute is acting as the same thing, or because the enclose isn't needed either?
 
@TessellatingHeckler The separates.
 
6:51 PM
Heehee! I just wish I had the time. There are only 24 hours in a day, after all... I do have [an older version of] the free Dyalog installed on one of my own PCs at home, and also NARS2000, and also a DOSBox with about a half-dozen TradAPLs installed.
I always though that APL was an interesting language, if a bit cryptic...
 
@JeffZeitlin You may want to download the newest Dyalog version it has been made completely free with no registration needed.
 
Oh, cool! I didn't mind the registration; just needed to keep looking up which of my <no, more than that> email addresses I used for it... :)
 
⎕←{('Fizz' 'Buzz' 'FizzBuzz',⍤1⍨⍪⍳⍵)⌷⍤1 99⍨(⍪⍳⍵),1+2⊥0=3 5∘.|⍳⍵} 16
 
@TessellatingHeckler
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┐
│1│2│Buzz│4│Fizz│Buzz│7│8│Buzz│Fizz│11│Buzz│13│14│FizzBuzz│16│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┘
 
I was actually looking at using APL as a DSL for building assists for a (tabletop) RPG I edit a magazine for; the problem is that getting potential users who are not programmers to download and install APL terps is ... somewhat difficult.
 
7:06 PM
@JeffZeitlin You could just create a single stand-alone exe.
 
Thought that wasn't an option except if I gave Dyalog a con$ideration - plus I'd need to be able to generate a Linux and/or Mac "exe" (as well as a WinEXE) from a Windows box.
 
⎕←((⍪,1+2⊥0=3 5∘.|⊢)(⌷⍤1 99)('Fizz' 'Buzz' 'FizzBuzz',⍤1⍨⍪))⍳16
 
@TessellatingHeckler
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┐
│1│2│Buzz│4│Fizz│Buzz│7│8│Buzz│Fizz│11│Buzz│13│14│FizzBuzz│16│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┘
 
Excellent; I think that's about as far as I can take my approach, and that I somewhat understand how it works.
 
@JeffZeitlin I think (but you should double-check) that it is fine if you're not making money off it. But yeah, UX is still an issue. Still, I think you could bundle the Dyalog executable or so/dyalib with your workspace.
@TessellatingHeckler Nope:
⎕←(,⍤0 1∘'Fizz' 'Buzz' 'FizzBuzz'⌷⍤0 1⍨1+2⊥0=3 5∘.|⊢)⍳16
 
7:18 PM
@Adám
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┐
│1│2│Buzz│4│Fizz│Buzz│7│8│Buzz│Fizz│11│Buzz│13│14│FizzBuzz│16│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┘
 
I'll definitely look into it when I get a chance.
/me has a sudden realization...
Does this chatroom have an actual APL terp linked in to respond to APL code?!
 
@JeffZeitlin It does.
)about
 
@Adám You can evaluate a single line of APL by typing it into chat prefixed by ⍞←. Use ⎕← instead for boxed display and multi-line results and use ⋄ instead to silence the first statement. Use ] to call user commands, including ]help ⍣ for help on a glyph etc. Do not use markdown, but fixed-width (4 initial spaces) is fine. Commands: )lb for language bar, )docs for full documentation, )ref for PDF reference card, )idioms for idiom list.
 
Very cool!
 
7:32 PM
@Adám the emphasis being on "as far as I can take", lol.
 
@TessellatingHeckler How about a general-purpose FizzBuzzer:
⋄ FB←('Fizz' 'Buzz' 'FizzBuzz',⍤0 1⍨⊢)⌷⍤0 1⍨1+2⊥0=∘.|
⋄ ⎕←3 5 FB ⍳16
⋄ ⎕←3 5 FB 1 ¯3 ¯7 10 ¯15
⋄ ⎕←2 7 FB ⍳16
 
@Adám
┌─┬─┬────┬─┬────┬────┬─┬─┬────┬────┬──┬────┬──┬──┬────────┬──┐
│1│2│Buzz│4│Fizz│Buzz│7│8│Buzz│Fizz│11│Buzz│13│14│FizzBuzz│16│
└─┴─┴────┴─┴────┴────┴─┴─┴────┴────┴──┴────┴──┴──┴────────┴──┘
┌─┬────┬──┬────┬────────┐
│1│Buzz│¯7│Fizz│FizzBuzz│
└─┴────┴──┴────┴────────┘
┌─┬────┬─┬────┬─┬────┬────┬────┬─┬────┬──┬────┬──┬────────┬──┬────┐
│1│Buzz│3│Buzz│5│Buzz│Fizz│Buzz│9│Buzz│11│Buzz│13│FizzBuzz│15│Buzz│
└─┴────┴─┴────┴─┴────┴────┴────┴─┴────┴──┴────┴──┴────────┴──┴────┘
 
@Adám wow. I have very little intuition about where the left arguments get used in trains and where they don't; they must be used in ∘.| on the far right I suppose
⎕←0=∘.|
 
@TessellatingHeckler Every function that would use the argument in a monadic train also uses the left argument when the train is called dyadically.
 
Just out of curiosity... Does Dyalog have a US office that does business in USD? If I decide to buy one of the licenses or support agreements, I'm going to get a hassle from my bank and hit big time with currency conversion fees if I have to do it in Sterling.
 
7:45 PM
 
Excellent, thanks! (But why does the US office, with a near-Rochester-NY address, have a Washington DC phone number [Area Code 202?)
 
I don't know. Maybe he moved.
 
8:18 PM
Is there any way to interrupt a stream of too much output, on a laptop keyboard with no break key, in Dyalog Windows?
 
@TessellatingHeckler Menu bar: Action > Interrupt or system tray: Click icon, then Weak Interrupt
 
9:06 PM
@Adám Ah! Thank you
 
 
2 hours later…
11:04 PM
Hey, I'm eligible for a 200 rep bounty:
0
A: Convert JSON string to Key / Value Arrays

AdámAPL (Dyalog Unicode), 18 bytesSBCS Anonymous tacit prefix function. Prints list of keys, then returns list of values. '⍎¨⎕←⎕NL¯2'⍎⍨⎕JSON Try it online! ⎕JSON convert JSON string to APL namespace object '…'⍎⍨ in that namespace, execute the following code:  ⎕NL¯2 name list for all all vari...

 
@Adám Wow. I didn't know that can take optional left argument.
 
@Bubbler It is a bit unnecessary now that we have the dot syntax, but good for golfing, and it allows you to do tacit OOP if you feel like self-affliction.
object.member ←→ object⍎'member'
object.member ←→ 'object'⍎'member'
@Bubbler Btw, can be used as a train's middle tine by giving it # as left argument.
 

« first day (1079 days earlier)      last day (1558 days later) »