#19580: use locals() in growth group factory
-------------------------------------+-------------------------------------
       Reporter:  dkrenn             |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.10
      Component:  asymptotic         |   Resolution:
  expansions                         |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:  Daniel Krenn       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  5f884c55e8c1e599f2d4fbc36112372903579511
  u/dkrenn/asy/locals                |     Stopgaps:
   Dependencies:  #19528             |
-------------------------------------+-------------------------------------

Comment (by nbruin):

 Would it be possible to just not do this? It's a strong indication of bad
 design if you end up parsing strings wrt. locals/globals dictionaries.
 Variable names do not belong in strings.

 You'll probably get scoping/shadowing in the different dictionaries wrong.
 E.g. what about
 {{{
 [GrowthGroup("n^Z") for Z in [1..10]]
 }}}
 and, subtly different,
 {{{
 list(GrowthGroup("n^Z") for Z in [1..10])
 }}}
 And what would
 {{{
 [GrowthGroup("n^Z") for n in [1..10] for Z in [1..10]]
 }}}
 do? I know: it probably gives errors because it's not passing the right
 values here, but what is different about n wrt. Z that one name needs to
 be looked up in a scope and the other doesn't?

 If you need a construction like this, then something along the lines
 {{{
 PreGrowthGroup("n")^Z
 }}}
 is probably much safer.

 You might want to check on sage-devel what the opinions of other
 developers are about letting local/global variable names sneak into
 strings.

--
Ticket URL: <http://trac.sagemath.org/ticket/19580#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to