Git Product home page Git Product logo

Comments (4)

adilbaig avatar adilbaig commented on July 17, 2024

Hi @arjunadeltoso,

Thanks for reporting this. The foreach is implemented using opApply with the following signature :

int opApply(int delegate(ulong k, Response value) dg)

The key is required. For now, you'll need to implement your foreach loops as foreach(k, v; redis_vals) to get it to run. I'll move to a range based implementation in a future release.

And yes, the doc should say foreach

from tiny-redis.

arjunadeltoso avatar arjunadeltoso commented on July 17, 2024

Thanks for the reply, yeah wasn't sure if

foreach(_, fruit; fruits)
  writeln(fruit)

was the correct approach or if I needed to overload opApply in response.d to take care of the values only iteration case (I've quickly tried it but with no success, just starting with D).

from tiny-redis.

adilbaig avatar adilbaig commented on July 17, 2024

That's correct. I've overloaded opApply in master to allow foreach without key declarations. I need to mull over making it into range before my next release. This one's a quick patch, but it closes the issue. I will close this ticket in my next release.

And the docs are fixed.

from tiny-redis.

adilbaig avatar adilbaig commented on July 17, 2024

https://github.com/adilbaig/Tiny-Redis/releases/tag/v2.0.2

from tiny-redis.

Related Issues (20)

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.