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: [mg126035] Re: What characters are allowed in mathematica variable names? i.e. how
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Fri, 13 Apr 2012 04:53:01 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jm64l6$6lq$1@smc.vnet.net>

On Apr 12, 1: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?

No. The "solution" is camelCase: in multiWordNames,
capitalize the initial letter of each word except the first.
(If you capitalize the initial letter of the first word too
then your name may conflict with a built-in symbol.)



  • Prev by Date: computing derivatives and limits
  • Next by Date: Re: What characters are allowed in mathematica variable names? i.e. how
  • Previous by thread: Re: computing derivatives and limits
  • Next by thread: Re: What characters are allowed in mathematica variable names? i.e. how