lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Nick Trout didn't think he'd be saying this, but:
> what about the way it works in Perl?

> e.g. <<END;

> I can put anything I want here until my own delimiter is met...

> END

Actually, I think this comes from the Unix shell, even before Perl. It
is also more or less the strategy used by MIME. However, it can also lead
to obscure errors, and it is difficult to implement reliably in a code
generator.

I would actually suggest something much simpler: leave --[[, [[ and ]] as 
they are, except
that they are only recognized if they are the first characters of a line, 
or perhaps
the first non-whitespace characters. 

That does not allow an "arbitrary" string, but it would certainly solve 
all of my
problems with accidental closing by a[b[j]]; I can probably remember not 
to
write that as:

a[b[
]]

:)

This would probably mean changing the semantics of long strings [[ ]] yet 
again,
so that both the first and the last line end are deleted. Oh, well.