Giter VIP home page Giter VIP logo

Comments (7)

markrogoyski avatar markrogoyski commented on July 20, 2024

Hi @Smoren,

Thank you for the feature suggestion. Give me some time to think about this and I'll get back to you. Sorry to make you wait.

Thanks for understanding.
Mark

from itertools-php.

Smoren avatar Smoren commented on July 20, 2024

@markrogoyski

Thank you for the answer.

I will wait for your decision.

from itertools-php.

Smoren avatar Smoren commented on July 20, 2024

Hi @markrogoyski,

I thought about the renaming of Stream namespace and I have a very simple idea.

Maybe Iterable or IterableWrapper?

Iterable::of($smth)
    ->pairwise()
    ->toArray();

I think it looks nice :)

from itertools-php.

markrogoyski avatar markrogoyski commented on July 20, 2024

Hi @Smoren,

Thanks for your suggestion and continued interest to improve IterTools. I have not released a new version that has the Streams feature yet, so it is still possible to make changes.

However, I would argue that Stream is right name for this for three reasons.

  1. The word "stream" gives the image of things flowing together continuously, like the fluent chaining of methods together. Since the stream repeatedly processes the data, it is a form of iteration, and fits in with the theme of IterTools.

  2. This is a common name for this functionality. See Java Streams, C++ Streams API, numerous python stream libraries (streams, python-stream, streampy, Streams, python-streams, python-streaming , pyStream, pystreams), etc.

  3. It differentiates it clearly from the looping constructs in the library. IterTools now provides tools to power loops, and tools to process iterables in a functional pipeline, consisting of a source, zero-or-more operations, and a terminal operation.

These are my reasons. I'm happy to continue to discuss if you like. Thanks.
Mark

from itertools-php.

Smoren avatar Smoren commented on July 20, 2024

Hi @markrogoyski,

Your arguments sound persuasive. I no longer insist on renaming.
Have you decided anything about including resources in IterTools?

from itertools-php.

markrogoyski avatar markrogoyski commented on July 20, 2024

Hi @Smoren,

I think resources is too big a topic. See here: https://www.php.net/manual/en/resource.php. Many things return resources, including network calls and protocols, database handles, etc.

Maybe narrow the scope to iterating files or something would help refine the idea and make it workable. I can immediately think of iterating lines of a file, and lines of a CSV. Anything else you would consider? And maybe the namespace is File rather than Resource to clearly indicate the intent?

Thanks,
Mark

from itertools-php.

Smoren avatar Smoren commented on July 20, 2024

Hi @markrogoyski,

I think namespace File is a good idea. I'll think about it's methods and their implementation.

from itertools-php.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.