This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: provide pass-through value in bfd_elf_bfd_from_remote_memory


Andrew Cagney <ac131313@redhat.com> writes:
> > Well, I'm more than happy to follow any existing convention.  But
> > where are there other pointers named 'context'?  As far as I can see,
> > there is no convention for naming these little pass-through pointers.
> 
> I know it has something - OBJ vis:
> 
> void
> bfd_map_over_sections PARAMS ((bfd *abfd,
>      void (*func) (bfd *abfd,
>      asection *sect,
>      PTR obj),
>      PTR obj));

Yeah... but I think "obj" is too vague to really suggest much about
how the pointer is being used.  There's a very specific pattern in use
here, and "obj" doesn't call that pattern out.

Ian Lance Taylor <ian@airs.com> writes:
> > Well, I'm more than happy to follow any existing convention.  But
> > where are there other pointers named 'context'?  As far as I can see,
> > there is no convention for naming these little pass-through pointers.
> 
> I sometimes use the name `closure'.

I like that a lot better.  Closures in functional languages are so
named exactly because they close over an environment, which is exactly
what's going on here.

I'll revise the patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]