Skip to content

Evaluating Bass code from stdin #258

@DrPyser

Description

@DrPyser

Hi, this is a very interesting project which I'm just starting to learn.

One useful pattern of interaction with a script interpreter is to be able to provide script input through stdin.

Currently, when I try to provide input to bass through piping to its stdin, it fails with an error about inappropriate ioctl:

❯ echo '($ echo hello)' | bass
inappropriate ioctl for device

Is it an expected current limitation? Is there currently a way for a bass script to evaluate stdin input as bass expressions?
Looking at the reference in the documentation, it seems there is no public API for parsing bass code, or more generally s-expressions.
Perhaps this would be exposed through a :bass protocol for read, and the ability to change the protocol associated with the stdin source(currently fixed to json as I understand).

Thanks @vito for this nice work, looking forward to making more use of bass!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions