Skip to content
New issue

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

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

Already on GitHub? # to your account

Process substitution in using chez scheme at command prompt #901

Open
taimoon opened this issue Jan 15, 2025 · 1 comment
Open

Process substitution in using chez scheme at command prompt #901

taimoon opened this issue Jan 15, 2025 · 1 comment

Comments

@taimoon
Copy link

taimoon commented Jan 15, 2025

On my x86 Fedora distro WSL laptop, the scheme version is 10.0.0 and when I try to run this below in bash

$ scheme --script <(echo "(+ 2 3)")

It throws error showing

Exception in port-position: failed on #<binary input port /dev/fd/63>: illegal seek

It does not work.

As comparison, it works for python

$ python3 <(echo "print(2 + 3)")
5

Will this is supported?

The chez scheme manual includes example of using pipe operator together scheme in command prompt.

(echo '(+ 2 3)')  | scheme -q
@taimoon
Copy link
Author

taimoon commented Jan 15, 2025

Besides, if test.scm file is as follows,

(write (read (open-input-file (cadr (command-line)))))
(newline)

When using scheme in command prompt,

scheme --script test.scm <(echo '(+ 2 3)')

It works and prints out

(+ 2 3)

It is sufficient for my use case.

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

No branches or pull requests

1 participant