Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: What characters are allowed in mathematica variable names? i.e. how

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126030] Re: What characters are allowed in mathematica variable names? i.e. how
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Fri, 13 Apr 2012 04:51:16 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jm64l6$6lq$1@smc.vnet.net>

For your main issue -- how to make your variables readable -- simply
use camel case: I.e.,

myFirstVariable or MyFirstVariable.  However, remember that
Mathematica uses camel case for all of its parameters, with the key
convention that all of them begin with a capital character.  So, if
you begin yours with a lowercase character you will not encounter name
conflicts.  If you do start with an Uppercase character then you need
to be careful that you are not encountering such conflicts.

--David


On Apr 12, 4:44 am, Jesse Perla <jessepe... at gmail.com> wrote:
> In other languages like C++, _ is a kosher character to be in variable names.  It is not in mathematica, so things like "my_first_variable" don't work.  I have been using a ` to separate out the words to get things like my`first`variable, but now realize it is creating other issues due to the scoping it introduces.
>
> Are there are other characters I can use to separate out words in variable names?
>
> Thanks




  • Prev by Date: Re: Replace a vertical line in ListPlot
  • Next by Date: Re: Replace a vertical line in ListPlot
  • Previous by thread: Re: What characters are allowed in mathematica variable names? i.e. how
  • Next by thread: Re: What characters are allowed in mathematica variable names? i.e. how