mikaelpatel / Arduino-Shell

RPN Postscript/Forth Command Shell for Arduino
19 stars 5 forks source link

Cleanup: Improve operation codes #28

Closed mikaelpatel closed 8 years ago

mikaelpatel commented 8 years ago

The operation codes for frames, parameters, variable lookup and escape could be more logical.

  1. "n$..-n$" could be "n...-n\".
  2. "n_" could then be "n$" which is RPN of shell parameters.
  3. "\name" would have to change to for instance "`name".
  4. "`" would change to "_".

The old syntax:

{2$2_@1_@-2};\swap!
3,4\swap:

would become:

{2\2$@1$@-2\};`swap!
3,4`swap:
mikaelpatel commented 8 years ago

Please see commit https://github.com/mikaelpatel/Arduino-Shell/commit/443398753d03ccc3b1d86c7badd89f67ec0436fe.

dpharris commented 8 years ago

! Can you call trap for any name not recognized? That argues for the :name and name:, say. On Mar 4, 2016 08:15, "Mikael Patel" notifications@github.com wrote:

Please see commit 4433987 https://github.com/mikaelpatel/Arduino-Shell/commit/443398753d03ccc3b1d86c7badd89f67ec0436fe.

— Reply to this email directly or view it on GitHub https://github.com/mikaelpatel/Arduino-Shell/issues/28#issuecomment-192340186 .

dpharris commented 8 years ago

... but that doesnt work, sorry, needs to be a prefix for the call. On Mar 4, 2016 09:04, "David Harris" drdpharris@gmail.com wrote:

! Can you call trap for any name not recognized? That argues for the :name and name:, say. On Mar 4, 2016 08:15, "Mikael Patel" notifications@github.com wrote:

Please see commit 4433987 https://github.com/mikaelpatel/Arduino-Shell/commit/443398753d03ccc3b1d86c7badd89f67ec0436fe.

— Reply to this email directly or view it on GitHub https://github.com/mikaelpatel/Arduino-Shell/issues/28#issuecomment-192340186 .

mikaelpatel commented 8 years ago

This is just an attempt to clean up the operation code (character) assignments and make the frame and parameter access more logical.

mikaelpatel commented 8 years ago

Some additional renaming; "b" => "c", "k" <=> "K", "y" => "Y". Please see commit https://github.com/mikaelpatel/Arduino-Shell/commit/c7b61e1b74fbe161a14b4d422983b8102b15a429.