[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tue, 2009-07-28 at 13:52 -0700, Chris Robinson wrote:
> On Tuesday 28 July 2009 10:28:21 am Elias Pschernig wrote:
> > I'm also wondering about the parameter order in cases like this:
> >
> > al_attach_stream_to_mixer(mixer, stream)
> >
> > Wouldn't al_attach_stream_to_mixer(stream, mixer), i.e. the same
> > parameter order as in the function name, make more sense?
>
> The original idea was to put the target (object being acted on) as the first
> parameter, ie. the mixer is being modified to have a stream attached. This
> behavior would mirror C++ where the 'this' pointer would typically be a hidden
> first parameter.
>
Yes, and the name of the function was al_mixer_attach_stream. I always
got the order right then.
But now with the new name, we have the verb "attach to", which has as
its first object *what* to attach, and then the *to what* to attach it
to. The parameter order therefore appears swapped to me.
--
Elias Pschernig <elias@xxxxxxxxxx>