[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: gschem symbol search order



El sÃb, 16-12-2006 a las 09:50 +0100, Patrick Bernaud escribiÃ:
> Carlos Nieves Ãnega writes:
[snip]
>  > Here are the reasons:
>  >  - All the existing code asserts that the first node returned by
>  > s_clib_search_basename is the first entry to be used. This makes
>  > sense.
> 
> The way it was done the list returned by s_clib_search_basename() was
> in the same order as the directories. It seems logival. They are not
> anymore. The least you can do is add a note for this fact.
> 
>  >  - It also makes sense to change the search function instead of changing
>  > every function calling it.
> 
> The existing code is wrong. The very problem is that the code you are
> mentionning is repeated every where in the code. 

It seems we have different views about this function:
 - You think it should return a list of directories containing the given
symbol's name. The first entry is the first directory added to the
library, thus the first directory the applications should look is the
last one of the list.
 - I also thought it should return a list of directories containing the
given symbol's name, but ordered so the first entry is the first entry
the applications should look into (thus the last directory added).

s_clib_search_basename's documentation tells nothing about this. So
what's the right order?

> There should be a function that specifically call the
> s_clib_search_basename() function and take the first (or last in my
> view) of the returned value. 
> 
> It should also be responsible for the message informing the user of
> more than one symbol with that name.
> 
> Ideally it should also take care of asking the user if choosing this
> symbol is correct. This has previously been discussed here.
> 
> Not only it would have fixed the code and introduced possible future
> enhancements but it would have improved the overall quality of the
> project.

I agree, assuming the user message is generated by the application.
However, it is outside the goals of the patch we are talking about.

>  >  - I like to use a double-linked list whenever I need to go forward and
>  > backwards in a list.
> 
> There is no need to go backwards on this list.

Or s_clib_search_basename is searching backwards, or the application
should look for the symbol backwards in the list returned by
s_clib_search_basename...

Regards,

Carlos



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user