Code Monkey home page Code Monkey logo

Comments (7)

nkh avatar nkh commented on May 21, 2024 1

Implemented as a special case by wrapping Slips in Data::Dump::Tree::Type::SlipWrapper, Another attempt, handling the Slip as an object as long as possible before passing it in a list, had too large an impact on the code base.

from p6-data-dump-tree.

lizmat avatar lizmat commented on May 21, 2024 1

FWIW, Slips need special handling throughout the Rakudo code base to give them their magical properties.

from p6-data-dump-tree.

nkh avatar nkh commented on May 21, 2024

It made me crazy, once I got it to display properly I found it that the changes broke everything else, I didn't have enough tests to find the errors, running the examples in the distribution, which unfortunately don't all have corresponding tests, showed that even making a diff between two data structures was broken (my favorite part of DDT).

10 lines to handle Slip, and everything works like before, not sure if a hack like that shouldn't be called the best solution.

Thank you for reporting it, maybe ;), I am not sure how many people need to render Slips.

from p6-data-dump-tree.

lizmat avatar lizmat commented on May 21, 2024

I needed it because I have a large array of arrays and hashes and wanted a cheap way of making it object oriented. So I have a role that you just like the keys, and it will automatically create methods for that accessing that key in the hash (very much like standard Perl 5 objects). The problem was with the arrays, because they got itemized. This meant you couldn't do for $obj.array", because it wouldn't iterate. But it *does* if you bind the key to a Slip` :-) Which is a bit of a hack, but it works really nicely and smoothly :-)

from p6-data-dump-tree.

nkh avatar nkh commented on May 21, 2024

An example of the data structure, what you wanted to do with it and how the Slips where used would make a nice technical article for many I think.

from p6-data-dump-tree.

lizmat avatar lizmat commented on May 21, 2024

The thought has crossed my mind

from p6-data-dump-tree.

nkh avatar nkh commented on May 21, 2024

If you write an article, I need to see more of P6 usage, and do dumps with DDT, let me know if you want some help with filters if the wrap_highlight example is not enough, or a review.

for presentation, and quite often for oneself too, :flat(0) can give a nicer/more usable display, even if it is slooooow.

from p6-data-dump-tree.

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.