@BrianBED By the way, setting ⎕IO inside a dfn will localise it within that dfn, so ⎕IO in the session will not be affected - perhaps that was the joke, but just so you know
How about an operator that takes the stride as left operand, the count as right argument, and an optional starting point (default is 0) as left argument.
i wonder, has anyone ever made an AI that tries to simplify/optimize APL code? if not i'm not gonna be the one to do it, but it would be cool if it was a thing
@Adám every user has a channel they can post on. theoretcially you're guarenteed to have a channel if you have a google account but usually when someone asks if you have a channel, it usually means if you post vids on your channel
code_report said APL doesn't have first class functions while bqn does, and i didn't know what first class functions so i googled: https://en.wikipedia.org/wiki/First-class_function and from what i understand, doesn't every language with eval satisfy the requirements? actually the wikipedia article has an example of map, which is basically / in APL so i wonder... why isn't APL said to have first class functions like BQN?
hmmm but again about the map example. wikipedia says if a langauge can do map then it has first class functions. so like does APL's / not do the same as map?
It's more vague with APL since it has restricted higher order functions, but having first class functions mean functions are treated no different than any other value, so APL's operators aren't first class
"For a language to support map, it must support passing a function as an argument." that second part of the sentence doesn't imply that it has first-class functions
⋄ create_adder←{⍎(⍕⍵),'←{',(⍕⍺),'+⍵}'} ⍝ ⍵←name, ⍺←int ⋄ 100 create_adder 'test' ⋄ test 20 i was able to make a like... wierd first class function replica. fun problem. the python version is https://imgur.com/93Pks9n
@BrianBED To run APL code, write code blocks starting with ⎕← or ⋄ or write a multi-line code block and prepend ⎕← or ⋄ to lines you wish to run. All matching groups / lines will be joined by ⋄ and run via TryAPL, and the output will be posted here. To format a codeblock, write `code`, or for a multi-line code block, use Shift+Enter to type multiple lines and press Ctrl-K, press the 'fixed font' button, or prepend four spaces to each line.