Mail Archives: geda-user/2012/12/13/23:02:27
On Dec 11, 2012, at 9:47 AM, Karl Hammar wrote:
>>
>> What if someone actually wants to write km/s as in kilo meters per second?
>
> Yes, I don't see any problem with that. I consists of "km" "/" and "s",
> where "km" consists of the prefix "k" and the unit "m". It is legal
> accordig to the rules-to-be above. What problem do you see with it ?
>
> BTW, it doesn't matter much what you and I thinks about this. The one
> who writes the parser usually decides. Are you volunteering?
It may be worth noting here that in the SPICE context, the issue isn't the units themselves, but the prefixes. To SPICE, the units are merely comments. Of course, a general convention would be desirable, but I don't want to hold practical SPICE netlisting hostage to an impossible problem.
To me, a more serious problem is the ambiguity between SPICE units and SI units. What does 1m mean? I personally have many symbols with SPICE units. And then, something like a filename might resemble an SI value, so I wouldn't want to translate units willy-nilly.
In gnet-spice-noqsi, SPICE code is generated from prototypes through a simple-minded macro expansion process. The macro "attr AT default" expands to the value of attribute "attr" (for positional parameters), while "attr=default" expands to the whole "attr=value" string (for named parameters). The "default" is optional in both cases, and I find myself rarely using it.
I'm thinking of using different key characters to indicate translation from SI. So, "attr&unit" would be for SI positional parameters, and attr:unit would be for SI named parameters. This would force the user to state units in the prototype, which makes sense because the units for SPICE parameters are fixed. Thus, the parser would only need to parse out the prefix, and could check the correctness of the units.
John Doty Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com
- Raw text -