-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support adding rows #183
Labels
bug
Something isn't working
Comments
class SHEET1_Class:
def __init__(self):
global SHEET1_addidx
self.addidx = SHEET1_addidx + 1
SHEET1_addidx += 1
@side_effect_decorator
@staticmethod
def add(obj: SHEET1_Class):
side_effect(lambda obj: SHEET1_added_objects.append(obj))
side_effect(lambda obj: setattr(DATA, f"{obj.__class__.__name__}_{obj.__class__.__top_index+obj.addidx}", obj))
# classes.py (generated):
SHEET1 = set()
# user main.py actions:
# (when executing plan, SHEET1 will be replaced by OrderedSet())
def func():
new_row = SHEET1_Class(B=1)
new_row1 = SHEET1_Class(B=1)
new_row2 = SHEET1_Class(B=1)
SHEET1_Class.add(new_row) # new_row.addidx == 1; DATA.SHEET_11
def use_my_rows(r: SHEET1_Class):
assert r.B == 1
r.B = 0
# ...
# HyoerC Plan:
[[use_my_rows, <obj38724368235>], [use_my_rows, <obj972346324286>]]
# plan.py:
#...
use_my_rows(filter(lambda x: x.addidx == 1, gc.get_objects()))
use_my_rows(DATA.SHEET1_11)
# |
andreykyz
added a commit
that referenced
this issue
Aug 26, 2021
andreykyz
added a commit
that referenced
this issue
Aug 26, 2021
andreykyz
added a commit
that referenced
this issue
Aug 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hyper-etable branch new_row
hyperc use branch develop (at least 03720e4 commit)
Add row works by instantiating the class
Check that newly instantiated objects appear as added rows as usual (see how it worked in XTJ)
- [ ] create SET objects for new rows instances - [ ] add to documentation to add to that setImplementation idea:
The text was updated successfully, but these errors were encountered: