unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* extracting serial repeats
@ 2010-01-23 16:01 Andreas Roehler
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Roehler @ 2010-01-23 16:01 UTC (permalink / raw)
  To: help-gnu-emacs

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/






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-24 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.74.1264262438.14305.help-gnu-emacs@gnu.org>
2010-01-23 20:00 ` extracting serial repeats Anselm Helbig
2010-01-24  9:14   ` Andreas Röhler
     [not found]   ` <mailman.95.1264324380.14305.help-gnu-emacs@gnu.org>
2010-01-24 10:17     ` Anselm Helbig
2010-01-24 11:42       ` Andreas Röhler
2010-01-23 16:01 Andreas Roehler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).