[pypy-dev] [pypy-svn] r44599 - in pypy/dist/pypy/lang/scheme: . test

Jakub Gustak jgustak at gmail.com
Thu Jun 28 17:11:40 CEST 2007


On 6/28/07, Carl Friedrich Bolz <cfbolz at gmx.de> wrote:
> Hi Jacub!
>
> 2007/6/28, jlg at codespeak.net <jlg at codespeak.net>:
> > Author: jlg
> > Date: Thu Jun 28 15:49:30 2007
> > New Revision: 44599
> >
> > Modified:
> >    pypy/dist/pypy/lang/scheme/TODO.txt
> >    pypy/dist/pypy/lang/scheme/object.py
> >    pypy/dist/pypy/lang/scheme/test/test_parser.py
> > Log:
> > RPython direction for object.py
> >
> > Modified: pypy/dist/pypy/lang/scheme/object.py
> > ==============================================================================
> > --- pypy/dist/pypy/lang/scheme/object.py        (original)
> > +++ pypy/dist/pypy/lang/scheme/object.py        Thu Jun 28 15:49:30 2007
> > @@ -139,10 +139,16 @@
> >          raise NotImplementedError
> >
> >  def add_lst(ctx, lst):
> > -    return apply_lst(ctx, lambda x, y: x + y, lst)
> > +    def adder(x, y):
> > +        return x + y
> > +
> > +    return apply_lst(ctx, adder, lst)
> >
> >  def mul_lst(ctx, lst):
> > -    return apply_lst(ctx, lambda x, y: x * y, lst)
> > +    def multiplier(x, y):
> > +        return x * y
> > +
> > +    return apply_lst(ctx, multiplier, lst)
> >
> >  def apply_lst(ctx, fun, lst):
> >      acc = None
> >
>
> This doesn't make mul_lst and add_lst any more rpython than before. In
> fact, lambda is fully rpython. The problem with this code is rather
> that you cannot have local functions in RPython.

I that case error messages from pylint:
E:142:add_lst.<lambda>: Using unavailable keyword 'lambda'
E:145:mul_lst.<lambda>: Using unavailable keyword 'lambda'

Causes only confusion.

> As I said, don't worry about making your code RPython too much yet.

I will try to refrain.

Cheers,
Jakub Gustak



More information about the Pypy-dev mailing list