Bertho, You are not ranting too much - at least for me. I value your insight into gcmc, as I am learning more and more about it.
I understand your concern about portability, and I think the changes you are contemplating for the "-i" switch will allow me to eliminate the literal G20 statement. So is it your recommendation that we *always* use units after all numeric values, even if we only plan to use, say, inches throughout a program? Tony -----Original Message----- From: Bertho Stultiens Sent: Sunday, November 17, 2013 5:23 AM To: Enhanced Machine Controller (EMC) Subject: Re: [Emc-users] gcmc - v1.1.1 On 11/16/2013 11:37 PM, Tony Zampini wrote: > The way I have been using GCMC is to not use any unit specifiers after > numbers. > This way, all I have to do is make sure I include G20 (program in inches) > at > the top, and everything is > treated as inches, since GCMC will not do any conversions when no explicit > units are > specified (am I correct, Bertho?) > > In my example, I failed to mention that I used G20 at the beginning of the > program. Yes, specifying no units at all will treat all measures as "none" and translate the values "as is" to the output. However, you must take extreme caution because some built-in functions will add units due to implicit conversions. I do not think that it is wise not to specify units because future versions of gcmc may interpret things differently (see below). > To clarify my previous email, I use the "literal" statement to > include the G20. I don't use the "-i" switch. So GCMC thinks its > working in mm, and by not using any explicit unit specifiers, no > conversions are done. Then when I run the gcode, all values are > treated as inches. Adding "literal" to the code is like specifying assembly-code in a C-program. It is non-portable as hell. It works fine for your use in a specific case, but may have side-effects as things evolve. The "-i" option was introduced to enable change of metric/imperial defaults. That was not implemented at first, but the new version *will* implement complete and throughout change of default. That change also covers the implicit conversions in built-in functions and therefore will no longre require you to insert a literal change of units. The reason for this change is that I want metric/imperial conversions to work transparant and correctly under all circumstances. Part of the reason for gcmc's existance is the automatic unit conversions and that should simply work. [if I rant to much here just ignore me :-] Not using explicit units in the source will result in interpretation differences, depending how you compile. This is a consequence of the grammar and design. However, it does not follow that you should exploit this exeptional case. At least not when you want something to be portable. It is fine to use/abuse for your own projects, but you should be careful and painfully aware that you are on thinner and thinner ice as gcmc evolves and time progresses. All that said, making "-i" work on the global default improves predictablility of the generated code and does not worsen the situation (until I get a brainfart that has burning side-effects). -- Greetings Bertho (disclaimers are disclaimed) ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users