On Thu, Jun 12, 2008 at 5:44 PM, nathan binkert <[EMAIL PROTECTED]> wrote:
>>> How about instead of Params.some_class the syntax would be
>>> Params(some_class) where Params is more like a class than a module? Then
>>> you could look up the information for the class you're dealing with
>>> without ever having to give it a globally consistent name.
>>
>> Seems reasonable to me... I don't remember why we went with the
>> current syntax instead of that... Nate?
>
> I'm not clear what exactly you're suggesting.  Do you mean like
> Param.String and Param.LiveProcess?  I'm missing some context or
> something.

I believe what Gabe is suggesting is switching e.g. Param.String(...)
to Param(String, ...).  This would make it trivial to support
parameters that reference objects in other modules, e.g.:
  Param(Foo.Bar.Baz, ...)
(not that it couldn't be done with the current structure, but it
wouldn't be so trivial).

I guess the question is whether the standard Python class name lookup
works for param types... the key thing we get with Param.String is
complete control over that process.

OK, after actually looking at the code, it's partially coming back to
me; with Param.Foo we defer the lookup of Foo until later, though I
still don't recall why that was necessary... perhaps to enable
circular references?  Is there a way to handle circular class
references in Python?

Steve
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to