Re: Initializing variables on declarations

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

Michael J. Sabal wrote:
> 
> Okay, I'm about to do it again.  I was looking at the Euphoria source and 
> the list of open feature requests, and I think this change can be done with
> minimal code.
> 
> Current syntax:
> [global] integer x  x = 5
> 
> Desired syntax:
> [global] integer x = 5
> 
> As I see it, the initializing assignment can remain optional.  The procedure
> 
> parser() in parser.e would need an additional temp variable to hold the 
> variable name.  After global_symbol is called, check if the next token is 
> EQUALS.  If not, put it back.  If so, call assignment.  This would need to be
> added to both the TYPE and GLOBAL TYPE sections.
> 
> AFAICT, this wouldn't break anything.  Can anyone see a reason for not doing
> this?

Michael,

For whatever it's worth, I like this idea.

Dan Moyer

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

Search



Quick Links

User menu

Not signed in.

Misc Menu