read-line function #154
-
I didn't find any function to read from the console, for example. I think it would be nice to have a read-line function, something like
Extra: What do you think, @jenshaase? 🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Regarding You can use Regarding an io: In the clojure / Java world it makes sense to wrap the In general I want to keep the core library of Phel small. I would like to focus on stuff that requires as common specification (like the request and response object) or very general functions and macros. Moving libraries in extra repositories has also the benefit that new versions can be published independently from the compiler. |
Beta Was this translation helpful? Give feedback.
Regarding
(read-line)
:You can use
(php/readline)
if you haveext-readline
installed. I will not wrap this function in the core library because it requires a extension.Regarding an io:
In the clojure / Java world it makes sense to wrap the
java.io
library because it is well defined and used very often in a lot of code. In PHP the io utils are much simpler. I would recommend to use them directly (e.g.(php/file_get_contents "path/to/file")
or(php/file_put_contents "path/to/file" "content")
). However, if you have a cool idea on how to make a very good io library you can just create a library for it in an extra repository.In general I want to keep the core library of Phel small. I would l…