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

cl-stream #23

Open
utterances-bot opened this issue Aug 3, 2020 · 3 comments
Open

cl-stream #23

utterances-bot opened this issue Aug 3, 2020 · 3 comments

Comments

@utterances-bot
Copy link

cl-stream

https://40ants.com/lisp-project-of-the-day/2020/08/0149-cl-stream.html

Copy link

I think that it is very useful tool for certain types of use cases, especially when combined with aggregation functions and stuff like that. For instance consider this example with group-by https://github.com/sirherrbatka/cl-data-structures/blob/52914da9448208a66a06e1da7a874ddb9e2969d1/src/dicts/hamt/range-test.lisp#L49 or this little snippet

(~> *input*
     (cl-ds.alg:without #'null)
     cl-ds.alg:array-elementwise
     (cl-ds.math:average :sum 0.0))

Stream functions allow me to write more concise code (and less of it). They are great for pseudo-SQL kind of stuff.

@svetlyak40wt
Copy link
Member

It is not that kind of streams. You are talking about arrow functions:

https://40ants.com/lisp-project-of-the-day/2020/04/0046-arrows.html

Copy link

Arrow macro is cool. But I am talking about functions in the cl-ds package. Without, array-elementwise, group-by and so one work by creating lazily evaluated streams.

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

No branches or pull requests

3 participants