Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

read-line function#154

Locked Answeredbyjenshaase
Chemaclass asked this question inQ&A
Discussion options

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(read-line)

Extra:
We could even go one step forward and think if it makes sense to work on an io module as well
https://github.com/clojure/clojure/blob/master/src/clj/clojure/java/io.clj

What do you think,@jenshaase? 🤔

You must be logged in to vote

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 thejava.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…

Replies: 1 comment 1 reply

Comment options

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 thejava.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 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.

You must be logged in to vote
1 reply
@Chemaclass
Comment options

ChemaclassJan 7, 2021
Maintainer Author

Right! I think what I was missing was some examples and some help about how to use some basic IO, but you just told me with your examples.(php/readline) is more than sufficient to accomplish this. I like a lot that you can use any PHP functions by(php/*)

Answer selected byChemaclass
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
solvedQuestion solved
2 participants
@Chemaclass@jenshaase

[8]ページ先頭

©2009-2025 Movatter.jp