Git Product home page Git Product logo

Comments (4)

zerbina avatar zerbina commented on July 19, 2024 1

Ah, so from what I've understood, in order to not allow false programs to compile the way to do this at least for the time being is to keep it to the form like this :)

Yep, using the explicit call or command syntax works around the method-call syntax limitation.

In general, a.b and b(a) are not fully interchangeable, and whether that's going change or stay is not entirely clear at the moment.

from nimskull.

zerbina avatar zerbina commented on July 19, 2024

At the center of the problem is that for expression a.b, a is analyzed first, and if there's an error with it, b(a) is never attempted. The manual also has an entry regarding this limitation (toSeq is a template).

Edit: Sorry, I made a mistake reading the compiler debugger output, it's a classic AST corruption issue. The compiler already tries b(a) when a.b is an error.

Nonetheless, I consider this limitation to be a bug that needs to be fixed.

from nimskull.

zerbina avatar zerbina commented on July 19, 2024

The only way forward here seems to be always considering iterator symbols during overload resolution (they're currently only considered in certain contexts).

from nimskull.

sotolf2 avatar sotolf2 commented on July 19, 2024

Ah, so from what I've understood, in order to not allow false programs to compile the way to do this at least for the time being is to keep it to the form like this :)

import std/[sequtils]
let lines = to_seq "filename".lines

Thank you for looking into it and dealing with it so quickly, at least now I think I understand why it doesn't work, which is already a good thing :)

from nimskull.

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.