So it's been settled, I think, that COMPOSE is allowed to use the context of its callsite.
This makes it suitable for string interpolation: even though strings don't have bindings, COMPOSE can just use any variables visible to its frame:
>> num: 1000
>> print compose "Number is (num + 20), so there."
Number is 1020, so there.
It's very useful, and even this trivial case shows a benefit of being able to put the comma right up against the number if you want to. Traditionally that's hard to do as PRINT typically adds spaces around everything. So you have to do something like this:
>> print unspaced ["Number is" _ num ", so there."]
Number is 10, so there.
Wacky experiments of the past tried to make it nicer by interpreting BLOCK! inside the PRINT's block as grouping things tightly:
>> print ["Number is" [num ","] "so there."]
Number is 10, so there.
But that's lousy compared to interpolation.
Can we do better than PRINT COMPOSE for how you request interpolation?
PRINT STRING Interpolates, PRINT [STRING] Does Not?
We could make it so that PRINT presumes you want interpolation if you pass it a string:
>> num: 10
>> print "Number is (num), so there."
Number is 10, so there.
Then we could say that if you don't want that, you can put the string in a block:
>> print ["When using a block, (...) would not interpolate."]
When using a block, (...) would not interpolate.
There's another option to pass PRINT an @var
, and if you did then that would suppress interpolation as well.
>> str: "Number is (num), so there."
>> print str
Number is 10, so there.
>> print [str]
Number is {{num}}, so there.
>> print @str
Number is {{num}}, so there.
Other Names...?
This could be a different word like echo
or say
or something like that, though I'm not crazy about either of those.
A Really Brief Operator?
print op "Number is {{num}}, so there."
But I don't know there's anything on the list of short words that would make the cut for "very short way to ask for COMPOSE"
Different String Type... e.g. TAG! ?
>> print <Number is (num), so there.>
== Number is 10, so there.
TAG! doesn't seem completely crazy, though I have other ideas for what TAG! means inside of PRINT as a formatting instruction.
Out of all these suggestions I probably like the TAG! one the best, so far.