How do I make this more elegant

Hello. I saw this tweet and reminded me how dynamic sentences can be constructed in Snap!

Sentence script pic (1)

I don’t like how the definition looks like:

  1. Is there a better way that split and join? and

  2. How do I refer the label of this block instead of providing the block itself (line 2)

https://snap.berkeley.edu/snap/snap.html#present:Username=tsvetelin&ProjectName=Sentence&editMode&noRun

Thank you!

As in the image below. It is also more flexible, thanks to this (inputs).

Use this (caller), which reports the block itself inside block definitions.

Beautiful! Thank you!

I missed to unringify this (caller)

P.S.

What do you think about the video in the tweet as a way to program a sentence?

I think you’re doing a lot of extra work to avoid doing this the natural way:

because you’re trying to turn the language into a word processor! That’s what writing the text on the title line does.

The video in the tweet or the Snap! blocks? I was baffled by which you meant.

True. I want to use the reporter as a UI.

The Tweet

Alas, Snap! doesn’t make it straightforward for users to make up title text on the fly.

We, the Snap! Team, aren’t offended if you decide to write your program in (say) Python. We only get offended if you try to write it in Snap!, but have it behave as if you’d written it in Python. Each language has its own affordances, as they say in the prog lang industry. :~)

True, But in Python I can’t put the parameters in the middle of the function name. In Snap! I can do

untitled script pic

which I find beautiful.

Edit: I accidentally put a useless append () () block and left some scrapped blocks in the definition. This is even more elegant, forget about the old one.