[erlang-patches] Enhancement of erl_prettypr

Henrik Nord henrik@REDACTED
Tue Dec 4 11:58:50 CET 2012


Hi

We have decided to drop this patch.

we will also remove similar behaviour from erl_pp (which is the OTP 
equivalent to erl_prettypr), It does the wrong thing, and it does it in 
the wrong way at this moment.



Thank you for your contribution!



On 10/16/2012 06:23 PM, Serge Aleynikov wrote:
> Enhancement of erl_prettypr to print binaries in human-readable form.
>
> 	git fetch git@REDACTED:saleyn/otp.git erl_prettypr
>
> 	https://github.com/saleyn/otp/compare/erl_prettypr
> 	https://github.com/saleyn/otp/compare/erl_prettypr.patch
>
> Given an abstract syntax form of a binary, such as:
>
> 1> Form = erl_syntax:form_list(element(2, erl_parse:parse_exprs(
>     element(2, erl_scan:string(
>
> "<<84,104,105,115,32,105,115,32,97,32,98,105,110,97,114,121,10>>."))))).
>
> Before applying the patch the output of erl_prettypr:format/1 looks like
> this:
>
> 2> erl_prettypr:format(Form).
> "<<84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 98, 105,\n  110, 97,
> 114, 121, 10>>"
>
> After applying the patch the output looks like this:
>
> 3> erl_prettypr:format(Form).
> "<<\"This is a binary\\n\">>"
>
> The human-readable printing occurs only if erl_prettypr finds out that
> the binary represents a printable list.
>
> Regards,
>
> Serge
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches

-- 
/Henrik Nord Erlang/OTP




More information about the erlang-patches mailing list