[libre-riscv-dev] Change pspec to class hierarchy

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Jul 11 15:03:02 BST 2019


On Thursday, July 11, 2019, Jacob Lifshay <programmerjake at gmail.com> wrote:

> Any objections to my (or someone else) changing pspec (pipeline spec?)
> to a class hierarchy?


No problem at all, do make sure the unit tests work, make the introduction
of the new pspec class in one commit and its use in another.


I only used a dict because it's convenient.


>
> My reasoning is that extensive documentation can then be attached to
> the class definitions instead of not having a good location for the
> documentation as well as being able to just use pspec.width instead of
> pspec['width'] (for example), which allows for better auto-completion.


Makes sense to me.  It should be doable with a global search replace. I
typically use the "replace" command which bizarrely is in the debian mysql
client package, no idea why. It is easier than awk or sed.

I am back tomorrow I can do the g/s/r if you ptefer it will take me 5-10
mins , if you do the pspec class?



> changing to a class hierarchy also gives pspec more structure, which
> benefits readability.
>
>
Absutely.


> Jacob
>
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev at lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>


-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68


More information about the libre-riscv-dev mailing list