PATCH: provide pass-through value in bfd_elf_bfd_from_remote_memory

Jim Blandy jimb@redhat.com
Wed May 21 23:21:00 GMT 2003


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.



More information about the Binutils mailing list