On Aug 23, 2005, at 20:28, Sam Ruby wrote:
Leopold Toetsch wrote:
I do agree with test-driven development. That is exactly the
approach I
took.
Well, I agree - until I see such tests (pyint_1):
$P2 = $P1.__abs__($P1)
Take a look at the difference between r7254 and r7312.
I just find a log message about the change w/o any reason.
I have always proposed (against Dan's opinion) the the object should be
passed as the first argument to methods. This is done now.
I've stated that the old MMD syntax, which needed to pass the existing
destination PMC is inappropriate, suboptimal and whatever for almost
all HLLs. Now you have a complete opcode subset that returns *new*
destination PMCs. http://xrl.us/g9dp
.pragma n_operators 1
...
$P0 = $P1 + $P2 # return new $P0 PMC
Here is a test I've written for pycomplex:
.pragma n_operators 1
.HLL "Python", "python_group"
.sub main @MAIN
.local pmc d, c
c = new .PyComplex
c = "3+4j"
d = abs c
print d
print "\n"
$S0 = typeof d
print $S0
print "\n"
.end
And *yes* that creates a new PyFloat. Please also not that python_group
is autoloaded.
Sam, please follow Parrot dev (or stop spreading FUD) - thanks.
The tests originally passed without a self argument. Then I was told
that that was all wrong, so I changed it (both the test and the code).
Please show me one message where you was told that abs has a signature
of that one in the test or that another 'self' should be passed in.
- Sam Ruby
leo