JOIN doesn't work very well on blocks with variadic inputs

(To Jens: You probably know about this already)

Here's a script pic that shows the problem:
untitled script pic - 2021-12-29T221305.781
And this just errors:


This kind of works, but just pushes the issue to LIST:

Oh and if you CALL, say, the last one, it just gives an empty string.

What are you really trying to do? This can't be the best way to do it.

I'm not currently trying to do anything right now.

You've seen joecooldoo's reverse codification project, right? You can't really use variadic inputs in it because of this.

Yeah. Oh, so you're trying to use the new v7 introspection features of JOIN? Okay, yes, this is a limitation we should address.

Yes, I've got a bunch of little fixes that I'm going to push sometime next week and this one (arity control) is going to be among them.

I've just released a patch (v7.0.3) that addresses this (and some other) issues. You may need to perform a "hard reload" (reload Snap! in the browser while keeping the shift key down) or to flush your browser cache in order for the changes to become active right away.

The way this works now is that you can control the arity of a polyadic input by fully collapsing it and specifying an input list whose first item is an integer representing the total number of slots followed by the contents of these slots.

Here's an example:

Note that the number of list items following the first one does not have to match the number of slots specified in the list's first item.

Does that make sense to you?

I wonder if it should flag an error if the number is smaller than the list of input expressions.

Yes, though if I were implementing it, I'd probably have a more implicit version. That's not to say your approach isn't better, but...