Convert isempty to C++#208
Conversation
For now it's a direct copy of the original C code, with a nodiscard added to be on the safe side.
* Replace `A` with `array` * Use trailing return types
|
About the first point: Generally the functions often have commented the corresponding j phrase, if not Line 816 in de91efc |
|
That makes more sense than the |
codereport
left a comment
There was a problem hiding this comment.
Looks good! 🙏 just a file rename / function rename and then we will 🚢 it
| verbs/vsb.c | ||
| verbs/vx.c | ||
| verbs/vz.c | ||
| verbs/monadic/isempty.cpp |
There was a problem hiding this comment.
| verbs/monadic/isempty.cpp | |
| verbs/monadic/is_empty.cpp |
| * @return boolean jtrue or jfalse | ||
| */ | ||
| [[nodiscard]] auto | ||
| jtisempty(J jt, array w) -> array { |
There was a problem hiding this comment.
| jtisempty(J jt, array w) -> array { | |
| is_empty(J jt, array w) -> array { |
| /** | ||
| * @brief `0 e. $` IsEmpty | ||
| * @param jt JST (J Syntax Tree) | ||
| * @param w Input aray |
There was a problem hiding this comment.
Just a typo
| * @param w Input aray | |
| * @param w Input array |
A branch I had around. It's pretty much a direct copy from the C function, with a few remarks:
jteps, which confuses me a lot. I'm not even sure why it does this.ANto something more descriptive, similar to theis_sparsefunction. However, this macro is used for assignment as well (seemake_array), so I just left the C macro here. I think the consistency here is more important.