[m-rev.] for review: fix an XXX: escape characters returned by deconstruct.functor/4

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Jun 9 01:08:04 AEST 2018



On Fri, 8 Jun 2018 10:05:19 -0400 (EDT), Julien Fischer <jfischer at opturion.com> wrote:
> Fix an XXX: escape characters returned by deconstruct.functor/4.

The diff is fine, except for a minor style issue.

> +        ( if escape_char_functor(Char, EscapedChar) then
> +            Functor = EscapedChar
> +        else
> +            Functor = string.from_char_list(['\'', Char, '\''])
> +        ),

I initially misread the code, and wondered what "escape_char_functor" does
that makes it unnecessary to put quotes around Char. I think you need
either a better name for that predicate (such as quote_special_escape_char)
or avoid the whole issue by inlining the disjunction into the condition.
(The code of the C version is essentially equivalent to the latter.)

Zoltan.


More information about the reviews mailing list