Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remainder; add splitting by string #27

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

GeorgeLyon
Copy link
Owner

@wti This actually fixes #22 and adds support for splitting on arbitrary strings.

@GeorgeLyon GeorgeLyon self-assigned this Mar 29, 2024
@GeorgeLyon GeorgeLyon merged commit d7be048 into main Mar 29, 2024
3 checks passed
@wti
Copy link
Contributor

wti commented Apr 1, 2024

I appreciate the flexibility of String vs. character!

Because implementing (Script) splitInput(...) API seems to require package-internal access to Shwift, I'll maintain a fork wip310plus

@GeorgeLyon GeorgeLyon deleted the dev/george/actual-fix branch April 1, 2024 01:47
@GeorgeLyon
Copy link
Owner Author

@wti do you mean internal access to Script? I'm pretty sure all of the Shwift machinery you need is public, but yes as Script is more meant to be a demo for Shwift, and not a dependency in its own right, you won't be able to do things like create new custom builtins.

@wti
Copy link
Contributor

wti commented Apr 1, 2024

Thanks for the quick replies!

do you mean internal access to Script?

Yes, sorry.

all of the Shwift machinery you need is public

Well, it's Script that has executable's, shell, pipe's, etc. that I and my API clients want to work with.

The goal is a Script (final) pipe sink that operates async per-segment on streaming swift objects (each derived from the segment). Unless the code runs within piping, the memory benefits of processing one segment at a time are lost.

My fork has 3 lines using Script-internal API:

Shell.PipableCommand {
  try await Shell.invoke { _, invocation in
    try await invocation.builtin { channel in

I'll look for alternatives. (No reply necessary.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lines.makeAsyncIterator drops remainder when buffers have no delimiter
2 participants