GithubHelp home page GithubHelp logo

Comments (4)

thundergnat avatar thundergnat commented on September 15, 2024

I am curious if https://raku.land/zef:thundergnat/String::Splice would cover your use case? Though in looking at the tests, (there is no mention of snip in the docs at all) it looks like snip is more closely related to https://raku.land/zef:thundergnat/List::Divvy so maybe not.

from problem-solving.

2colours avatar 2colours commented on September 15, 2024

@thundergnat honestly, this is a horribly written issue, and it seems to me that I fundamentally misunderstood what snip does. https://discord.com/channels/538407879980482560/768511641758466088/1067610507932086372 (discord side) https://irclogs.raku.org/raku-beginner/2023-01-25.html#00:59 (IRC side)

What I wanted (and thought to have found) was indeed more like your String::Splice distro, except:

  • it would split into arbitrary number of pieces (so far snip fits)
  • the places of splitting are determined by the position given, rather than the current value (or some mapping of it)

Here is a better-working snippet than the one in the original message: https://gist.github.com/2colours/d4d247d98fa2d6071069387aaad4844a

At the end of the day, I'm considering closing this issue because the inspiration of it was the misunderstanding that snip did the same thing but for lists.

from problem-solving.

lizmat avatar lizmat commented on September 15, 2024

Perhaps you're looking String::Fields

from problem-solving.

2colours avatar 2colours commented on September 15, 2024

Yes - I like this interface a lot, even if it isn't exactly the same I described. Seems useful for some oldschool text based data format as well, never a bad thing if one has to deal with log files a lot. :)

Anyway, the issue turned out to be mis-aimed so it seems appropriate to close it.

from problem-solving.

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.