Re: How about colors and terminal graphics in std.format?

2012-03-13 Thread Christian Manning
On Tuesday, 13 March 2012 at 16:05:31 UTC, Jacob Carlborg wrote: On 2012-03-13 13:31, Christian Manning wrote: On Tuesday, 13 March 2012 at 07:45:19 UTC, Jacob Carlborg wrote: On 2012-03-13 02:36, Christian Manning wrote: It would be great if an std.terminal contained general stuff for manipu

Re: How about colors and terminal graphics in std.format?

2012-03-13 Thread Jacob Carlborg
On 2012-03-13 13:31, Christian Manning wrote: On Tuesday, 13 March 2012 at 07:45:19 UTC, Jacob Carlborg wrote: On 2012-03-13 02:36, Christian Manning wrote: It would be great if an std.terminal contained general stuff for manipulating/querying a terminal portably, as well as colour output, eg.

Re: How about colors and terminal graphics in std.format?

2012-03-13 Thread Christian Manning
On Tuesday, 13 March 2012 at 07:45:19 UTC, Jacob Carlborg wrote: On 2012-03-13 02:36, Christian Manning wrote: It would be great if an std.terminal contained general stuff for manipulating/querying a terminal portably, as well as colour output, eg. get terminal size, move cursor around, erase

Re: How about colors and terminal graphics in std.format?

