Git Product home page Git Product logo

Comments (7)

whitequark avatar whitequark commented on August 26, 2024

You can do child, = *node. If this is not in the docs, it should be.

When do you use to_a.each?

from ast.

rubydesign avatar rubydesign commented on August 26, 2024

hmm, i didn't know you could do that. Frankly looks weird, rather use my first.

each off course to go over children. you're saying i shouldn't have to. And maybe when i switch to the instance variable an your processor i won't. But now i still do and it seemed a sensible thing to have in there.
But i seem to be receiving a more is less attitude , yes ?
Always surprises me in ruby projects, ruby being known for having 7 ways of doing anything, but ok, i get it.

from ast.

whitequark avatar whitequark commented on August 26, 2024

you're saying i shouldn't have to

I'm not. I am specifically asking what your use case is, because I have no idea what is it. I.e. children are usually heterogeneous; what common action over them is desirable?

from ast.

rubydesign avatar rubydesign commented on August 26, 2024

ok, maybe the question was slightly ill formed then.
Because the answer to your question was so obvious.

If you're asking why i need to iterate. Other than off course, because i have a collection.
To process them.

from ast.

whitequark avatar whitequark commented on August 26, 2024

Like if you have a (list) or a (hash)? Yeah, that's reasonable. I would accept a PR with each.

from ast.

rubydesign avatar rubydesign commented on August 26, 2024

sort of, i have an s(:expression_list , exp1 , exp2...) which is inside all statements, so common.
But i'll try that Processor with a stack now.
The code i'm talking about is temporarily here btw of almost nothing

from ast.

rubydesign avatar rubydesign commented on August 26, 2024

So, that processor / instance approach worked.
Quite like it even, so in total the switch to ast has bee great :-)

from ast.

Related Issues (11)

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.