[Tutor] running a script from IDLE

Kirby Urner urnerk@qwest.net
Mon, 11 Mar 2002 11:22:55 -0800


>
>But you don't need to do that in FP (OK some would say you
>do but most pragmatic FP'ers don't). you just pass in the
>reference and return the same reference.

OK, this makes sense:

    newicosa = rotate(icosa,angle,degrees)

will be a destructive operation on icosa, in the sense
that its state will change.

It's the same as going

    def rotate(icosa,angle,degrees):
        icosa.rotate(icosa,angle,degrees)
        return icosa

...which I think was your original point.  I was just
getting hung up on that fact that object methods needn't
return self or anything at all, hence the FP "wrapper"
above, making sure that you get an object back.

Then you could write:

    newicosa = rotate(icosa,angle,degrees)

no problem.

Kirby