2012-03-13 Thread Jacob Carlborg
On 2012-03-13 02:36, Christian Manning wrote: It would be great if an std.terminal contained general stuff for manipulating/querying a terminal portably, as well as colour output, eg. get terminal size, move cursor around, erase line... just things to help with building UIs, progress bars, etc.

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread James Miller
On 13 March 2012 18:50, Chad J wrote: > On 03/13/2012 01:41 AM, James Miller wrote: >> >> On 13 March 2012 18:24, Chad J  wrote: >>> >>> I'm not sure I agree with resetting to a default color.  What if I want >>> to >>> >>> write to the stream without altering the terminal's graphics settings? >>

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/13/2012 01:34 AM, H. S. Teoh wrote: On Tue, Mar 13, 2012 at 03:17:42PM +1300, James Miller wrote: On 13 March 2012 15:17, H. S. Teoh wrote: We could start off with said module just doing colors for now, and then gradually add more stuff to it later. We could end up at a D-flavoured ncu

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/13/2012 01:41 AM, James Miller wrote: On 13 March 2012 18:24, Chad J wrote: I'm not sure I agree with resetting to a default color. What if I want to write to the stream without altering the terminal's graphics settings? Actually, I meant more to make sure that any output is reset to t

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread James Miller
On 13 March 2012 18:24, Chad J wrote: > I'm not sure I agree with resetting to a default color.  What if I want to > write to the stream without altering the terminal's graphics settings? Actually, I meant more to make sure that any output is reset to the terminal's default. I'm pretty sure there

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Sean Cavanaugh
On 3/12/2012 10:58 PM, Chad J wrote: On 03/12/2012 10:37 PM, James Miller wrote: I do want to be able to format things besides color with the color formatting function. Maybe I can pick out the color format specifiers first and then pass the rest to format. It'd be a shame to reimplement format.

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread H. S. Teoh
On Tue, Mar 13, 2012 at 03:17:42PM +1300, James Miller wrote: > On 13 March 2012 15:17, H. S. Teoh wrote: > > We could start off with said module just doing colors for now, and > > then gradually add more stuff to it later. > > We could end up at a D-flavoured ncurses library! [...] That would b

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/13/2012 12:15 AM, James Miller wrote: On 13 March 2012 16:58, Chad J wrote: On 03/12/2012 10:37 PM, James Miller wrote: I think the problem with putting it into formatting is that it is inherently not output. IOW formatting should go anywhere, but colored output is terminal-only. Also

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread James Miller
On 13 March 2012 16:58, Chad J wrote: > On 03/12/2012 10:37 PM, James Miller wrote: >> >> >> I think the problem with putting it into formatting is that it is >> inherently not output. IOW formatting should go anywhere, but colored >> output is terminal-only. >> >> Also, there are differences betw

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/12/2012 11:58 PM, Chad J wrote: On 03/12/2012 10:37 PM, James Miller wrote: I think the problem with putting it into formatting is that it is inherently not output. IOW formatting should go anywhere, but colored output is terminal-only. Also, there are differences between terminals and a

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/12/2012 10:37 PM, James Miller wrote: I think the problem with putting it into formatting is that it is inherently not output. IOW formatting should go anywhere, but colored output is terminal-only. Also, there are differences between terminals and all sorts of crap that just make this ha

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/12/2012 07:51 PM, Damian Ziemba wrote: On Monday, 12 March 2012 at 03:32:26 UTC, Chad J wrote: On 03/11/2012 11:27 PM, Damian Ziemba wrote: On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread James Miller
On 13 March 2012 15:20, Chad J wrote: > On 03/12/2012 11:02 AM, H. S. Teoh wrote: >> >> On Mon, Mar 12, 2012 at 10:51:08AM +0100, Jacob Carlborg wrote: >>> >>> On 2012-03-12 03:16, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/12/2012 11:02 AM, H. S. Teoh wrote: On Mon, Mar 12, 2012 at 10:51:08AM +0100, Jacob Carlborg wrote: On 2012-03-12 03:16, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in th

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread James Miller
On 13 March 2012 15:17, H. S. Teoh wrote: > We could start off with said module just doing colors for now, and then > gradually add more stuff to it later. We could end up at a D-flavoured ncurses library! -- James Miller

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread H. S. Teoh
On Tue, Mar 13, 2012 at 03:02:27AM +0100, Christian Manning wrote: > On Tuesday, 13 March 2012 at 01:53:11 UTC, Chad J wrote: > >On 03/12/2012 09:36 PM, Christian Manning wrote: > >>On Monday, 12 March 2012 at 09:51:08 UTC, Jacob Carlborg wrote: > >>> > >>>I think it would nice to have, but not in

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Christian Manning
On Tuesday, 13 March 2012 at 01:53:11 UTC, Chad J wrote: On 03/12/2012 09:36 PM, Christian Manning wrote: On Monday, 12 March 2012 at 09:51:08 UTC, Jacob Carlborg wrote: I think it would nice to have, but not in std.format. std.terminal or similar would be better. It would be great if an s

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Chad J
On 03/12/2012 09:36 PM, Christian Manning wrote: On Monday, 12 March 2012 at 09:51:08 UTC, Jacob Carlborg wrote: I think it would nice to have, but not in std.format. std.terminal or similar would be better. It would be great if an std.terminal contained general stuff for manipulating/queryin

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Christian Manning
On Monday, 12 March 2012 at 09:51:08 UTC, Jacob Carlborg wrote: On 2012-03-12 03:16, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking somet

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Damian Ziemba
On Tuesday, 13 March 2012 at 00:24:58 UTC, Kevin Cox wrote: On Mar 12, 2012 7:55 PM, "Damian Ziemba" wrote And yea, I think like others that it should have its own module like std.terminal/std.console or maybe somekind of spot in std.stdio. Python has a great lib for this. I can't remember w

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Kevin Cox
On Mar 12, 2012 7:55 PM, "Damian Ziemba" wrote > And yea, I think like others that it should have its own module like std.terminal/std.console or maybe somekind of spot in std.stdio. Python has a great lib for this. I can't remember what package it is in but it has things like isTty() and all of

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Damian Ziemba
On Monday, 12 March 2012 at 03:32:26 UTC, Chad J wrote: On 03/11/2012 11:27 PM, Damian Ziemba wrote: On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for so

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread H. S. Teoh
On Mon, Mar 12, 2012 at 10:51:08AM +0100, Jacob Carlborg wrote: > On 2012-03-12 03:16, Chad J wrote: > >I remember doing colored terminal output in Python. It was pretty > >nifty, and allows for some slick CLI design. I think D can do better > >by putting it in the standard library. > > > >I was th

