Every BQN function can be called with one or two arguments, possibly doing completely different things in each case. The Valences (โ
) 2-modifier grafts together a one-argument function ๐ฝ
and a two-argument function ๐พ
, with the resulting function calling one or the other as appropriate. It's the tacit equivalent of a block function with two bodies. So the function {รท๐ฉ ; ๐ฉ-๐จ}
can also be written รทโ(-ห)
. A full definition of Valences as a block is {๐ฝ๐ฉ;๐จ๐พ๐ฉ}
.
-โ+ 6 # - side ยฏ6 3 -โ+ 2 # + side 5
Valences provides one way to check whether ๐จ
is present in a block function. The expression ๐จ0โ1๐ฉ
always ignores the values of the arguments, resulting in 0
if ๐จ
isn't given and 1
if it is (if you want 1
or 2
, then โ ๐จโ๐ฉ
is shorter, but I'm not sure if I like it).
{๐จ0โ1๐ฉ} 'x' 0 'w' {๐จ0โ1๐ฉ} 'x' 1