Giter VIP home page Giter VIP logo

Comments (12)

paldepind avatar paldepind commented on May 23, 2024 1

See #65. I've found the bug and reproduced it with a smaller test case. I'd love to get your feedback on the alternative solution I mention in the PR 😄

Thanks again for reporting the issue with a nice and simple test case 👍

from list.

paldepind avatar paldepind commented on May 23, 2024 1

Just lobbying for a bugfix release when possible :-)

I've just released a new version 👍

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

simplified the first bug to just two drops:

const L = require("list")

let f = L.list()
for (let i=0;i<1329;i++) {
    f = L.append(i, f);
}

const xx = L.drop(3, L.drop(201, f))
console.log(L.first(xx))
console.log(L.nth(0, xx))

-- sanity check
const xx1 = L.fromArray(L.toArray(xx));
console.log(L.first(xx1))
console.log(L.nth(0, xx1))

output is =>

201
204
204
204

from list.

paldepind avatar paldepind commented on May 23, 2024

Thank you for reporting the issue @emmanueltouzery. I'm looking into it!

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

did you check that your fix fixes both issues reproduced through the first script? The second issue from the first script may be independent because drop and dropLast use only slice. In that second issue I don't see first and last playing any role?

from list.

paldepind avatar paldepind commented on May 23, 2024

No, I missed that there were two parts and I only tested with the second code. I'll take a look at the other problem as well 😄

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

yes unfortunately there are two bugs, I ran the test script from your PR branch:

FIRST ISSUE first() doesn't agree with nth(0)
204
204
SECOND ISSUE list of 4 drop first and last, wrong result
[ 201, 202, 203, 204 ]
[ 201, 202 ]

This kind of bugs seem like showstoppers to me :-(

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

You didn't forget about other bug did you? Closing the bug makes it unclear

from list.

paldepind avatar paldepind commented on May 23, 2024

You didn't forget about other bug did you? Closing the bug makes it unclear

Don't worry, I didn't 😄

I actually didn't close the issue myself. GitHub automatically closed the issue because I merged the PR #65. Since the PR contained the text "Fixes #64" GitHub thought the issue was fixed.

This kind of bugs seem like showstoppers to me :-(

I agree. List shouldn't have any bugs. See #66. That should fix the issue.

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

Yes in general in the commits i say "ref #bug" if it's related to the bug without fixing it. Great otherwise! Hope you make a bugfix release soon :-)

from list.

paldepind avatar paldepind commented on May 23, 2024

Yes in general in the commits i say "ref #bug" if it's related to the bug without fixing it.

That's a great tip!

Both issues should be fixed now so I'll close 😄

from list.

emmanueltouzery avatar emmanueltouzery commented on May 23, 2024

Sure let's close. Just lobbying for a bugfix release when possible :-)

from list.

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.