Comments (7)
I don't think the ISlisp standard requires that the with-open-input-file retain its position when reopening the file.
I also looked into dev / stdin. In this case EOF could not be detected.The following code will work.
echo -ne "foo\nbar\nbaz\n" | eisl -s run.lsp
Word: foo
Word: bar
Word: baz
from eisl.
Yes, but it shouldn't discard input just because it doesn't end with a newline. To quote the standard:
Reads a line of characters from input-stream and returns them as a string (without the newline
character at the end of the line). If an end-of-stream is reached before the next newline character
and a non-empty line has been read prior to the end-of-stream, that line is returned.
So even with no newline at the end, three words should be returned.
from eisl.
I was surprised at the idea of treating Lisp as a script using Unix pipes. I learned Lisp in the 1980s. There was no idea of a scripting language at the time, and Lisp was mainly applied to artificial intelligence. It was a culture shock for me.
from eisl.
It's just a way to supply input with newlines, nothing more. But yes, Unix has taken over.
from eisl.
I've adjusted the first example to use (open-file "/dev/stdin")
now and it works as expected. Still, it's odd that EOF is handled correctly with an opened file and incorrectly with (standard-input)
.
from eisl.
I fixed it.
from eisl.
Thanks!
from eisl.
Related Issues (20)
- Formatter bug HOT 1
- Unquote doesn't work inside vector syntax HOT 1
- type inference in Lisp - typed racket HOT 5
- `finish-output` fails when called on `(standard-output)`. HOT 1
- error: function definition is not allowed here HOT 2
- Pls add asinh function HOT 1
- matrix.lsp gives compiler error undefined <general-vector> HOT 17
- `create-array` when given one dimension parameter returns <basic-vector> instead of <general-vector> HOT 1
- bug of compiled mult HOT 1
- Compile error HOT 1
- bug of compiler HOT 1
- Build fails: Data segment size exceeds process limit HOT 2
- Bug of type inference HOT 1
- ctrl+c in compiled Lisp code. HOT 1
- Build failure on MacOS 14.5 HOT 8
- Error handling in multi-process HOT 1
- Plan of distributed parallel HOT 12
- Calling built-in functions consumes a large number of cells. HOT 1
- There are some unnecessary parts in network mode. HOT 1
- Edlis ^X^F buggy HOT 1
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 eisl.