The convention of BLANK-in, NULL-out…in which routines act as no-ops when they receive a blank…is extremely common. So far it’s meant you wind up writing things like:
exists?: function [file [blank! file!]] [ if blank? file [return null] ... // actual code ]
With @rgchris’s recent updating efforts running against the “more nulls” convention, I’ve tried to emphasize that following this convention is what makes it all “work”. It’s why COLLECT returning NULL becomes smart and palatable. The conditional falsey-ness of NULLs, with the ease by which TRY can turn it into a “friendlier” nothing that most routines are willing to pass on, is an elegant design.
There’s a lot of upside to this. Especially if the evaluator knows a parameter means “don’t run if blank”…it can avoid the processing and overhead involved in a call. That’s on top of all the savings you get by not generating the empty blocks or strings in the first place, then having to GC them. It’s better, I promise!!!
But it only works if the convention is pervasive. So it has to be easier…what should the annotation be called? If it were Zen it could be
<mu> for “unasking a question”.
I think a good choice is to just use a TAG! that says
<blank> vs. the datatype BLANK!.
exists?: function [file [<blank> file!]] [ ... // actual code, that never receives a blank ... // because the function won't be run if it gets one! ]
It’s similar to an existing convention for return types. When you say
return: <void>, it means “no matter what is returned, make it a void, so other results don’t leak out”. While
return: [void!] is just like returning any other datatype…e.g. “void is one of the acceptable return types, check that the routine doesn’t return anything else”.
So my thought here is that it’s learnable that
<blank> means “special blank”. You’d find out pretty quickly there’s a difference from plain
blank! in your typeset, because your function won’t run at all if it is blank!
I’d be wary of a name that didn’t mention blank at all, and talked only about the effects. Like that it returns null, or something:
exists?: function [file [<nullifies> file!]] ... exists?: function [file [<revokes> file!]] ... exists?: function [file [<retracts> file!]] ...
To my mind, the word blank has to be in there to draw attention to blank’s role. But more than one word seems it would get clunky.
<blank-in-null-out> ad nauseum. There are some other one-word options, like
<blankifies> but I’m not sure what it adds.
So my vote is plain
<blank>. Admittedly, it is subtle to just be “special blank!”, and leave it up to the imagination of what’s so special about that blank. But I think in the long run, the cleanness and appreciation for less typing outweighs its somewhat enigmatic nature.