Re: Initializing variables on declarations

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

Most of the examples show a constant assigned in initialization on declaration.
Would it complicate matters to make it the rule that only constants or constant
expressions are allowed?

Legal:
integer x = 5
atom y = 3.1415927 * 8 * 8
sequence foo = {65, 66, "C"}


Illegal:
integer y = x + 320 * v
sequence foo = {bar, baz, zoo}


Of course then you get to the point whether the identifier of a constant could
be used...

Just musing here.
--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu