[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
extracting serial repeats
From: |
Andreas Roehler |
Subject: |
extracting serial repeats |
Date: |
Sat, 23 Jan 2010 17:01:40 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
Hi,
let's consider the following pseudo-code, assumed inefficient, because
Functions 1..n are identic.
Function-1
(Body-of-Function-1)
Follow-action-1 with Function-1
Follow-action-2 with Function-1
Function-2
(Body-of-Function-2)
Follow-action-1 with Function-2
Follow-action-2 with Function-2
...
Function-n
(Body-of-Function-n)
Follow-action-1 with Function-n
Follow-action-2 with Function-n
More efficient seems, having
Body-of-Functions
extracted into a subroutine
so we could write something like
(dolist (element (1..n))
SUBROUTINE element
Follow-action-1 with element
Follow-action-2 with element
Question is: exists a known tool for the extraction resp. refactoring needed?
Thanks
Andreas
--
https://code.launchpad.net/s-x-emacs-werkstatt/
http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/
- extracting serial repeats,
Andreas Roehler <=