Ah, that's where it comes from. It's based on the assumption that the
script is indented with tabs, and that the input does not start with any
tabs. I think both assumptions are not always valid. Or even rarily
valid if you look at Vim scripts.
> > Why not all white space? I suppose it's for things like this:
>
> Yes. This is for indenting the here document lines.
>
> >
> > func GetColors()
> > let colors =<< END
> > blue
> > red
> > green
> > END
> > return colors
> > endfunc
> >
> > This looks better:
> >
> > func GetColors()
> > let colors =<< trim END
> > blue
> > red
> > green
> > END
> > return colors
> > endfunc
> >
> > The "-" is cryptic, is this coming from another language? I would
> > prefer something easily understandable, like "trim".
>
> I wanted to keep it consistent with the shell script syntax. So I used "-".
> I can change it to "trim".
If we use "trim" then it's still similar to what bash does, but at the
same time we make clear that it's not exactly the same.
> > I would think that when "trim" is used, then the indent of the first
> > line is removed, and the same amount is removed from following lines.
> > And the marker must have less indent. This allows for:
>
> I will make this change to remove the same amount of indentation from
> all the lines in the here document as the first line.
Yeah, I think this works better, especially that it allows for indent in
the literal lines. Except for the first one.
--
Engineers will go without food and hygiene for days to solve a problem.
(Other times just because they forgot.)