API names [was: ghc-6.0.1 and OpenGL enabled]

Sven Panne <[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <[email protected]>
Thanks for all your replies, naming is obviously still one of the hottest
topics in CS...     Here are my thoughts: "locally" is (as already
mentioned) too general, and "withFoo" is traditionally used for functions
with a signature of the form:

    withFoo :: Foo -> ...

But the current matrix is implicit, so this would not be a good choice for
the combination of glPushMatrix/glPopMatrix. We are basically left with:

    saveFoo          might not give a hint that a Foo is restored
    rememberingFoo   same comment as above applies
    preservingFoo    sounds good to me, but might be a bit long

The current story for the combined GL calls is:

    glBegin/glEnd                          renderPrimitive
    glNewList/glEndList                    defineList
    glPushName/glPopName                   pushName
    glPushMatrix/glPopMatrix               matrixExcursion
    glPushAttrib/glPopAttrib               saveServerState
    glPushClientAttrib/glPopClientAttrib   saveClientState

The first two sound right to me, the third is actually a "withFoo", and
the last three should be named in a consistent way. Combining your proposals
I suggest:

    glBegin/glEnd                          renderPrimitive
    glNewList/glEndList                    defineList
    glPushName/glPopName                   withName
    glPushMatrix/glPopMatrix               preservingMatrix
    glPushAttrib/glPopAttrib               preservingAttrib
    glPushClientAttrib/glPopClientAttrib   preservingClientAttrib

Does this sound OK, especially for the native speakers on this list?

Cheers,
    S.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.