Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Idea for improvement of config_query_multi

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: flux <flux AT sourcemage.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] Idea for improvement of config_query_multi
  • Date: Thu, 3 Jun 2010 17:58:41 +0900

Jaka Kranjc (smgl AT lynxlynx.info) wrote [10.06.03 17:19]:
> This function is practically unused and not even in sorcery yet, so the api
> change wouldn't have a severe effect. Its implementation needs to be as
> clean
> and mantainable as possible or it will never get included
> (http://bugs.sourcemage.org/show_bug.cgi?id=12950).
>
> LP
> --
> We cannot command nature except by obeying her. --Sir Francis Bacon
> Have a sourcerous day! www.sourcemage.org

grep -l -r 'config_query_multi' $grimoire/* | grep 'CONFIGURE$' | wc -l

The above command shows that there are 45 spells (in the main grimoire,
I didn't run it for games, binary, etc.) that use this function, so it's
definitely not "unused" (though of course it's still a low number).
Additionally, the function call is described in the spell writing
handbook, along with an example of its use. Whether it's in sorcery or
not, it exists already and is in use, which is why I was concerned with
maintaining the current call syntax.

Maintainability of code is of course also a good idea. However, in this
case, since the bug you referenced is about duplicated code and not
about the final "form" of the output (i.e. the call syntax, which could
be handled via if statements or a switch, as mentioned in the bug), what
defines clean code here? Is there a requirement for a certain call
syntax? If so, what is it? Again, the other config_query_ calls do not
follow the call syntax of optional_depends, so I'm just wondering for
the purpose of merging what would win out (if we couldn't handle both).

I was more interested in "quick-fixing" this, since either way it went
it shouldn't involve much code against the current implementation. I
could probably also manage the merger, but that would take more time.
Would it be acceptable to quick-fix now with a guarantee of the merger
later, since whatever extra work would go into un-doing what I'd add now
would be done by me anyway? If that's acceptable, then I can assign the
aforementioned bug to myself.

--
Justin "flux_control" Boffemmyer
Cauldron wizard and general mage
Source Mage GNU/Linux
http://www.sourcemage.org

Attachment: pgpqD5G7yhnL1.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page