Comments (4)
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.
@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.
Perhaps you're looking String::Fields
from problem-solving.
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)
- Named arguments don't respect canonical `key => value` convention (specific example of `mm-dd-yyyy` routine) HOT 15
- Add `.bufs`/`.blobs` methods to `IO::Path` / `IO::Handle` HOT 6
- `when` doesn't support smartmatching against a pointy block HOT 8
- Code highlighting / inspection / IDE tooling HOT 6
- Using multiple named arguments gives different result than just supplying value alone; specific example of `splice`. HOT 22
- Will we ever need more than 64K unique strings at compile time? HOT 4
- Add "short-index" version of often occurring ops HOT 1
- Behavior of type-constrained parameters is surprising given other behavior HOT 65
- Add `nomark` for striping accents, `samemark` is counterintuitive and slow for that purpose. HOT 3
- Root(s) - missing prefix operators HOT 1
- Enabling `no strict` for `raku` one-liners (and perhaps REPL) HOT 8
- Should `.flatmap` be really DEPRECATED or not? HOT 6
- Feature Request - method ```.hammer``` HOT 19
- Hash slices should have an option to return a hash HOT 28
- Feature Request: recognize "doubled" Unicode characters in Raku ternary operator (question mark and exclamation point). HOT 6
- DivideByZero exception has conflicting attributes HOT 5
- X::Numeric::CannotConvert vs. X::Numeric::Real HOT 1
- Routines shift and pop on lists should allow an option to pop or shift multiple elements in one op HOT 6
- `uniprop` and friends are buggy, inconsistent, and potentially replaceable HOT 2
- Declarator Docs are evil and should be eradicated HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from problem-solving.