In Ring 1.25 (GitHub) - Better NaturalLib

26 views
Skip to first unread message

Mahmoud Fayed

unread,
Dec 20, 2025, 10:56:35 AM (yesterday) Dec 20
to The Ring Programming Language
Hello

This is one of the new features provided by Ring 1.25 (under development)

The NaturalLib is updated to provide

  1. Better Performance

  2. The next methods are added to the NaturalLanguage class

  • LoadCommand(cCommandName)

  • Execute(cCode)

  • setBeforeRun(cCode)

  • setAfterRun(cCode)

  • setStartKeywordsWith(cStart)

  • setMaskOperators(lMask)

  • getBeforeRun() –> cCode

  • getAfterRun() –> cCode

  • getStartKeywordsWith() –> cStart

  • getMaskOperators() –> lMask

Example:

load "stdlibcore.ring" load "naturallib.ring" DefineNaturalCommand.SyntaxIsCommand([ :Package = "MyLanguage.Natural", :Command = "i want window", :Function = func { ? "Command: I want window" } ]) MyLang = New NaturalLanguage { SetLanguageName(:MyLanguage) SetPackageName("MyLanguage.Natural") loadCommand("i want window") } ? copy("=",30) GUI = new MyLanguage GUI { for t=1 to 3 i want window next } ? copy("=",30) MyLang.RunString(' I want window ') MyLang.Execute(' I want window ') ? copy("=",30) MyLang { setBeforeRun(`ChangeRingKeyword to towards`+nl) setAfterRun(`ChangeRingKeyword towards to`+nl) } MyLang.execute(` for t=1 towards 5 i want window next `) ? copy("=",30) MyLang { setBeforeRun("") // Disable Before Run setAfterRun("") // Disable After Run setStartKeywordsWith("@") setMaskOperators(False) } MyLang.execute(' @for t=1 @to 3 i want window @next ') ? copy("=",30)

Output:

============================== Command: I want window Command: I want window Command: I want window ============================== Command: I want window Command: I want window ============================== Command: I want window Command: I want window Command: I want window Command: I want window Command: I want window ============================== Command: I want window Command: I want window Command: I want window ==============================

Greetings,
Mahmoud

Mansour Ayouni

unread,
Dec 20, 2025, 1:11:02 PM (yesterday) Dec 20
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud;

This makes NaturalLib very flexible and reliable !
Looking forward to discovering all the new features of your new design...

All the 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 visit https://groups.google.com/d/msgid/ring-lang/028f9496-28a0-437d-81a5-ce950b5274b3n%40googlegroups.com.

Mahmoud Fayed

unread,
Dec 20, 2025, 1:51:46 PM (yesterday) Dec 20
to The Ring Programming Language
Hello Mansour

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages