I just ran into a very serious problem.

Consider this:

        fun .. = "X<?1>(.. )"

This looks innocent. But consider:

        X<::std::size_t>

Looks ok? It isn't:

error: expected ‘<’ before ‘<:’ token

http://en.wikipedia.org/wiki/Digraph_%28computing%29

In 1994 a normative amendment to the C standard, included in C99, supplied 
digraphs as more readable alternatives to five of the trigraphs. They are:

Digraph Equivalent
<:      [
:>      ]
<%      {
%>      }
%:      #
Unlike trigraphs, digraphs are handled during tokenization, and any digraph 
must always represent a full token by itself, or compose the token %:%: 
replacing the preprocessor concatenation token ##. If a digraph sequence occurs 
inside another token, for example a quoted string, or a character constant, it 
will not be replaced.


So what to do? Put parens everywhere like this?

        <( ... )>

Well no, C/C++ is such a completely stupid language, this doesn't work:

template<class T> class X {};
int main() { 
        X<(int)> x; 
}

~/felix>clang++ -c x.cpp
x.cpp:5:10: error: expected expression
  X<(int)> x;

So the only alternative is to FORCE extra spaces *everywhere*.

        X< ?1 >


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to