Re: How about colors and terminal graphics in std.format?

2012-03-12 Thread Jacob Carlborg
On 2012-03-12 03:16, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the lines of this: http://www.chadjoan.com/d/dmd.2.058/h

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread H. S. Teoh
On Sun, Mar 11, 2012 at 10:16:06PM -0400, Chad J wrote: [...] > Oh, on an unrelated note, Phobos' documentation make target is quite broken: > blahblah/dmd.git/src/phobos $ make -fposix.mak html > make: *** No rule to make target > `../web/phobos-prerelease/index.html', needed by `html'. Stop. [..

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Adam D. Ruppe
On Monday, 12 March 2012 at 03:28:40 UTC, Chad J wrote: I was kind of intending to /not/ do that, for exactly the reasons you mention. ASCII escape sequences should work anyways. I don't think anyone will panic if I waste a byte or two for every 3+ on fairly rare coloring/gfx operations. And

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Adam D. Ruppe
On Monday, 12 March 2012 at 03:30:09 UTC, Damian Ziemba wrote: Those numbers are for Windows btw :p It is also the way the VGA hardware works... and it is actually a really simple bitfield for a four bit color. The attributes are a ubyte like so: back_fore lrgb_lrgb where l is a bit meaning

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Damian Ziemba
On Monday, 12 March 2012 at 03:32:26 UTC, Chad J wrote: On 03/11/2012 11:27 PM, Damian Ziemba wrote: On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for so

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread James Miller
On 12 March 2012 16:15, Chad J wrote: > On 03/11/2012 10:52 PM, Andrei Alexandrescu wrote: >> >> On 3/11/12 9:16 PM, Chad J wrote: >>> >>> I remember doing colored terminal output in Python. It was pretty nifty, >>> and allows for some slick CLI design. I think D can do better by putting >>> it in

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Damian Ziemba
On Monday, 12 March 2012 at 03:27:41 UTC, Damian Ziemba wrote: On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do b

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Chad J
On 03/11/2012 11:27 PM, Damian Ziemba wrote: On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting i

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Damian Ziemba
On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking s

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Chad J
On 03/11/2012 11:05 PM, Adam D. Ruppe wrote: One concern I have with this is format() creates a string, which isn't necessarily output; color is a thing of output. The unix implementation will use the ansi escape sequences, surely, which isn't correct almost anywhere else. I was kind of inten

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Chad J
On 03/11/2012 10:52 PM, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the l

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Adam D. Ruppe
One concern I have with this is format() creates a string, which isn't necessarily output; color is a thing of output. The unix implementation will use the ansi escape sequences, surely, which isn't correct almost anywhere else. Of course, you could choose to not use these special specifiers, an

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Mantis
12.03.2012 4:16, Chad J пишет: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the lines of this: http://www.chadjoan.com/d/dmd.2.058/htm

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Alex Rønne Petersen
On 12-03-2012 03:52, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the line

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Damian Ziemba
On Monday, 12 March 2012 at 02:52:15 UTC, Andrei Alexandrescu wrote: On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking s

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Andrei Alexandrescu
On 3/11/12 9:16 PM, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the lines of this: http://www.chadjoan.com/d/dmd.2.058/ht

Re: How about colors and terminal graphics in std.format?

2012-03-11 Thread Alex Rønne Petersen
On 12-03-2012 03:16, Chad J wrote: I remember doing colored terminal output in Python. It was pretty nifty, and allows for some slick CLI design. I think D can do better by putting it in the standard library. I was thinking something along the lines of this: http://www.chadjoan.com/d/dmd.2.058/h