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

[ Feature request ] : Add new programs in string folder of jule #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jivanjamadar
Copy link

Added 2 files of jule programs :
StringReverse.jule - Main program for reversing the string
StringReverseTest.jule - To test the program, there is test cases

@Jivanjamadar Jivanjamadar changed the title Add files via upload : [ Feature request ] : Add new programs in jule Oct 18, 2024
@Jivanjamadar Jivanjamadar changed the title [ Feature request ] : Add new programs in jule [ Feature request ] : Add new programs in string folder of jule Oct 18, 2024
@Jivanjamadar
Copy link
Author

@mertcandav as you said, I have mentioned issue in PR. Please, review it. Thank you

@mertcandav mertcandav linked an issue Oct 19, 2024 that may be closed by this pull request
Copy link
Member

@mertcandav mertcandav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation is invalid. First of all, it's not a valid Jule code. Have undefined semantics and invalid syntaxes. For example, module reverse_string is invalid. Jule have not such a semantics.

Also Jule variables are immutable-by-default but you are mutating the s parameter which is immutable. Also strings are not mutable, so you should cast into byte slice first. But reversing byte slice is not a correct approach. So you should cast string into rune slice, reverse rune slice, and return as string the rune slice.

There are too many issues. Such as pub fn or return keywords. Jule have ret keyword for return statements. Have no pub keyword and etc. Please write your code syntactically and semantically correct, and test it whether it compiles successfully.

Your tests are invalid. Please write valid test functions.
You can look at the existing tests of existing implementations for reference.

@Jivanjamadar
Copy link
Author

Sorry for inconvenience. I will make necessary changes. Thank you for suggesting changes.

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

Successfully merging this pull request may close these issues.

Want to add new jule program for reverse the string
2 participants