It seems to me that the first thing to clarify here is the difference between “no value” (commonly called null, though in this case it’s closer to “empty list” or, as you could think of it, “no input”/“0 results”) and “empty string”. Perhaps one way to illustrate this would be by thinking about the following:
[[one,,three]split[,]]
This returns three results: one
, an empty value, and three
.
For even better illustration purposes, you could extend it a little bit:
[[one,,three]split[,]] :map[is[blank]then[(empty string)]else<currentTiddler>]
The above may be a little advanced, but it just replaces empty strings in the results with the value (empty string)
so that you can see them in the results. (Try copying and pasting it into the advanced search.)
With that in mind, it is important to note:
- Just as
[[some value]]
returns one result containing some value
, [[]]
returns one empty string result (not no results).
- As such,
[[]split[,]]
is not acting on no inputs. It is acting on one input - an empty string. And it has no commas to split on, so it returns the (empty string) input unchanged (just like any other string with no commas will be returned unchanged).
- As a special case,
split[]
returns one result for each character in the input. For example, [[test]split[]]
returns t
, e
, s
, and t
. However, the input for an empty string (the input to [[]split[]]
is an empty string, not no input) has no characters, and thus no results are returned.