ewx: (geek)
[personal profile] ewx

From time to time I and colleagues find ourselves extending some function in C in a way that requires extra arguments. Often this happens in a context where it's impractical to change all the callers (for instance, because some of them are in customer code) so the extended version of the function gets a new name and the original name just calls that with some default value of the new arguments.

For instance I might go from this:

int refine_glorp(glorp *g) {
  /* refinement */
}

…to this:

int refine_glorp(glorp *g) {
  return refine_glorp_ex(g, 0);
}

int refine_glorp_ex(glorp *g, int arg) {
  /* extended refinement, based on arg */
}

Is there a well-known name for this transformation?

A colleague who did this a week or so ago started out with 'decapitation' but changed his mind to 'recapitation' on the grounds that he was really adding a second head to the function rather than removing one. But neither of us knew if there was already a name for this.

(no subject)

Date: 2015-11-09 08:13 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Partial deapplication, then?

(no subject)

Date: 2015-11-09 08:21 pm (UTC)
From: [identity profile] krabbe.livejournal.com
According to a dictionary I found on the Internet (http://dictionary.reference.com/browse/ap-), the "ap" prefix is related to "apo-", as in "aphelion". So it'd be a partial function periplication? Or, going with the more mundane "ad-" source, a partial explication?

Language makes sense, right?

(no subject)

Date: 2015-11-09 08:28 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
I like partial periplication l-)

(OED thinks application is ap- from ad- + p rather than the apo- version, but why would anyone let that get in the way?)

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags