#12446: Introduce user_globals
----------------------------------+------------------------
       Reporter:  schilly         |        Owner:  was
           Type:  defect          |       Status:  new
       Priority:  major           |    Milestone:  sage-6.6
      Component:  user interface  |   Resolution:
       Keywords:                  |    Merged in:
        Authors:  Jeroen Demeyer  |    Reviewers:
Report Upstream:  N/A             |  Work issues:
         Branch:                  |       Commit:
   Dependencies:                  |     Stopgaps:
----------------------------------+------------------------
Changes (by {'newvalue': u'Jeroen Demeyer', 'oldvalue': ''}):

 * author:   => Jeroen Demeyer
 * component:  cython => user interface
 * priority:  minor => major
 * milestone:  sage-6.4 => sage-6.6
 * owner:  jdemeyer => was


Old description:

> This is a quote from `cython_lambda`'s documentation:
>
> {{{
>         sage: a = 25
>         sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')
>         sage: f(10)  # known bug
>         24.455978889110629
>         sage: a = 50
>         sage: f(10)  # known bug
>         49.455978889110632
> }}}
>
> Executing this gives
> {{{
> sage: a = 25
> sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')
> sage: f(10)
> Traceback (most recent call last):
> ...
> KeyError: 'math'
> }}}

New description:

 We introduce a new feature: user globals. The idea is to store somewhere a
 dictionary with the user-space globals which can then be used to inject
 global variables.

 This ticket implements the framework for this and fixes this bug in
 `cython_lambda` as proof-of-concept:
 {{{
         sage: a = 25
         sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')
         sage: f(10)  # known bug
         24.455978889110629
         sage: a = 50
         sage: f(10)  # known bug
         49.455978889110632
 }}}

 Executing this gives
 {{{
 sage: a = 25
 sage: f = cython_lambda('double x', 'sage.math.sin(x) + sage.a')
 sage: f(10)
 Traceback (most recent call last):
 ...
 KeyError: 'math'
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/12446#comment:9>
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