SoftanzaLib on GitHub

230 views
Skip to first unread message

Mansour Ayouni

unread,
Mar 14, 2022, 6:43:34 PM3/14/22
to The Ring Programming Language
Hello Mahmoud and All,

Please find the codebase of SoftanzaLib in this repo:

You can explore it by looking to the code of each class (stzString.ring for example) and, then, by trying the example provided in stzStringTest.ring file.

The code is quite readable, commented when necessary, and organised in comprehensive sections and paragraphs. I hope this will help.

Many of the examples will work as expected, few of them not, because work on some parts of the library is in progress... My apologies for that.

Along with the many practical features provided (thousands of them), there are a handful of practical innovations (like The Walker metaphor for navigating lists without using loops for example) and some interesting things to try, like wide support of Unicode, Natural Coding, Knowledge Programming, and many more.

Natural Coding, for example, means that you can write statements like this and use them inside your Ring code:

 # Let
 
@ = [
        :Me = :Mansour,
        :MyFriend = :Mahmoud,
        :MyProgrammingLanguage = :Ring,
        :CreatorOfRing = :Mahmoud
]
 
# All these return TRUE
 
 ? _(:Mansour).Is(@[ :Me ])._
? _(:Ring).Is(@[ :MyProgrammingLanguage ])._
? _(:Mahmoud).Is(@[ :MyFriend ]).AndThe(@[ :CreatorOfRing ])._

? _(:Mahmoud).Is(@[ :MyFriend ]).AndThe(@[ :CreatorOfRing ]).AtTheSameTime._

My goal is to provide a foundation for Ring programmers to accelerate their developments while writing expressive and quiet efficient code.

All the best,
Mansour

Bert Mariani

unread,
Mar 14, 2022, 6:58:37 PM3/14/22
to The Ring Programming Language
Hello Mansour

Whoa --- 386 files --- no wonder it took such a long time to build !!!
This was quite a Humongous Effort !!!

I downloaded from GitHub and extracted the ZIP file to C\;ring\libraries  --- 
Is this the correct path to put SoftanzaLib in ?

Mansour Ayouni

unread,
Mar 14, 2022, 7:06:11 PM3/14/22
to Bert Mariani, The Ring Programming Language
Hello Bert,

Thank you for your kind message!

Yes, there are about 370K LOC in it...

I worked on it daily without interruption for 3 years :), made hundreds of refactorings, and used it to solve practical problems I faced in many programming projects.

I hope you will love it.

Best,
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/06cffeeb-9b43-4da0-92e8-b767be588e27n%40googlegroups.com.

Bert Mariani

unread,
Mar 14, 2022, 9:14:38 PM3/14/22
to The Ring Programming Language
Hello Mansiur

I get this "replace_2"  error from multiple  *.ring programs
I am just trying every program in an alphabetical sequence 

Also  which path should the SoftanzaLib  be put in ?

Line 5215 Error (R14) : Calling Method without definition !: replace_2
In method replaceallcs() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 5144  In method replaceall() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 5248  In method replace() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 5251  In method replaceq() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 10251  In method islocaleabbreviation() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 83  In function stringislocaleabbreviation() in file C:\ring\libraries\SoftanzaLib-main\stzString.ring
called from line 1758  In method init() in file C:\ring\libraries\SoftanzaLib-main\stzLocale.ring
called from line 1477  in file C:/ring/libraries/SoftanzaLib-main/stzArabicTassreef.ring

Mahmoud Fayed

unread,
Mar 14, 2022, 9:54:44 PM3/14/22
to The Ring Programming Language
Hello Mansour

Thanks for sharing SoftanzaLib

(1) As Bert said we have the (replace_2) error with Ring 1.16

Looks like you have updated RingQt and added some methods
Please share these updates (Files changed in RingQt - So we can update it)

(2) Another important issue (Related to Ring 1.17 under development)
It can't run the library for another reason
We get this error

Line 395 Constraint unverified!
In raise()

This error happens when evaluating this code
if NULL
         // Pass
else
        raise('Constraint unverified!')
ok

In Ring 1.16 every thing is TRUE except ZERO, so (if NULL) is TRUE

Starting from Ring 1.17 - Everything is TRUE except ZERO, NULL/Empty String, Empty Lists
So please change the code to take this in mind

(3) Adding a Package File to the project in GitHub is important so we can install it using (ringpm install softanzalib)

Greetings,
Mahmoud

Mansour Ayouni

unread,
Mar 14, 2022, 9:55:00 PM3/14/22
to Bert Mariani, The Ring Programming Language
Hello Bert,

The replace_2() function is an internal function of Qt that I added to RingQt and used in several places of the code.

To add it, you should to add this line to the .../extensions/ringqt/classes/core/qstring2.cf file:

QString replace@2(QString before, QString after, Qt::CaseSensitivity)


Then you should run the code generator (generates RingQt code from Qt file descriptors) and build the extension as described in this file:

.../extensions/rinqt/README.md


After that, you should have no problem in conducting the test.


PS: the file you began with (stzArabicTassreef.ring) is not intended to be part of the library, so you can skip it.


Best,

Mansour


Mahmoud Fayed

unread,
Mar 14, 2022, 9:59:31 PM3/14/22
to The Ring Programming Language
Hello Mansour, Bert

>> "Then you should run the code generator (generates RingQt code from Qt file descriptors) and build the extension as described in this file"

This step takes a lot of time!

Please wait, I will do it and update (RingQt) and will let you know
So You can get this update quickly using the Package Manager

Greetings,
Mahmoud

Mansour Ayouni

unread,
Mar 14, 2022, 10:01:54 PM3/14/22
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud, Bert,

Attached is the copy of the qstring2.cf file I have on my machine.

Best,
Mansour

qstring2.txt

Mahmoud Fayed

unread,
Mar 14, 2022, 10:04:59 PM3/14/22
to The Ring Programming Language
Hello Mansour

>> "Attached is the copy of the qstring2.cf file I have on my machine."

Received, Thank you very much

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Mar 14, 2022, 10:26:25 PM3/14/22
to The Ring Programming Language
Hello Bert, Mansour

>> "I get this "replace_2"  error from multiple  *.ring programs"

Just update RingQt and the problem will be fixed

Update it using the next command
ringpm update ringqt

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Mar 14, 2022, 10:35:55 PM3/14/22
to The Ring Programming Language
Hello Mansour

>> "Please find the codebase of SoftanzaLib in this repo:"

I see that You added a package file!

Please wait, I will update it & I will send you a Pull Request during the next minutes

So the package can be installed to ring/libraries folder
And we have a loader file (stzlib.ring" in ring/bin/load

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Mar 14, 2022, 10:47:23 PM3/14/22
to The Ring Programming Language
Hello Mansour

The pull request is submitted : https://github.com/mayouni/SoftanzaLib/pull/1

This will update the package file

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages