I am somewhat ashamed to admit that I repeatedly used the #
character to comment out lines of my buspirate scripts. Ok, technically, these are just text files on the host that I copy/paste from… I’m not using the scripting functionality yet). Of course, that doesn’t comment out the line like I hope…
since the #
character is the command to reset the buspirate .
This began my search for way to enable scripts (and other command-line input) to have inline comments. I think this could also help with the documentation screencasts, such as having the chapter headers also shown as typed-in comments, as the chapter headings are not always clearly visible in the documentation playback.
Review of common programming language options:
Generally, it should avoid conflicting with the first character of any existing valid commands. This excludes the following characters:
aAbcdfFgGhilLmopPrstvVwW0-9@#$^(-_.:=~[]{}"/\
zZ
if added as global command to transition to HiZ mode
Not available
- Ada style
--
… bus syntax conflict (data high) - AppleScript
(*
… script selection conflict - C++
//
… bus syntax conflict (clock high) - C
/* .... */
… bus syntax conflict (clock high) - Haskell
{- ... -}
… bus syntax conflict (start 2) - Java
/** .... */
… bus syntax conflict (clock high) - Java
//
… bus syntax conflict (clock high) - LUA
--[[ ... ]]--
… bus syntax conflict (data high) - Nim
#
… resets the buspirate - Objective-C
//
… bus syntax conflict (clock high) - OCaml
(*
… script selection conflict (and nesting) - Pascal
(*
… script selection conflict (and nesting) - Perl
#
… resets the buspirate - PHP
#
… resets the buspirate - Python
#
… resets the buspirate - R
#
… resets the buspirate - Ruby
#
… resets the buspirate - Ruby
=begin
… numeric conversion conflict - SQL
--
… bus syntax conflict (data high) - Swift
//
… bus syntax conflict (clock high)
Available
- ColdFusion, XML, HTML each use
<!--- ... --!>
- but
>
is already used - might imply multi-line comment support (non-goal)
- but
- Fortran
C
- but lowercase
c
conflicts, so undesirable because it would mean case-sensitive commenting - also, Fortran knowledge is less common
- but lowercase
- MATLAB
%
- While
%
is not currently used, may want to keep this for future expansion of bus syntax?
- While
- BASIC and Windows command scripts
rem
- Conflicts with
r
bus syntax - But already have
rm
(storage) command … so possible? - Broadly understood to comment a single line
- Conflicts with
Recommendation
I thus propose that rem
be added as a global command.
UPDATE: Ian approved changing #
to be named reboot
, which will allow #
to comment out the remaining line of input.
The new rem
#
command might log the line (e.g., to log files and/or debugger), and is generally for documentation purposes only … no functional effects should rely on this command.
Thoughts?