Error in IsAlpha() and IsAlnum() functions?

27 views
Skip to first unread message

Mansour Ayouni

unread,
Jun 28, 2024, 4:35:32 PMJun 28
to The Ring Programming Language
Hello Mahmoud,

The functions seem to return incorrect output:

image.png

Here is the code to copy-paste and test it:

? isAlpha("Ring")
#--> TRUE
 
? isAlnum("Ring 1.20")
#!--> FALSE
#~> Should be TRUE
 
? isAlpha("محمود")
#!--> FALSE
#~> Should be TRUE


Best,

Mansour

Mansour Ayouni

unread,
Jun 28, 2024, 4:44:17 PMJun 28
to The Ring Programming Language
Hello again,

After rechecking ? isAlnum("Ring 1.20"), it's normal that it returns FALSE because " " and "." chars are neither letters nor numbers.

Hence, the problem remains only in detecting non-latin letters by the isAlpha() function (like Arabic in the example).

Best,
Mansour

Mahmoud Fayed

unread,
Jun 28, 2024, 7:41:39 PMJun 28
to The Ring Programming Language
Hello Mansour

>> "Hence, the problem remains only in detecting non-latin letters by the isAlpha() function (like Arabic in the example)."

This is the expected behaviour
These functions are wrappers around the standard C functions

Ring is designed to be lightweight, where Unicode or Arabic support could be achieved through extensions/library
As you already know through RingQt

Greetings,
Mahmoud 

Mansour Ayouni

unread,
Jun 29, 2024, 2:58:13 AMJun 29
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you for your answer.

Implemented in Softanza in the form of two equivalent functions @IsAlpha() and @IsAlnum()@ being used to avoid conflicting names with the standard Ring functions:

image.png

Best regards,
Mansour

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/41345338-d52d-439c-a824-72866775650dn%40googlegroups.com.

Mahmoud Fayed

unread,
Jun 29, 2024, 10:13:52 AMJun 29
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages