X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1085) Subject: Re: [geda-user] Translating SI notation to SPICE From: John Doty In-Reply-To: <20121211164745.2571082204BF@turkos.aspodata.se> Date: Thu, 13 Dec 2012 21:00:51 -0700 Message-Id: <0C056642-E3CE-4472-ABBE-FF1E7EB5F813@noqsi.com> References: <20121116030224 DOT 5c7750ee AT akka> <201211160225 DOT qAG2PrVD005630 AT envy DOT delorie DOT com> <20121116035513 DOT 14519 DOT qmail AT stuge DOT se> <201211160357 DOT qAG3vUXo017504 AT envy DOT delorie DOT com> <20121116041216 DOT 16057 DOT qmail AT stuge DOT se> <201211160428 DOT qAG4Sh3h018631 AT envy DOT delorie DOT com> <20121117163351 DOT 14988 DOT qmail AT stuge DOT se> <5C6FC5CD-A358-476D-A8CA-C9AF2E72A914 AT noqsi DOT com> <20121117185520 DOT 25698 DOT qmail AT stuge DOT se> <9C626D0F-7D63-4FBE-8D63-37A2FFAD96FE AT noqsi DOT com> <71EA2CF8-8F64-4A51-B7C4-5F26EE8F4088 AT noqsi DOT com> <20121119182107 DOT 98F08813BDB7 AT tu! r kos.aspodata.se> <4F02B9C0-5C7A-4C7B-A23C-C99285C4CFFB AT noqsi DOT com> <20121124171912 DOT D4F46813BDCB AT turkos DOT aspodata DOT se> <20121211080047 DOT 579C482204B7 AT turkos DOT aspodata DOT se> <20121211141724 DOT 0770382204BC AT turkos DOT aspodata DOT se> <20121211164745 DOT 2571082204BF AT turkos DOT aspodata DOT se> To: geda-user AT delorie DOT com X-Mailer: Apple Mail (2.1085) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id qBE40voS018463 Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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