Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

empty? should be documented more clearly. #1383

Open
amano-kenji opened this issue Jan 31, 2024 · 4 comments
Open

empty? should be documented more clearly. #1383

amano-kenji opened this issue Jan 31, 2024 · 4 comments

Comments

@amano-kenji
Copy link
Contributor

repl:1:> (doc empty?)


    function
    boot.janet on line 117, column 1

    (empty? xs)

    Check if xs is empty.

What? Define empty. I thought nil was empty.

@kenaryn
Copy link

kenaryn commented Jan 31, 2024

nil is derived from latin nihil which approximately stands for "no thing". There is no thing (pun intended) like emptyness. Even the cosmic void is filled with reversed Kasimir force (formerly known as dark matter then more recently as dark energy).

I think the Janet doc means "Check if xs has a null valence ( from latin ne ullus, "not one") if I were to use array theory terminology.
I know Janet is not based on Array paradigm (unlike a language like Nial) so perhaps Check if xs has a zero dimensionality could be adopted in stead...

... or even "Check if xs has a null length".

@amano-kenji
Copy link
Contributor Author

Define xs.

@oneness
Copy link

oneness commented Nov 28, 2024

xs in janet (in version 1.34 that I verified) means iterables. While I agree docs could be improved, I really like Janets error reporting, which is self explanatory.

@sogaiu
Copy link
Contributor

sogaiu commented Nov 29, 2024

It is true that it's not spelled out what xs represents.

For reference, this seems to be the case in the docstrings for the following as well: %, %=, *, *=, +, -, /, <, <=, =, >=, array/insert, array/push, band, bor, buffer, buffer/push, buffer/push-at, buffer/push-byte, buffer/push-string, buffer/push-word, bxor, compare<, compare<=, compare=, compare>, compare>=, distinct, div, eprin, eprinf, eprint, eprintf, geomean, last, mean, mod, not=, prin, prinf, print, printf, product, string, sum, symbol, tuple/brackets, xprin, xprinf, xprint, and xprintf.

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

No branches or pull requests

4 participants