Topic: \e (was: Why's of C++ -- ...)
Author: Hyman Rosen <hymie@prolifics.com>
Date: 1999/09/29 Raw View
Pete Becker <petebecker@acm.org> writes:
> I didn't think it would be necessary to cross examine, but I don't see
> any other way to get around evasive answers. Under what circumstances
> will you use '\e' if its behavior is unspecified?
To write device control strings to control devices. I'm going to use
\e in string and character literals, and the runtime will send an ESC
to the output stream, exactly like I expect it to.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Pete Becker <petebecker@acm.org>
Date: 1999/09/27 Raw View
David R Tribble wrote:
>
> Pete Becker wrote:
> >
> > Jan Echternach wrote:
> > >
> > > Pete Becker <petebecker@acm.org> writes:
> > > > And what is the "intended behavior" of \e?
> > >
> > > Unspecified behaviour.
> >
> > So what will you do with it if you have it that you can't do now?
>
> Be able to write putchar('\e') and know that it will
> 1) compile on all (conforming) compilers, and
> 2) output an "escape" character (whatever that may be).
>
> I don't have either of those assurances now.
>
I didn't think it would be necessary to cross examine, but I don't see
any other way to get around evasive answers. Under what circumstances
will you use '\e' if its behavior is unspecified?
--
Pete Becker
Dinkumware, Ltd.
http://www.dinkumware.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: David R Tribble <david@tribble.com>
Date: 1999/09/25 Raw View
Pete Becker wrote:
>
> Jan Echternach wrote:
> >
> > Pete Becker <petebecker@acm.org> writes:
> > > And what is the "intended behavior" of \e?
> >
> > Unspecified behaviour.
>
> So what will you do with it if you have it that you can't do now?
Be able to write putchar('\e') and know that it will
1) compile on all (conforming) compilers, and
2) output an "escape" character (whatever that may be).
I don't have either of those assurances now.
-- David R. Tribble, david@tribble.com --
sizeof('\e') == sizeof('\n')
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: David R Tribble <david@tribble.com>
Date: 1999/09/25 Raw View
Clive D.W. Feather wrote:
[...]
> C has a different world view. In effect, what it says is
> something like:
> \b is the value which, if sent to a display device, would cause
> the active position to move backwards one place
> (this is not the actual wording, but I think it's the intent). In this
> world view, it's easy to define the existing escape codes, but what
> would you say for \e:
> \e is the value which, if sent to a display device, would cause
> ...
> What would you put instead of the ellipsis ?
... an implementation-defined effect.
You left out the parenthetical "name" that each escape sequence is
given in its description, which surely serves a purpose, if for
nothing else than to give a big hint to the implementor which
character code to use for each sequence. So, just as \n has a
parenthetical "(new line)", \e would have an "(escape)".
> Finally, I personally don't believe that \e is worth the effort.
This is a common reason given by the committee in the past for not
modifying the language or library. I don't happen to think it's a
satisfying reason, though.
> The commonest use of escape sequences is display control, and such
> sequences should be in data files, not code.
Fine, but what if you don't use data files?
Even applications that use data files sometimes use "escapes".
What you suppose terminfo translates the \E in its user-supplied *.ti
files into?
-- David R. Tribble, david@tribble.com --
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]