Re: Lisp Design Patterns



On 2008-09-27, Barry Margolin <barmar@xxxxxxxxxxxx> wrote:
I also had a similar reaction when I first saw the C++ STL. While
there's some elegance to the way they abstracted things in a fully
orthogonal way, you can hardly see it through all the C++ template
garbage. Those are the same people who ridiculed Lisp for years because
of Lots of Irritating Silly Parentheses, but their <...> stuff is just
as bad; worse, in fact, because the stuff between the angle brackets is
too convoluted.

Not to mention that they can't figure out basic parsing, vis the infamous >>
problem with closing parentheses (remember that >> is the right shift operator
token, lexically analyzed as a single token).

Various ugly workarounds were proposed for this, but it appears that as of the
2003 standard, nothing has been done about it.

But even the lone < and > are problematic, which is why the C++ standard
contains entertaining text like:

``When parsing a temlate-id, the first non nested > (footnote 127)
is taken as the end of the template-argument-list rather than
a greater-than operator: [ Example:

template<int i> class X { /* ... */ };

X< 1>2 > x1; // syntax error
X<(1>2)> x2; // OK

template<class T> class Y { /* ... */ };
Y< X<1> > x3; // OK
Y<X<6>> 1> > x4; // OK: Y< X< (6>>1) > >

---end example]

Footnote 127: A > that encloses the type-id of a dynamic_cast, static_cast,
reinterpret_cast or const_cast, or which encloses the template-arguments of a
subsequent template-id, is considered nested for the purpose of this
description.

:)
.



Relevant Pages

  • Re: Tutorial for CComPtr and CComQIPtr
    ... Apologies for confusing the topic with the mention of "garbage ... pointer" and the "Smart pointer". ... The template class Ptrimplements a garbage collecting pointer to any ... class derived from RefCount. ...
    (microsoft.public.vc.atl)
  • RE: Text turns to garbage on screen when I send document to printer
    ... I was filling out a template that I use all the time but today, ... It looks like the letters are ... It seems like a formatting issue because if ... I copy the the garbage to another doc, it comes up the way I originally typed ...
    (microsoft.public.word.application.errors)
  • Re: Need to delete multiple styles starting with same two characs?
    ... I think yr template is clean, but users have garbage in their normal.dot ... I'm trying to write a macro in Word 2000 that will delete 20 odd ... styles that start with the letters CS as I've recreated the template, ...
    (microsoft.public.word.vba.general)

Loading