Bad macros for variadic inputs

How do you correctly translate variadic inputs?
@bh this is a flaw in the macros stuff,you cannot always generate correct variadic inputs.


It's werid
What's the problem with my reverse codification blocks?

Oh I see.
The mapping for the join block does not support anything other than 2 inputs
Also,the mapping for the list and script var block does not support anything other than 1 input
How do you correctly translate variadic inputs?
@bh this is a flaw in the macros stuff,you cannot always generate correct variadic inputs.

Current workaround:


(drag the script into snap)
Needs js :frowning:
For the join block,because you cannot blockify a joined string,you cannot do this exactly.
You can try to use combine and then this patch
You cannot fix the script vars block even with this patch

@bh I think that we can have a "generate empty list block length %x" block
Or change a bit how the split and join works
Example:
a block 1 2 addInput delInput 3
Before:
[{a block [] [] addInput delInput []} 1 2 3]
After:
[{a block addInput []} [1 2] 3]

Also,I don't know why this doesn't work:



you pinged bh 3 times in 20 minutes. you really need to slow down and just try to think things through yourself first. i'm almost certian the issues you're having is because you need to split blocks before you can join them, i know that's the case for the last post, and i really don't want to try and figure out what you're trying to do in your other blocks that's breaking the scripts.

the forums aren't a place to dump your project and ask for answers as quick as possible. if you're actually stuck, give the minimum amount of code that shows the issue.

yes

the problem is tha variadic inputs never translate properly(would only join or split to correct input amount,although its called a variadic input)

i did

To specify an amount of inputs in a variadic input, here is what you need to do.

The first item in the list in item 2 is the number of inputs in a variadic input. The rest of the items in that list is all the values. Note: this does work if the block already has inputs.

Actually, I now realize, you can just do this instead

the blocks you sent are unusable (the variable mapping isn't included) and you should be inlining those blocks so people can read it. when inlined, it's clear that it's joining into lines, then splitting by lines right after, so it still isn't minimal. two maps can be combined, and here's your minimal example.


note that in the map, json is created, then immediately split again, so you should be checking if the bug is there. if it isn't, then this still isn't a minimal example because you can remove the json conversion.

Ooh!nice