Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Steve Reinhardt
I understood your code... when I said two functions I meant compare_versions() and compare_str_versions(). It's not a big deal; I just prefer this "runtime overloading" style to having multiple functions/interfaces that encode the arg type explicitly. I guess if you really want a concrete benefit

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Ali Saidi
I actually don't have two functions. There is compare_str_versions() and compare_versions(). The prior just does compare_versions(map(int,v1.slipt('.'), map(int,v2.split('.')) Perhaps isinstance is a little nicer. Ali On Apr 7, 2008, at 5:19 PM, Steve Reinhardt wrote: OK, this looks good

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Steve Reinhardt
OK, this looks good to me. Personally I'd skip having two compare_versions functions with the type in their name, and go with something like: def make_version_list(v): if isinstance(v, (list, tuple)): return v elif isinstance(v, str): return map(int, v.split('.')) else

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Steve Reinhardt
Oops, thought you were referring to the libelf/BATCH diff. I'll look at both of these later today :-). On Mon, Apr 7, 2008 at 10:41 AM, Steve Reinhardt <[EMAIL PROTECTED]> wrote: > I'm on the phone w/Kevin and have another phone mtg afterward... I > anticipate commenting when I have time to look

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Steve Reinhardt
I'm on the phone w/Kevin and have another phone mtg afterward... I anticipate commenting when I have time to look at them in a couple of hours. Steve On Mon, Apr 7, 2008 at 10:38 AM, Ali Saidi <[EMAIL PROTECTED]> wrote: > I didn't get any comments on this. > > Ali > > > On Apr 5, 2008, at 2:05 P

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-07 Thread Ali Saidi
I didn't get any comments on this. Ali On Apr 5, 2008, at 2:05 PM, Ali Saidi wrote: I moved some things around to make this work. Unfortunately, diff made the changset look a lot bigger than it really is. Ali On Apr 5, 2008, at 2:06 PM, Ali Saidi wrote: # HG changeset patch # User Ali Said

Re: [m5-dev] [PATCH] SCons version checking code

2008-04-05 Thread Ali Saidi
I moved some things around to make this work. Unfortunately, diff made the changset look a lot bigger than it really is. Ali On Apr 5, 2008, at 2:06 PM, Ali Saidi wrote: # HG changeset patch # User Ali Saidi <[EMAIL PROTECTED]> # Date 1207418753 14400 # Node ID 9866ed2a8ed2edb9f591f8abab2e462

[m5-dev] [PATCH] SCons version checking code

2008-04-05 Thread Ali Saidi
# HG changeset patch # User Ali Saidi <[EMAIL PROTECTED]> # Date 1207418753 14400 # Node ID 9866ed2a8ed2edb9f591f8abab2e4625ffb9dafa # Parent eca80b56f4fd5a92720415d49a7cf25a2de2122a [mq]: scons_ver.diff diff --git a/SConstruct b/SConstruct --- a/SConstruct +++ b/SConstruct @@ -65,6 +65,7 @@ i