Might we use GET-WORD! in PRINT to mean "MOLD"?


#1

I've talked in the past about how I think PRINT of a BLOCK! is a pretty limited dialect, in that its hands are kind of tied because it allows just any evaluation, not required to be in a GROUP!. Compare this with PARSE, which strictly controls evaluations.

One thing that occurs to me that could be done without really making that much of a ripple in SPACED/UNSPACED/DELIMIT would be if GET-WORD! could mean "mold this":

 >> value: [a b c]

 >> print ["Value is:" value]
 Value is a b c

 >> print ["Value is:" :value]
 Value is [a b c]

One reason it doesn't make much of a ripple is because in the case of an unset variable, there wouldn't be any difference...nulls can't mold anyway.

Note this is a suggestion for the direct dialect behavior, not of a GET-WORD! that gets generated:

 >> print ["Value is:" quote :value]
 Value is :value

The idea that every stringy type that isn't a TEXT! form with their delimiters is something I've been assuming for a bit, in a "WYSIWYG" kind of mentality.

One technical question interfering in the evaluation raises is what to do about infix, such as something that is looking to pick up the GET-WORD! on the left.

>> :value left-quote
== :value

>> print ["Value is" :value left-quote]
Value is :value // this is presumably what the output should be

This would mean that while SPACED was looking at the pending evaluations, it would have to do something along the lines of notice it was a GET-WORD!, do the evaluation, and then ask if the evaluation moved by only one unit. There's actually more to worry about than that, because pure invisible comments would be evaluated as well...

Such interactions are complex, and raise a lot of questions about just how dialect-y you can get when you let people write any evaluative material in a block like that. But requiring GROUP! would be rather heavy-handed, and if literal inspections were done then at least if that's not what you wanted, you could use a group.

If this isn't good, is any PRINT (SPACED, DELIMIT) dialecting good?

People certainly want to use literal TAG! in unspaced:

unspaced [<b> "bolded text" </b>]

So the idea of using tags for control codes or saying how many digits of precision to print integers with would probably be unpopular. Is PRINT never going to aspire to more, and is that the job of a higher level print format routine?

If that's the mindset, then this GET-WORD! proposal is probably the only change that might be considered for squeaking by, but if it's the only irregularity it's probably not worth it. (?)