Welcome to the fourth Learn You A Lang For Great Good event! Today's language is BQN, a recent addition to the APL family. For this event, feel free to ask about BQN, post CMCs to solve in BQN, and anything else related to the language. You can run BQN code online here.
@Marshall See the above! We have a bimonthly event in the main TNB chat room where we teach and learn a new lang. Today's featured language is BQN, and it'd be great to have you over. I think people would appreciate help learning it too; if you want to give a first lesson there you'll have an audience!
Otherwise maybe you'd like to hop on over, @Adám?
Anyway, I prob won't be on unfortunately, but just wanted to do the appropriate pinging to spread the message :)
@rabbitgrowth It used to be like LdBeth describes, but the interpreter now understands that they are equivalent, so you can write either with no performance penalty.
I saw this logic and wonder why the result is one rather than zero:
P ← 1 1 0
Q ← 0 0 1
∨/ P ∧← Q
1
On the other hand the following results in zero:
P ← 1 1 0
Q ← 0 0 1
∨/ P ← P ∧ Q
0
I'm using Dyalog APL 16.
you have to pre-initialise these static variables which means either holding a public namespace with these which doesn't alleviate the problem too much, or having special code that checks the name class of a dummy variable in a namespace to decide whether you should initialise the variables now.
but it's not so simple, the dfn will return after the guard, so you have to recurse somehow with the new namespace contents. and it becomes messier and messier, and you have to put the initialisations in a dfn
@rak1507 there's a bunch of variables called keys, ord, cs, etc... - they might clash with something
limiting your variables scope to the smallest possible is like, programming 101