On 2016-12-8 04:51 , René J.V. Bertin wrote:
On Wednesday December 07 2016 17:09:35 Brandon Allbery wrote:

Use a double quoted string and escape anything that needs it (but
specifically not those variables for which you need the current value).

I don't think that's going to make things much more readable, would it?

I did notice one sometimes has to do this with the variant description (variant foo 
description "bla bla") but

variant foo description "bla bla" "
        \variant \stuff \here \
"

doesn't really help (me).

Yes it does. (The variant's description is completely irrelevant to the problem though.) Your original example was:

{{{
set pythonversions {3.4 3.5}
foreach pdv ${pythonversions} {
    set pv [join [lrange [split ${pdv} .] 0 1] ""]
    # snip
    variant python${pv} description "Add bindings for Python ${pdv}" {
        depends_libs-append port:python${pv}
        # snip
    }
}
}}}

Changing that to this will solve the problem:
{{{
set pythonversions {3.4 3.5}
foreach pdv ${pythonversions} {
    set pv [join [lrange [split ${pdv} .] 0 1] ""]
    # snip
    variant python${pv} description "Add bindings for Python ${pdv}" "
        depends_libs-append port:python${pv}
        # snip
    "
}
}}}

That [adding global foo] would do a different wrong thing, specifically the one 
you originally
complained about.

I though Joshua's intention was to show that the two procedures print the last 
known value of foo, not that they complain about an unknown variable because 
they expect it in their local frame.

No, my intention was to show that the variable is not in the correct scope. Adding a global declaration would still illustrate that but in a less obvious way.

- Josh

Reply via email to