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

Review Zencode overloading of copy verb in too many statements #609

Closed
jaromil opened this issue Mar 10, 2023 · 8 comments
Closed

Review Zencode overloading of copy verb in too many statements #609

jaromil opened this issue Mar 10, 2023 · 8 comments
Assignees
Milestone

Comments

@jaromil
Copy link
Member

jaromil commented Mar 10, 2023

There is ambiguity in the use of copy and some redundancy solved by pickup from paths.

Review current situation:

Filter: when i copy - 15 items • 334 filtered
When I copy '' in ''
When I copy '' to ''
When I copy the '' to ''
When I copy named by '' in ''
When I copy the '' in '' to ''
When I copy the '' to '' in ''
When I copy contents of '' in ''
When I copy contents of '' named '' in ''

It makes sense to leverage get or pickup when copying out to the root elements inside dictionaries while using copy ... from ... to to indicate from dictionary to dictionary.

Wish (not yet implemented):

When I copy 'didDocument' from 'request_data' to 'broadcast_data'

{ "broadcast_data": { "didDocument" : "..." } }

Current ambiguity (collides):

When I copy the 'didDocument' in 'request_Data' to 'bradcast_data'

{ "broadcast_data" = "..." }
@jaromil
Copy link
Member Author

jaromil commented Mar 10, 2023

One solution is to leverage the path noun and combine it with create the copy instead of pickup

and I create the copy of path 'didDocumentMetadata_copy.created'

@jaromil jaromil self-assigned this May 25, 2023
@jaromil jaromil added this to the v4 milestone Oct 20, 2023
@matteo-cristino
Copy link
Collaborator

Copying data from a path can also be done by combining copy statements with pointer statement explained in #208. In this way this can also be used with move and other statements.

@matteo-cristino
Copy link
Collaborator

Updated list:

When I copy '' in ''                                             
When I copy '' to ''                                    
When I copy the '' to ''                             
When I copy named by '' in ''                              
When I copy the '' in '' to ''                              
When I copy the '' to '' in ''                         
When I copy contents of '' in ''   
When I copy contents of '' named '' in ''
When I create the copy of '' in ''                   
When I create the copy of '' from ''                 
When I create the copy of '' in '' in ''         
When I create the copy of last element in ''    
When I create the copy of '' from dictionary '' 
When I create the copy of element '' in array ''
When I create the copy of object named by '' from dictionary ''

@jaromil
Copy link
Member Author

jaromil commented Oct 24, 2023

proposal:
to = destination like into a destination inside a table
from = source a table that contains the variable
in = source or destination? disambiguate
named = destination name of the copy (in ACK root or indicated by to)

@matteo-cristino
Copy link
Collaborator

Thinking about it this will make it really difficult to find deprecated statements and with this we should also modify all move statements that are written following the the same logic. I propose to

  • left to to indicate the destination name of the copy (as it is now)
  • use in to indicate the destination inside a table
  • use from to indicate source table

In this way the updates are:

When I copy '' in '' to '' -> When I copy '' from '' to '' 
When I create the copy of '' in '' -> Can be deleted since will be equal to When I create the copy of '' from ''
When I create the copy of '' in '' in '' -> When I create the copy of '' from '' from '' (or deprecate as soon as pointer is released)
When I create the copy of last element in '' -> When I create the copy of last element from ''
When I create the copy of '' from dictionary '' -> maybe deprecate  since equal to When I create the copy of '' from ''
When I create the copy of element '' in array '' -> When I create the copy of element '' from array ''

@jaromil
Copy link
Member Author

jaromil commented Oct 25, 2023

Yes to all deprecations suggested! flagged in v3 and removed in v4.

I am unsure about the double from: it may be handy to use from path and accept dot separated paths as it is done elsewhere? paths may be a useful utility, even if overlapping to pointer use cases.

@matteo-cristino
Copy link
Collaborator

Yes, nice to have. In my opinion, pointers will still be useful when we want to do more operations on a nested table

@matteo-cristino
Copy link
Collaborator

Deprecation has been done in #750, new issue created for copy from path #753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants