[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Suggestion] Define t[[]] to index t with a long string
- From: Coda Highland <chighland@...>
- Date: Sat, 10 Oct 2015 22:40:15 -0700
On Sat, Oct 10, 2015 at 12:19 PM, Nagaev Boris <firstname.lastname@example.org> wrote:
> On Sat, Oct 10, 2015 at 7:10 AM, Coda Highland <email@example.com> wrote:
>> On Fri, Oct 9, 2015 at 9:09 PM, 书呆彭, Peng Yi <firstname.lastname@example.org> wrote:
>>> 在 2015/10/9 6:00, Soni L. 写道:
>>>> I sometimes don't want to escape strings (so that the human reader can
>>>> read them literally instead of trying to figure out the escapes), and adding
>>>> spaces around the long strings just doesn't look as good. t[[]] is
>>>> currently a syntax error and t[[======]] is currently a function call.
>>> if you were a C++ guy, you'd be very familiar with code such as (note the
>>> spaces between the '>'s):
>>> std::vector<std::pair<std::string, std::list<int> > > my_array;
>>> the spaces are needed to help the lexer's disambiguation.
>> That wart has been fixed in C++ for four years now.
>> /s/ Adam
> It was fixed in C++ because it is not ambigous for a programmer (not
> for a parser). The construction being discussed t[[]] is ambiguous
> for a programmer.
Oh, I know. The point is that the C++ example isn't particularly
applicable to the discussion at hand.