Re: variable names

new topic     » goto parent     » topic index » view thread      » older message » newer message

Kat wrote:
> 
> 
> Not a priority, i know, but.....
> 
> Any chance of getting less restrictive variable names? I just got tripped up
> on 
> 
> sequence 404file
> a name is expected here
> 
> I know, everyone will say "so pick a name inside the Eu naming rules", but to
> be zooming along coding, and get tripped up by something so trivial, breaking
> train of thought, it's annoying beyond just typing a letter first, and the
> chosen
> name "404file" is sure self explanitory and quite readable.
> 
> This has been brought up before, but if someone is in that area of Eu source
> and has a spare minute or two, please reconsider it?
> 
> Kat

Hi Kat,

Someone said they didnt know any languages that allow a number as
first char of a var name, but my Scientific calculator does allow
that.
For example, in:
  12f=2
the var name "12f" is considered valid, and returns the value 2
when it's used later as would be expected.

One of the reasons for allowing this was to accomodate the times
when you want a variable declared such as:
  2pi=2*pi
so you dont have to keep typing "2*pi" every time you want 2pi
or declare it as "TwoPi" or whatever.
It sounds kinda strange, but it works out in the long run especially
since combinations of chars like that dont normally occur without
a multiplication sigh "*" in there.
The down side is that error correction is a little less enhanced,
because someone might make the mistake of typing "2pi" when they 
really meant "2*p" as in:
  p=123
  2p=456 --not equal to 2*p
  TP=2p  --do they want 2p or really want 2*p ???
If they make a mistake like this the error detection scheme wont
catch it but will silently assign 456 to TP rather than 246 to TP.

The working context is a little different here however, in that
when dealing with numbers like this people usually check over their
work anyway to make sure they didnt make a mistake in the calculations
where it would show up anyway.



Take care,
Al

E boa sorte com sua programacao Euphoria!


My bumper sticker: "I brake for LED's"

 From "Black Knight":
"I can live with losing the good fight,
 but i can not live without fighting it".
"Well on second thought, maybe not."

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu