Closed Cypher1 closed 2 years ago
Thanks for the suggestion! This is really interesting. I like the idea a lot. Just so we're on the same page, it be adding another term of the form:
for :pat in :expr
Which gets translated directly to the same loop in Rust code. The way we would detect this kind of term is that it starts with the keyword for
. Is that right?
Yup.
I hope it is only a minor change as it's just an alternative source of items to check.
Thanks
On Tue, 22 Feb 2022, 3:56 am Eric Zhang, @.***> wrote:
Thanks for the suggestion! This is really interesting. I like the idea a lot. Just so we're on the same page, it be adding another term of the form:
for :pat in :expr
Which gets translated directly to the same loop in Rust code. The way we would detect this kind of term is that it starts with the keyword for. Is that right?
— Reply to this email directly, view it on GitHub https://github.com/ekzhang/crepe/issues/17#issuecomment-1047073208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIRUHUEMBXSHQXV57N46T3U4JVDFANCNFSM5O5NN3ZA . You are receiving this because you authored the thread.Message ID: @.***>
Similar to aggregates using bindings in #10, it seems useful to be able to disaggregate/iterate over data.
Enumerating values from an iterator would allow us to use data from outside of crepe without having to convert functions to use work-arounds like range predicates inside Crepe.
I have a suggestion for the syntax as well as some possible use cases below:
e.g. Accessing the characters in a string inside Crepe.
e.g. Using a 'shortest_path' function that returns a list of edges traversed.