Thanks. 

Using a letter prefix was the first thing I did. Code looked like A.A11, 
and so on; so not really good looking. 

The only reasons to use subscripts rather than standard digits would be 
that for the former you do not need prefixes, so it is a bit cleaner. 
However, using subscripts like \_1, etc,  for field/variables is not 
currently allowed. Worth opening an issue?


On Tuesday, May 10, 2016 at 10:29:27 AM UTC+1, Milan Bouchet-Valat wrote:
>
> Le mardi 10 mai 2016 à 01:56 -0700, Davide Lasagna a écrit : 
> > Hi,  
> > 
> > I have a custom type representing a bordered matrix (a big square 
> > matrix, bordered by two vectors and a scalar in the bottom right 
> > corner), where the four blocks are stored in separated chunks of 
> > memory. I would like to call the fields of my type using subscripts 
> > \_1\_1, \_1\_2, ... so that I can nicely access them as A.11, A.12, 
> > ... However, it seems that subscripts (and superscripts) with digits 
> > can't be used for variable names, resulting in a syntax error. 
> >  Subscripts with letters work fine.  
> > 
> > Any thoughts on this? 
> All identifiers must start with a letter. So you could call them A.c₁₁ 
> or A.c11, etc. 
>
> Maybe this rule could be loosened a bit, since subscripts are never 
> parsed as actual numbers. OTOH, I'm not sure using subscripts is really 
> better than using standard digits with a letter prefix. 
>
>
> Regards 
>

Reply via email to