Re: Suggestion for pretty_print()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Juergen Luethje wrote:
> the following code snippet:
> 
> }}}
<eucode>
> include misc.e
> constant text =
>                {
>                  "This is\tline 1.\n",
>                  "Here comes\tline 2.\n"
>                }
> pretty_print(1, text, {3})
> </eucode>
{{{

> 
> prints (Eu 2.5):
> {
>   {'T','h','i','s',' ','i','s',9,'l','i','n','e',' ','1','.',10},
>   {'H','e','r','e',' ','c','o','m','e','s',9,'l','i','n','e',' ','2','.',
> 10}
> }
> 
> But using the option {3}, pretty_print IMHO should output a string
> _whenever possible_. Of course sometimes it's not possible, but special
> characters that may be entered using a back-slash (as described in
> refman_2.htm#char), should be displayed by pretty_print() in the same
> way, and not cause an output as shown above. The output in this case
> should be identical to the data, i.e.
> {
>   "This is\tline 1.\n",
>   "Here comes\tline 2.\n"
> }

I guess that would make sense, since the programmer
who uses option 3 probably believes that all his data is string data. 
I'll include \t \n \r as "ASCII" characters for that option.
For the other options, low integers such as 9, 10, 13 would be
quite common, and I suspect would not be considered to be characters
in most cases.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu