Extended identifiers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Extended identifiers

George Hovey-2
I have encountered an idea, the "extended identifier," in the VHDL Hardware Description Language that might have some value in NetRexx.

In the few languages I know, there is little notion of substructure in an identifier.  The (modest) exception is the use of special characters like underscore as separators, and a handful of others for special system purposes.  But VHDL allows the use of ANY graphic ISO-8859-1 character in an identifier, if it is enclosed in slant bars, e.g. /category: name, type/.   Note that the first 256 code points of Unicode contain exactly the graphic characters of ISO-8859-1.

Of what use is this?  In VHDL I use 'category' to distinguish the two kinds of variable in that language; 'name' is the conventional problem-oriented name, and 'type' is a mnemonic for the variable's type, this last in my view essential for languages with strong typing.  The substructure can be emphasized with syntax-coloring editors like jEdit.

I employ a similar scheme in NetRexx, e.g. 'category_name_type' with 'category' being Property/method argument.  I can get jEdit to color these three fields independently; what I can't do is devise alternative coexisting identifier structures to bring out other relationships.  But with access to additional characters this would become possible.

--
"Everything should be as simple as possible, but not simpler." - Albert Einstein

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Extended identifiers

Kermit Kiser
Don't know if this helps but NetRexx also allows the dollar=$ and euro=€ (right ALT+5 on my keyboard in US international mode) characters in symbols. I don't recommend the $ character as NetRexx uses it internally and it causes problems in some places like class names (I think there is an open issue for that on Kenai).

-- Kermit

On 12/6/2012 9:12 AM, George Hovey wrote:
I have encountered an idea, the "extended identifier," in the VHDL Hardware Description Language that might have some value in NetRexx.

In the few languages I know, there is little notion of substructure in an identifier.  The (modest) exception is the use of special characters like underscore as separators, and a handful of others for special system purposes.  But VHDL allows the use of ANY graphic ISO-8859-1 character in an identifier, if it is enclosed in slant bars, e.g. /category: name, type/.   Note that the first 256 code points of Unicode contain exactly the graphic characters of ISO-8859-1.

Of what use is this?  In VHDL I use 'category' to distinguish the two kinds of variable in that language; 'name' is the conventional problem-oriented name, and 'type' is a mnemonic for the variable's type, this last in my view essential for languages with strong typing.  The substructure can be emphasized with syntax-coloring editors like jEdit.

I employ a similar scheme in NetRexx, e.g. 'category_name_type' with 'category' being Property/method argument.  I can get jEdit to color these three fields independently; what I can't do is devise alternative coexisting identifier structures to bring out other relationships.  But with access to additional characters this would become possible.

--
"Everything should be as simple as possible, but not simpler." - Albert Einstein


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Extended identifiers

George Hovey-2
Kermit,
I didn't mention it but I'm already using '$'; however, I didn't know it was reserved in any way.

I'm puzzled that the NetRexx 3 manual, under Tokens/Symbols says that

"Symbols are groups of characters selected from the Roman alphabet in uppercase or
lowercase (A–Z, a–z), the Arabic numerals (0–9), or the characters underscore, dollar,
and euro (“_$€”)."

This does not mention any special role for '$'.  Is this a documentation error?

On Fri, Dec 7, 2012 at 7:47 PM, Kermit Kiser <[hidden email]> wrote:
Don't know if this helps but NetRexx also allows the dollar=$ and euro=€ (right ALT+5 on my keyboard in US international mode) characters in symbols. I don't recommend the $ character as NetRexx uses it internally and it causes problems in some places like class names (I think there is an open issue for that on Kenai).

-- Kermit


On 12/6/2012 9:12 AM, George Hovey wrote:
I have encountered an idea, the "extended identifier," in the VHDL Hardware Description Language that might have some value in NetRexx.

In the few languages I know, there is little notion of substructure in an identifier.  The (modest) exception is the use of special characters like underscore as separators, and a handful of others for special system purposes.  But VHDL allows the use of ANY graphic ISO-8859-1 character in an identifier, if it is enclosed in slant bars, e.g. /category: name, type/.   Note that the first 256 code points of Unicode contain exactly the graphic characters of ISO-8859-1.

Of what use is this?  In VHDL I use 'category' to distinguish the two kinds of variable in that language; 'name' is the conventional problem-oriented name, and 'type' is a mnemonic for the variable's type, this last in my view essential for languages with strong typing.  The substructure can be emphasized with syntax-coloring editors like jEdit.

I employ a similar scheme in NetRexx, e.g. 'category_name_type' with 'category' being Property/method argument.  I can get jEdit to color these three fields independently; what I can't do is devise alternative coexisting identifier structures to bring out other relationships.  But with access to additional characters this would become possible.

--
"Everything should be as simple as possible, but not simpler." - Albert Einstein


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
"One can live magnificently in this world if one knows how to work and how to love."  --  Leo Tolstoy

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Extended identifiers

Mike Cowlishaw

 

I'm puzzled that the NetRexx 3 manual, under Tokens/Symbols says that

"Symbols are groups of characters selected from the Roman alphabet in uppercase or
lowercase (A–Z, a–z), the Arabic numerals (0–9), or the characters underscore, dollar,
and euro (“_$€”)."

This does not mention any special role for '$'.  Is this a documentation error?

Yes, it could be.  And my fault, if so :-(.  In NRL (the original book) only underscore is allowed.   The Supplement adds this change:
 
  Dollar sign in symbols
 
  The dollar sign character ('$') may now be used in
  symbols (for instance, variable names).  It is recommended that it only
  be used in mechanically generated programs or where otherwise essential.
 
 
(and also adds the Euro sign, with the same recommendation).   I should have included that recommendation (or a stronger one, perhaps) when I merged the Supplement into the base.
 
Clearly I felt it was by then safe to allow the use of dollar.  So, if it's not, that would be a separate (code) bug.  I forget where $ is used internally
 
Mike

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Extended identifiers

Kermit Kiser
It is either a code bug or a doc bug or both depending on perspective. If you look at the open bug issue on Kenai you can see some cases where it fails:

http://kenai.com/jira/browse/NETREXX-65

The $ symbol is used both in inner class names as per Java and for variables internally generated by the NetRexx compiler.

-- Kermit


On 12/9/2012 10:01 PM, Mike Cowlishaw wrote:
 

I'm puzzled that the NetRexx 3 manual, under Tokens/Symbols says that

"Symbols are groups of characters selected from the Roman alphabet in uppercase or
lowercase (A–Z, a–z), the Arabic numerals (0–9), or the characters underscore, dollar,
and euro (“_$€”)."

This does not mention any special role for '$'.  Is this a documentation error?

Yes, it could be.  And my fault, if so :-(.  In NRL (the original book) only underscore is allowed.   The Supplement adds this change:
 
  Dollar sign in symbols
 
  The dollar sign character ('$') may now be used in
  symbols (for instance, variable names).  It is recommended that it only
  be used in mechanically generated programs or where otherwise essential.
 
 
(and also adds the Euro sign, with the same recommendation).   I should have included that recommendation (or a stronger one, perhaps) when I merged the Supplement into the base.
 
Clearly I felt it was by then safe to allow the use of dollar.  So, if it's not, that would be a separate (code) bug.  I forget where $ is used internally
 
Mike


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/