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

map-style operator in Jac for Jaseci objects #941

Open
ypkang opened this issue Feb 16, 2023 · 0 comments
Open

map-style operator in Jac for Jaseci objects #941

ypkang opened this issue Feb 16, 2023 · 0 comments
Labels
core Related to jaseci core and serv JSEP JaSeci Enhancement Proposal new feature/enhancement Proposing a new feature or enhancement to existing feature. P2 Nice-to-have.

Comments

@ypkang
Copy link
Contributor

ypkang commented Feb 16, 2023

Would be cool to be able to, in one line, apply a function to a set of jaseci objects (nodes, edges), similar to map in python.

For example, to get the value of a has variable of all nodes in a collection.
Something like

node item {
   has name;
   has count;
}
...
walker init {

  items = --> node::item;
  item_names = items.name; # item_name would be just an array of strings
  map(items, here.count+=1); # obviously this syntax won't work but the idea is this will increment count in every item in the set.
} 
@ypkang ypkang added JSEP JaSeci Enhancement Proposal core Related to jaseci core and serv P2 Nice-to-have. new feature/enhancement Proposing a new feature or enhancement to existing feature. labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to jaseci core and serv JSEP JaSeci Enhancement Proposal new feature/enhancement Proposing a new feature or enhancement to existing feature. P2 Nice-to-have.
Projects
None yet
Development

No branches or pull requests

1 participant