Skip to content

Contextual I/O #38

@sagebind

Description

@sagebind

Make stdin, stdout, and stderr into normal context variables and make a "stream handle" a built-in type. Then we can do something like:

let @stdout = (open -w "message.txt") {
    println "Hello world!"
    fclose @stdout
}

All sorts of fun and useful programming abilities open up that many shells can't handle because you can't hold a file descriptor in a variable. Of course, it can also mean that users can leak file handles...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions