Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing a variable declared in the upper scope #638

Closed
arakov opened this issue Mar 19, 2024 · 1 comment
Closed

Accessing a variable declared in the upper scope #638

arakov opened this issue Mar 19, 2024 · 1 comment
Labels
Design Idea New language feature
Milestone

Comments

@arakov
Copy link
Member

arakov commented Mar 19, 2024

If two variables are declared in different scopes they can have the same name.

There has to be a way to refer a variable declared in the upper scope:

  var a := new List();
  {
     var a := 2;

     super a.append(a); 
  };

  console.printLine(a.asEnumerable());

The proposed syntax can be used for script grammar (see xforms).

@arakov arakov added the Design Idea New language feature label Mar 19, 2024
@arakov arakov added this to the ELENA 6.0 milestone Mar 19, 2024
@arakov
Copy link
Member Author

arakov commented Mar 20, 2024

Done in ELENA 6.0.8

@arakov arakov closed this as completed Mar 20, 2024
@arakov arakov mentioned this issue Mar 21, 2024
3 tasks
arakov added a commit that referenced this issue Mar 21, 2024
* preparing new version
* [FIXED] calling a variadic method without arguments directly
* [ADDED] an opcode LNEG
* [ADDED] native negate operation for long integers
* [FIXED] declaring a template based type with T is an array as a method result
* [ADDED] sqlite module
* [FIXED] string.toUpper() : returns a string with an incorrect length
* [FIXED] Rosetta Code : Vigenère cipher
* [FIXING]c_a_g sample
* [FIXED] GC : perm generation is not included as roots for the partial collect
* [FIXED] windproc
* [ADDED] support for stdcall for win32
* IDE - refactoring notification routines
* [FIXED] IDE notification refactoring
* [FIXED] displaying stack-allocated structures
* [Samples] c_a_g sample
* [ADDED] c_a_g sample
* [ADDED] agenda sample
* [ADDED] graph sample
* [FIXED] it has to be possible to convert int literal directly to v_int8 / v_int16 / v_int64, depending on the value size
* [FIXED] warn if the source code is not compiled after the change before run / debug
* [FIXED] warn if the source code is changed and not save before run / debug
* [FIXED] the document is in read-only mode during the debugging
* [FIXED] #636 - IDE bugs
* [ADDED]x86 mt
* [FIXED] x86 MTA : starting the new thread / program
* [FIXED] x86 MTA : GC routine
* [FIXED] byrefHandler : if it is not contain the explicit return, assign self to byref retVal
* [FIXED] no need for typecasting operation after if-else operation with both branches containging returning operation
* [FIXED] #634 - debugger step over some expressions
* [FIXED] optimizing operation with int constants
* [ADDED] xforms module
* [ADDED] multi-profiles per a single project file; new option -l<profile-name>
* [ADDED] project settings - select the project profile
* [ADDED] #638 - Accessing a variable declared in the upper scope
* fixing script samples
@arakov arakov mentioned this issue Mar 21, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Idea New language feature
Projects
None yet
Development

No branches or pull requests

1 participant