![]() | ||
| Home | SwiftX Archive | SwiftForth Archive | |

We prefer '-'. Those underscores are inherited from the Freescale
documentation. We strive wherever possible to use their mnemonics for
register names. If we were making these names up, we would not use
underscores. Obviously, the Freescale names are intended for use with
languages that are much more restrictive in naming identifiers, so they're
pretty much stuck with the underscore.
> -----Original Message-----
> From: swiftx-bounce_at_forth.com
> [mailto:swiftx-bounce_at_forth.com] On Behalf Of Bulgrien, Dennis
> Sent: Thursday, August 18, 2005 09:36
> To: 'swiftx_at_forth.com'
> Subject: [swiftx] Identifier Use of _ vs -
>
> Conventionally, FORTH words use dash (-) rather than underscore (_).
> Perhaps the best reason is that it is easier to press, one
> key instead of a Shift sequence.
>
> I have seen underscore (_) used for constants. This makes
> reading code easier as a glace quickly identifies the
> difference between words that do something and ones that just
> return a literal. I like that. Now with the dawning of
> SwiftX MCF5484 it appears Forth Inc. is using this convention
> too:
> SwiftX\Src\ColdFire\Reg_5484.f:
> 258 0A00 REG: PODR_FBCTL
> 287 0A20 REG: PPDSDR_FBCTL
>
> If I were to create an EQU for a bit in a register there
> would be several choices for the name:
> %00000001 EQU UNITA_REGB_BITC
> %00000001 EQU UNITA-REGB-BITC
> %00000001 EQU UNITA.REGB.BITC
> or given that the register name is already chosen, it would
> be best to keep that name intact as the prefix...
> %00000001 EQU UNITA_REGB_BITC
> %00000001 EQU UNITA_REGB-BITC
> %00000001 EQU UNITA_REGB.BITC
> %00000001 EQU UNITA_REGB:BITC
> %00000001 EQU UNITA_REGB[BITC]
> etc.
>
> I currently favor UNITA_REGB_BITC because it is simple and
> can be represented in any other language too. What do you
> think about this "standard"?
>
> ----------------------------------------------------------------------
> swiftx_at_forth.com The SwiftX programming discussion email list
> To unsubscribe, send subject "unsubscribe" to
> swiftx-request_at_forth.com For list command help, send subject
> "help" to swiftx-request_at_forth.com Message archives are
> located at http://www.forth.com/archive/swiftx
> ----------------------------------------------------------------------
> This list is a forum for SwiftX users. For product support
> and bug reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Thu Aug 18 2005 - 11:01:16 PDT
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:50 PST