Coder Social home page Coder Social logo

Comments (3)

bamos avatar bamos commented on July 20, 2024

Also resolved

from cparse.

VinGarcia avatar VinGarcia commented on July 20, 2024

This one is not fully resolved yet @bamos, we can add support to it by adding a function "set_value()" but we still don't have an working operator "=". I have made an experiment to try to add it (saved on a separated branch) but I ended up with one problem and one choice:

problem:

a = b = c should be evaluated from right to left, I must think how to make that happen.

choice:

I need to make a new Token called rToken that not only has a value, but also keeps a reference to its origin, or else when trying to assign to an existing variable we would replace its reference for its value before the assignment.

I though of 3 ways of doing this second part:

  1. Keep a pointer to the referred packToken, it would be like a javascript closure where the variable changed is always the same independent of the current scope. But it comes with a problem: If the packToken is erased from the map we have a seg. fault in hands =/.
  2. Keep only the variable name as a reference, so we can add it to whichever namespace is in the current scope.

I will try to implement first the second approach, since is simpler, but it would be cool to have a variable system like javascript.

from cparse.

bamos avatar bamos commented on July 20, 2024

Now resolved by #21

from cparse.

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.