Re: [pypy-svn] r12855 - pypy/dist/pypy/rpython

Hi Eric, On Sat, May 28, 2005 at 12:25:07AM +0200, ericvrp@codespeak.net wrote:
As you just added casts between signed and unsigned in convert_from_to(), the _receive_may_cast() helper you define and use in this check-in should not be necessary -- indeed, the purpose of the original receive() is precisely to detect a mismatch between the actual and the requested type of the argument and generate a conversion if necessary, by calling convert_from_to(). Armin

Hi, (Oups! Wrong key. Sent an empty e-mail to pypy-dev, sorry...) On Sat, May 28, 2005 at 01:28:40PM +0200, Armin Rigo wrote:
By the way, don't spend more time on this right now; I think it's a good time to decide on a slightly less surprizing interface. Apart from the whole global-fetching idea, another confusing aspect is that the rtype_xyz() methods receive s_abc arguments that are not the main thing they operate on -- they usually operate on variables (v_abc) instead. So I am thinking about introducing a "high-level operation" concept and changing the signature of the rtype_xyz() methods: class __extend__(pairtype(SomeInteger, SomeInteger)): def rtype_add(_, hlop, llops): # ignore the (s_int1, s_int2) pair if hlop.s_result.unsigned: v1, v2 = hlop.convertinputs(Unsigned, Unsigned) v3 = llops.generate('uint_add', [v1, v2], resulttype=Unsigned) return v3 else: v1, v2 = hlop.convertinputs(Signed, Signed) v3 = llops.generate('int_add', [v1, v2], resulttype=Signed) return v3 Armin

Hi, On Sat, May 28, 2005 at 01:38:23PM +0200, Armin Rigo wrote:
So I am thinking about introducing a "high-level operation" concept and changing the signature of the rtype_xyz() methods:
Done. It's slightly clearer and a lot less magical now... I guess I left a host of typos behind me, especially in rint.py and rfloat.py. Sorry about that. (Tests! tests!) A bientot, Armin

Hi, (Oups! Wrong key. Sent an empty e-mail to pypy-dev, sorry...) On Sat, May 28, 2005 at 01:28:40PM +0200, Armin Rigo wrote:
By the way, don't spend more time on this right now; I think it's a good time to decide on a slightly less surprizing interface. Apart from the whole global-fetching idea, another confusing aspect is that the rtype_xyz() methods receive s_abc arguments that are not the main thing they operate on -- they usually operate on variables (v_abc) instead. So I am thinking about introducing a "high-level operation" concept and changing the signature of the rtype_xyz() methods: class __extend__(pairtype(SomeInteger, SomeInteger)): def rtype_add(_, hlop, llops): # ignore the (s_int1, s_int2) pair if hlop.s_result.unsigned: v1, v2 = hlop.convertinputs(Unsigned, Unsigned) v3 = llops.generate('uint_add', [v1, v2], resulttype=Unsigned) return v3 else: v1, v2 = hlop.convertinputs(Signed, Signed) v3 = llops.generate('int_add', [v1, v2], resulttype=Signed) return v3 Armin

Hi, On Sat, May 28, 2005 at 01:38:23PM +0200, Armin Rigo wrote:
So I am thinking about introducing a "high-level operation" concept and changing the signature of the rtype_xyz() methods:
Done. It's slightly clearer and a lot less magical now... I guess I left a host of typos behind me, especially in rint.py and rfloat.py. Sorry about that. (Tests! tests!) A bientot, Armin
participants (1)
-
Armin Rigo