SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.5.3
new point { test() }
class point
x=10 y=20
func test
oSelf = self
see x + nl + y + nl
myobj = new otherclass {
see name + nl
see oself.x + nl + oself.y + nl
}
class otherclass
name = "test"
Output:
10
20
test
10
20
Now look at this line
oself = self
The problem with the previous line is that we will have a new copy from the object Because in Ring the assignment
operator copy lists and objects by value (not by reference).
When we access the new object attributes (reading) we don’t have problems
But if we modified the object attributes (Then we will modify the copy!).
Note: We can use braces again with the copy
new point { test() }
class point
x=10 y=20
func test
oSelf = self
see x + nl + y + nl
myobj = new otherclass {
see name + nl
oSelf {
see x + nl + y + nl
}
}
class otherclass
name = "test"
In a GUI application, we may create a class contains the window objects as attributes to be able to access the controls
from different methods. Remember the previous information when you try to access objects using braces inside
methods because in this case you can’t access the object attributes directly and if you copied the self object you will
work on a copy and the new controls that you create will be related to the copy and you can’t access them.
60.9. Using Braces to access objects inside Class Methods 695
Ring Documentation, Release 1.5.3
60.10 Accessing the class attributes from braces inside class meth-
ods
We access the class attributes directly from the class methods, also we have the choice to use the Self reference before
the attribute/method name. Using Braces {} inside class method change the active object scope and prevent us from
getting direct access to the class attributes. Also using Self will not help because the Self reference will be changed to
the object that we access using Braces.
In this case if you want to read an attribute you have to copy the Self object before using Braces and if you want to
modify an attribute you have to the copy from local variable to the object attribute after using Braces.
This case happens when you want to read/modify attribute insead braces.
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
new QSqlDatabase() {
oCon = addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
open()
}
}
self.oCon = oCon
# some code here
In the previous example we want to create the connection object and save it inside the oCon attribute.
The object is an output from the addDatabase() method that we use after accessing the QSQLDatabase() object.
Inside braces we can’t use the Self reference to use the object created from the MyApp class, Because the Self reference
here will be to the object that we access using Braces.
We solved the problem in the previous example by creating a local variable called oCon then after Braces we copied
that variable to the oCon attribute.
The next code is another solution.
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
oCon = new QSqlDatabase()
oCon = oCon.addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
Open()
}
# some code here
The next code is a better solution.
60.10. Accessing the class attributes from braces inside class methods 696
Ring Documentation, Release 1.5.3
Class MyApp
oCon # Attribute
# some code here
Func OpenDatabase
# some code here
new QSqlDatabase() {
this.oCon = addDatabase("QSQLITE") {
setDatabaseName("weighthistory.db")
Open()
}
}
# some code here
Note: We used this.attribute to access the class attribute (oCon) while we are inside Braces.
60.11 Creating a Class for each Window in GUI applications
A good way for creating classes for windows is to define the window directly after the class name
In this area you can use nested braces without problems to define the window and the controls, and they will be
attributes that you can access from methods.
Example:
Load "guilib.ring"
new qApp
{
$ObjectName = "oFirstWindow"
oFirstWindow = new FirstWindow
$ObjectName = "oSecondWindow"
oSecondWindow = new SecondWindow
exec()
}
Class FirstWindow
win = new qWidget() {
setgeometry(0,50,300,200)
setWindowTitle("First Window")
label1 = new qLabel(win)
{
setgeometry(10,10,300,30)
setText("0")
}
btn1 = new qPushButton(win)
{
move(100,100)
setText("Increment")
setClickEvent($ObjectName+".increment()")
}
60.11. Creating a Class for each Window in GUI applications 697
Ring Documentation, Release 1.5.3
show()
}
Func Increment
label1 {
setText( "" + ( 0 + text() + 1 ) )
}
Class SecondWindow
win = new qWidget() {
setgeometry(400,50,300,200)
setWindowTitle("Second Window")
label1 = new qLabel(win)
{
setgeometry(10,10,300,30)
setText("0")
}
btn1 = new qPushButton(win)
{
move(100,100)
setText("Decrement")
setClickEvent($ObjectName+".decrement()")
}
show()
}
Func Decrement
label1 {
setText( "" + ( 0 + text() - 1 ) )
}
60.12 Conflict between self inside braces and self in the class region
In the class region (after the class name and before any methods) we define the attributes.
In this region we have access to the global scope and the local scope will point to the object scope.
Three Scopes
• Global Scope —> Gloabl Scope
• Object Scope —> Object Scope
• Local Scope —> Object Scope
Look at this example
New Account {
see aFriends
}
Class Account
name = "Mahmoud"
aFriends = []
aFriends + new Friend {
name = "Gal"
60.12. Conflict between self inside braces and self in the class region 698
Ring Documentation, Release 1.5.3
}
aFriends + new Friend {
name = "Bert"
}
Class Friend
name
Output:
name: NULL
name: NULL
The problem in the previous example is that the Class account contains an attribute called “name” and the Friend class
contains an attribue called “name” also.
If you tried using self.name inside braces you will get the same result!
New Account {
see aFriends
}
Class Account
name = "Mahmoud"
aFriends = []
aFriends + new Friend {
self.name = "Gal"
}
aFriends + new Friend {
self.name = "Bert"
}
Class Friend
name
So why using self.name inside braces doesn’t solve this conflict?
Because after the class region we have
• global scope —> global scope
• object scope —> object scope (Account Class)
• local scope —> local scope (Account Class)
When we use braces we change the object scope, so we have
• global scope —> global scope
• object scope —> object scope (Friend Class)
• local scope —> local scope (Account Class)
Ring search in the local scope first, so using self.name will use the Account class.
There are many solution
Solution (1) : Access the object through the list
New Account {
see aFriends
}
Class Account
60.12. Conflict between self inside braces and self in the class region 699
Ring Documentation, Release 1.5.3
name = "Mahmoud"
aFriends = []
aFriends + new Friend
aFriends[len(aFriends)] {
aFriends[len(aFriends)].name = "Gal"
}
aFriends + new Friend
aFriends[len(aFriends)] {
aFriends[len(aFriends)].name = "Bert"
}
Class Friend
name
Solution (2) : Create Method in the friend class to set the name attribute.
New Account {
see aFriends
}
Class Account
name = "Mahmoud"
aFriends = []
aFriends + new Friend {
setname("Gal")
}
aFriends + new Friend {
setname("Bert")
}
Class Friend
name
func setname cName
name = cName
Solution (3) : Create a method in the account class to set the attribute
New Account {
see aFriends
}
Class Account
name = "Mahmoud"
aFriends = []
friend("Gal")
friend("Bert")
func friend cName
aFriends + new Friend {
name = cName
}
Class Friend
name
Solution (4) : Declarative Programming
New Account {
name = "mahmoud"
friend {
60.12. Conflict between self inside braces and self in the class region 700
Ring Documentation, Release 1.5.3
name = "Gal"
}
friend {
name = "Bert"
}
see aFriends
}
Class Account
name
aFriends = []
friend
func getfriend
aFriends + new Friend
return aFriends[len(aFriends)]
Class Friend
name
Output:
name: Gal
name: Bert
60.13 Using braces to escape from the current object scope
Since braces change the current object scope to another object. we can use it to do some work without modifying the
class attributes and using the same variable names.
new point {x=10 y=20 z=30 start() }
class point x y z
func start
see self # print the x y z values (10,20,30)
new Local {
x = 100
y = 200
z = 300
}
see self # print the x y z values (10,20,30)
see x + nl # will print 100
see y + nl # will print 200
see z + nl # will print 300
Self { # NO Advantage - Search is done in local scope first
see x + nl # will print 100
see y + nl # will print 200
see z + nl # will print 300
}
see self.x + nl # will print 10
see self.y + nl # will print 20
see self.z + nl # will print 30
class Local
Output:
x: 10.000000
y: 20.000000
60.13. Using braces to escape from the current object scope 701
Ring Documentation, Release 1.5.3
z: 30.000000
x: 10.000000
y: 20.000000
z: 30.000000
100
200
300
100
200
300
10
20
30
60.14 Summary of Scope Rules
At first remember that
1 - Each programming language comes with it’s scope rules based on the language goals
2 - Programming in the small is different than Programming in the Large
3 - Some programming language are designed for developing small programs while others are designed for large
programs
4 - In programming, If we have access to more than one scope - Then problems may come if we don’t manage things
correctly
5 - It’s always more secure to reduce the number of visible scopes
6 - Some programming languages force you to manage the scope in some way, while others not!
In Ring
1 - Special and very simple scope rules that are designed for Flexibility first then Security
2 - Ring is designed to support programming in the small and programming in the large.
3 - The language provide the different programming paradigms that you may select from based on the project size.
Errors comes only if you selected a bad paradigm for the target project or you are using the paradigm in a way that is
not correct or at least not common.
4 - In Ring you have the choice, you can use global variables or avoid them. you can give them a special $ mark or
leave them. you can use object-oriented or stay with procedures. you can use the class region (after the class name
and before any method) just for attributes or use it for code too.
5 - Just read the next scope rules and think about them then use them in your favorite way.
Scope Rules:
1 - At any place in our program code we have only at maximum Three Scopes (Local Scope, Object Scope and Global
Scope).
2 - When Ring find a variable it will search in the local scope first then in the object scope then in the global scope.
3 - At any time inside procedures or methods you can use braces { } to access an object and change the current object
scope.
4 - In the class region (After the class name and before any method) this is a special region where both of the object
scope and the local scope point to the object scope. I.e. No local variables where each variable you define in this
region will become an attribute.
60.14. Summary of Scope Rules 702
Ring Documentation, Release 1.5.3
5 - Before defining any variable (in any scope and in the class region too) a search process will be done to use the
variable if it’s found.
6 - Functions and Methods parameters are defined automatically as local variables to these functions or methods.
7 - Using Object.Attribute will search in the object attributes only.
8 - Using Self.Attribute will lead to a search for Self first then search in Self Attributes.
9 - The Self reference inside class region (after the class name and before any method) always point to the object scope
created from the class.
10- The Self reference inside methods will be changed when we uses Braces to be a reference to the object that we
access.
11- Writing variable names directly in the class region (after the class name and before any method) means using them
or define then (in order).
12- Using self.attribute in the class region reduce search to the object scope (avoid conflict with global scope).
From these rules you can understand all types of conflicts and why you may have them and how to avoid them
Simple advices to avoid any conflict and use the scope rules in a better way
1 - Try to avoid global variables
2 - Use the Main Function - This will help you to avoid global variables
3 - If you are going to use many global variables use the $ mark before the variable name
4 - In the class region if you don’t respect the advice number three ($) then use self.attribute when you define your
attributes
5 - You can use object.attribute and object.method() instead of object { attribute } and object { method() } if you don’t
like changing the object scope.
6 - If you will use nested braces in a class - think about using the class region if possible because in this region you
will have access to the object that you access using { } + access to the class attributes
7 - If you are inside a class method and used nested braces you will change the object scope with each brace and you
will loss the access to the class attributes directly but you have access to the local scope before and after using brace
{ } , if you will read/modify the class attribute from braces then use This.Attribute because using ‘This’ means (The
object created from this class) while using ‘Self’ means (The object in the current object scope).
After understanding all of the previous points, You will master this topic.
60.14. Summary of Scope Rules 703
CHAPTER
SIXTYONE
SCOPE RULES FOR FUNCTIONS AND METHODS
In this chapter we will learn about the scope rules for functions and methods.
You need to know the next information once you started using Ring for large applications.
These applications may contains and use
• Many Packages and Classes written in Ring
• Many Functions written in Ring
• Standard Ring Functions (Written in C language)
• Functions and Classes written in C/C++ languages
61.1 How Ring find the Functions and Methods?
When you call a method or function, Ring will start a search process to find this function
If found –> Call the function and store the function pointer in the cache so Ring can use it again with doing another
search.
If not found —> Runtime error message (That you can avoid using Try/Catch)
How the search process is done?
Search for functions/methods follow the next order
1 - Search in methods (if we are inside class method or object using braces {})
2 - Search in functions written by the programmer using Ring Code
3 - Search in functions written in C/C++ like standard Ring functions
This enable us to write clean code inside classes methods and avoid any conflict with functions.
If we want to call a function with the same name as a method in the class we will need a wrapper function or we will
access a temp. object using { } then call that function there.
We can replace C/C++ Functions with Ring Functions.
We can replace Ring Functions with Ring Methods.
Note: Using self.method() is not necessary in any use case.
Tip: We can use this.method() to escape from the current active scope that we access using braces {} and call a
method in the class that we are inside.
704

More Related Content

What's hot

Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshowilias ahmed
 
The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88Mahmoud Samir Fayed
 
Java OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCJava OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCOUM SAOKOSAL
 
The Ring programming language version 1.7 book - Part 90 of 196
The Ring programming language version 1.7 book - Part 90 of 196The Ring programming language version 1.7 book - Part 90 of 196
The Ring programming language version 1.7 book - Part 90 of 196Mahmoud Samir Fayed
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
CS101- Introduction to Computing- Lecture 26
CS101- Introduction to Computing- Lecture 26CS101- Introduction to Computing- Lecture 26
CS101- Introduction to Computing- Lecture 26Bilal Ahmed
 
The Ring programming language version 1.5.4 book - Part 38 of 185
The Ring programming language version 1.5.4 book - Part 38 of 185The Ring programming language version 1.5.4 book - Part 38 of 185
The Ring programming language version 1.5.4 book - Part 38 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 75 of 189
The Ring programming language version 1.6 book - Part 75 of 189The Ring programming language version 1.6 book - Part 75 of 189
The Ring programming language version 1.6 book - Part 75 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 52 of 84
The Ring programming language version 1.2 book - Part 52 of 84The Ring programming language version 1.2 book - Part 52 of 84
The Ring programming language version 1.2 book - Part 52 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 6 of 181
The Ring programming language version 1.5.2 book - Part 6 of 181The Ring programming language version 1.5.2 book - Part 6 of 181
The Ring programming language version 1.5.2 book - Part 6 of 181Mahmoud Samir Fayed
 
Java OOP Programming language (Part 4) - Collection
Java OOP Programming language (Part 4) - CollectionJava OOP Programming language (Part 4) - Collection
Java OOP Programming language (Part 4) - CollectionOUM SAOKOSAL
 
The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212Mahmoud Samir Fayed
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceOUM SAOKOSAL
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in javaRaja Sekhar
 
Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)Majid Saeed
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsMayank Jain
 
The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196Mahmoud Samir Fayed
 

What's hot (20)

Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88
 
Java OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBCJava OOP Programming language (Part 8) - Java Database JDBC
Java OOP Programming language (Part 8) - Java Database JDBC
 
The Ring programming language version 1.7 book - Part 90 of 196
The Ring programming language version 1.7 book - Part 90 of 196The Ring programming language version 1.7 book - Part 90 of 196
The Ring programming language version 1.7 book - Part 90 of 196
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
CS101- Introduction to Computing- Lecture 26
CS101- Introduction to Computing- Lecture 26CS101- Introduction to Computing- Lecture 26
CS101- Introduction to Computing- Lecture 26
 
The Ring programming language version 1.5.4 book - Part 38 of 185
The Ring programming language version 1.5.4 book - Part 38 of 185The Ring programming language version 1.5.4 book - Part 38 of 185
The Ring programming language version 1.5.4 book - Part 38 of 185
 
The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30The Ring programming language version 1.4 book - Part 20 of 30
The Ring programming language version 1.4 book - Part 20 of 30
 
The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212The Ring programming language version 1.10 book - Part 100 of 212
The Ring programming language version 1.10 book - Part 100 of 212
 
The Ring programming language version 1.6 book - Part 75 of 189
The Ring programming language version 1.6 book - Part 75 of 189The Ring programming language version 1.6 book - Part 75 of 189
The Ring programming language version 1.6 book - Part 75 of 189
 
The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88The Ring programming language version 1.3 book - Part 56 of 88
The Ring programming language version 1.3 book - Part 56 of 88
 
The Ring programming language version 1.2 book - Part 52 of 84
The Ring programming language version 1.2 book - Part 52 of 84The Ring programming language version 1.2 book - Part 52 of 84
The Ring programming language version 1.2 book - Part 52 of 84
 
The Ring programming language version 1.5.2 book - Part 6 of 181
The Ring programming language version 1.5.2 book - Part 6 of 181The Ring programming language version 1.5.2 book - Part 6 of 181
The Ring programming language version 1.5.2 book - Part 6 of 181
 
Java OOP Programming language (Part 4) - Collection
Java OOP Programming language (Part 4) - CollectionJava OOP Programming language (Part 4) - Collection
Java OOP Programming language (Part 4) - Collection
 
The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212The Ring programming language version 1.10 book - Part 86 of 212
The Ring programming language version 1.10 book - Part 86 of 212
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - Inheritance
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in java
 
Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)Classes in c++ (OOP Presentation)
Classes in c++ (OOP Presentation)
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196
 

Similar to The Ring programming language version 1.5.3 book - Part 83 of 184

The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 40 of 189
The Ring programming language version 1.6 book - Part 40 of 189The Ring programming language version 1.6 book - Part 40 of 189
The Ring programming language version 1.6 book - Part 40 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 36 of 180
The Ring programming language version 1.5.1 book - Part 36 of 180The Ring programming language version 1.5.1 book - Part 36 of 180
The Ring programming language version 1.5.1 book - Part 36 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 55 of 88
The Ring programming language version 1.3 book - Part 55 of 88The Ring programming language version 1.3 book - Part 55 of 88
The Ring programming language version 1.3 book - Part 55 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 37 of 181
The Ring programming language version 1.5.2 book - Part 37 of 181The Ring programming language version 1.5.2 book - Part 37 of 181
The Ring programming language version 1.5.2 book - Part 37 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 77 of 196
The Ring programming language version 1.7 book - Part 77 of 196The Ring programming language version 1.7 book - Part 77 of 196
The Ring programming language version 1.7 book - Part 77 of 196Mahmoud Samir Fayed
 
Oops concept in c#
Oops concept in c#Oops concept in c#
Oops concept in c#ANURAG SINGH
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84Mahmoud Samir Fayed
 
Introduce oop in python
Introduce oop in pythonIntroduce oop in python
Introduce oop in pythontuan vo
 
The Ring programming language version 1.2 book - Part 27 of 84
The Ring programming language version 1.2 book - Part 27 of 84The Ring programming language version 1.2 book - Part 27 of 84
The Ring programming language version 1.2 book - Part 27 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 38 of 184
The Ring programming language version 1.5.3 book - Part 38 of 184The Ring programming language version 1.5.3 book - Part 38 of 184
The Ring programming language version 1.5.3 book - Part 38 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 85 of 212
The Ring programming language version 1.10 book - Part 85 of 212The Ring programming language version 1.10 book - Part 85 of 212
The Ring programming language version 1.10 book - Part 85 of 212Mahmoud Samir Fayed
 

Similar to The Ring programming language version 1.5.3 book - Part 83 of 184 (20)

The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84
 
The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196
 
The Ring programming language version 1.6 book - Part 40 of 189
The Ring programming language version 1.6 book - Part 40 of 189The Ring programming language version 1.6 book - Part 40 of 189
The Ring programming language version 1.6 book - Part 40 of 189
 
The Ring programming language version 1.5.1 book - Part 36 of 180
The Ring programming language version 1.5.1 book - Part 36 of 180The Ring programming language version 1.5.1 book - Part 36 of 180
The Ring programming language version 1.5.1 book - Part 36 of 180
 
The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189The Ring programming language version 1.6 book - Part 76 of 189
The Ring programming language version 1.6 book - Part 76 of 189
 
The Ring programming language version 1.3 book - Part 55 of 88
The Ring programming language version 1.3 book - Part 55 of 88The Ring programming language version 1.3 book - Part 55 of 88
The Ring programming language version 1.3 book - Part 55 of 88
 
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84
 
The Ring programming language version 1.5.2 book - Part 37 of 181
The Ring programming language version 1.5.2 book - Part 37 of 181The Ring programming language version 1.5.2 book - Part 37 of 181
The Ring programming language version 1.5.2 book - Part 37 of 181
 
Oop objects_classes
Oop objects_classesOop objects_classes
Oop objects_classes
 
Spsl vi unit final
Spsl vi unit finalSpsl vi unit final
Spsl vi unit final
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
 
The Ring programming language version 1.7 book - Part 77 of 196
The Ring programming language version 1.7 book - Part 77 of 196The Ring programming language version 1.7 book - Part 77 of 196
The Ring programming language version 1.7 book - Part 77 of 196
 
Oops concept in c#
Oops concept in c#Oops concept in c#
Oops concept in c#
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
 
Introduce oop in python
Introduce oop in pythonIntroduce oop in python
Introduce oop in python
 
The Ring programming language version 1.2 book - Part 27 of 84
The Ring programming language version 1.2 book - Part 27 of 84The Ring programming language version 1.2 book - Part 27 of 84
The Ring programming language version 1.2 book - Part 27 of 84
 
The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189The Ring programming language version 1.6 book - Part 32 of 189
The Ring programming language version 1.6 book - Part 32 of 189
 
The Ring programming language version 1.5.3 book - Part 38 of 184
The Ring programming language version 1.5.3 book - Part 38 of 184The Ring programming language version 1.5.3 book - Part 38 of 184
The Ring programming language version 1.5.3 book - Part 38 of 184
 
The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184The Ring programming language version 1.5.3 book - Part 30 of 184
The Ring programming language version 1.5.3 book - Part 30 of 184
 
The Ring programming language version 1.10 book - Part 85 of 212
The Ring programming language version 1.10 book - Part 85 of 212The Ring programming language version 1.10 book - Part 85 of 212
The Ring programming language version 1.10 book - Part 85 of 212
 

More from Mahmoud Samir Fayed

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212Mahmoud Samir Fayed
 

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

The Ring programming language version 1.5.3 book - Part 83 of 184

  • 1. Ring Documentation, Release 1.5.3 new point { test() } class point x=10 y=20 func test oSelf = self see x + nl + y + nl myobj = new otherclass { see name + nl see oself.x + nl + oself.y + nl } class otherclass name = "test" Output: 10 20 test 10 20 Now look at this line oself = self The problem with the previous line is that we will have a new copy from the object Because in Ring the assignment operator copy lists and objects by value (not by reference). When we access the new object attributes (reading) we don’t have problems But if we modified the object attributes (Then we will modify the copy!). Note: We can use braces again with the copy new point { test() } class point x=10 y=20 func test oSelf = self see x + nl + y + nl myobj = new otherclass { see name + nl oSelf { see x + nl + y + nl } } class otherclass name = "test" In a GUI application, we may create a class contains the window objects as attributes to be able to access the controls from different methods. Remember the previous information when you try to access objects using braces inside methods because in this case you can’t access the object attributes directly and if you copied the self object you will work on a copy and the new controls that you create will be related to the copy and you can’t access them. 60.9. Using Braces to access objects inside Class Methods 695
  • 2. Ring Documentation, Release 1.5.3 60.10 Accessing the class attributes from braces inside class meth- ods We access the class attributes directly from the class methods, also we have the choice to use the Self reference before the attribute/method name. Using Braces {} inside class method change the active object scope and prevent us from getting direct access to the class attributes. Also using Self will not help because the Self reference will be changed to the object that we access using Braces. In this case if you want to read an attribute you have to copy the Self object before using Braces and if you want to modify an attribute you have to the copy from local variable to the object attribute after using Braces. This case happens when you want to read/modify attribute insead braces. Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here new QSqlDatabase() { oCon = addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") open() } } self.oCon = oCon # some code here In the previous example we want to create the connection object and save it inside the oCon attribute. The object is an output from the addDatabase() method that we use after accessing the QSQLDatabase() object. Inside braces we can’t use the Self reference to use the object created from the MyApp class, Because the Self reference here will be to the object that we access using Braces. We solved the problem in the previous example by creating a local variable called oCon then after Braces we copied that variable to the oCon attribute. The next code is another solution. Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here oCon = new QSqlDatabase() oCon = oCon.addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") Open() } # some code here The next code is a better solution. 60.10. Accessing the class attributes from braces inside class methods 696
  • 3. Ring Documentation, Release 1.5.3 Class MyApp oCon # Attribute # some code here Func OpenDatabase # some code here new QSqlDatabase() { this.oCon = addDatabase("QSQLITE") { setDatabaseName("weighthistory.db") Open() } } # some code here Note: We used this.attribute to access the class attribute (oCon) while we are inside Braces. 60.11 Creating a Class for each Window in GUI applications A good way for creating classes for windows is to define the window directly after the class name In this area you can use nested braces without problems to define the window and the controls, and they will be attributes that you can access from methods. Example: Load "guilib.ring" new qApp { $ObjectName = "oFirstWindow" oFirstWindow = new FirstWindow $ObjectName = "oSecondWindow" oSecondWindow = new SecondWindow exec() } Class FirstWindow win = new qWidget() { setgeometry(0,50,300,200) setWindowTitle("First Window") label1 = new qLabel(win) { setgeometry(10,10,300,30) setText("0") } btn1 = new qPushButton(win) { move(100,100) setText("Increment") setClickEvent($ObjectName+".increment()") } 60.11. Creating a Class for each Window in GUI applications 697
  • 4. Ring Documentation, Release 1.5.3 show() } Func Increment label1 { setText( "" + ( 0 + text() + 1 ) ) } Class SecondWindow win = new qWidget() { setgeometry(400,50,300,200) setWindowTitle("Second Window") label1 = new qLabel(win) { setgeometry(10,10,300,30) setText("0") } btn1 = new qPushButton(win) { move(100,100) setText("Decrement") setClickEvent($ObjectName+".decrement()") } show() } Func Decrement label1 { setText( "" + ( 0 + text() - 1 ) ) } 60.12 Conflict between self inside braces and self in the class region In the class region (after the class name and before any methods) we define the attributes. In this region we have access to the global scope and the local scope will point to the object scope. Three Scopes • Global Scope —> Gloabl Scope • Object Scope —> Object Scope • Local Scope —> Object Scope Look at this example New Account { see aFriends } Class Account name = "Mahmoud" aFriends = [] aFriends + new Friend { name = "Gal" 60.12. Conflict between self inside braces and self in the class region 698
  • 5. Ring Documentation, Release 1.5.3 } aFriends + new Friend { name = "Bert" } Class Friend name Output: name: NULL name: NULL The problem in the previous example is that the Class account contains an attribute called “name” and the Friend class contains an attribue called “name” also. If you tried using self.name inside braces you will get the same result! New Account { see aFriends } Class Account name = "Mahmoud" aFriends = [] aFriends + new Friend { self.name = "Gal" } aFriends + new Friend { self.name = "Bert" } Class Friend name So why using self.name inside braces doesn’t solve this conflict? Because after the class region we have • global scope —> global scope • object scope —> object scope (Account Class) • local scope —> local scope (Account Class) When we use braces we change the object scope, so we have • global scope —> global scope • object scope —> object scope (Friend Class) • local scope —> local scope (Account Class) Ring search in the local scope first, so using self.name will use the Account class. There are many solution Solution (1) : Access the object through the list New Account { see aFriends } Class Account 60.12. Conflict between self inside braces and self in the class region 699
  • 6. Ring Documentation, Release 1.5.3 name = "Mahmoud" aFriends = [] aFriends + new Friend aFriends[len(aFriends)] { aFriends[len(aFriends)].name = "Gal" } aFriends + new Friend aFriends[len(aFriends)] { aFriends[len(aFriends)].name = "Bert" } Class Friend name Solution (2) : Create Method in the friend class to set the name attribute. New Account { see aFriends } Class Account name = "Mahmoud" aFriends = [] aFriends + new Friend { setname("Gal") } aFriends + new Friend { setname("Bert") } Class Friend name func setname cName name = cName Solution (3) : Create a method in the account class to set the attribute New Account { see aFriends } Class Account name = "Mahmoud" aFriends = [] friend("Gal") friend("Bert") func friend cName aFriends + new Friend { name = cName } Class Friend name Solution (4) : Declarative Programming New Account { name = "mahmoud" friend { 60.12. Conflict between self inside braces and self in the class region 700
  • 7. Ring Documentation, Release 1.5.3 name = "Gal" } friend { name = "Bert" } see aFriends } Class Account name aFriends = [] friend func getfriend aFriends + new Friend return aFriends[len(aFriends)] Class Friend name Output: name: Gal name: Bert 60.13 Using braces to escape from the current object scope Since braces change the current object scope to another object. we can use it to do some work without modifying the class attributes and using the same variable names. new point {x=10 y=20 z=30 start() } class point x y z func start see self # print the x y z values (10,20,30) new Local { x = 100 y = 200 z = 300 } see self # print the x y z values (10,20,30) see x + nl # will print 100 see y + nl # will print 200 see z + nl # will print 300 Self { # NO Advantage - Search is done in local scope first see x + nl # will print 100 see y + nl # will print 200 see z + nl # will print 300 } see self.x + nl # will print 10 see self.y + nl # will print 20 see self.z + nl # will print 30 class Local Output: x: 10.000000 y: 20.000000 60.13. Using braces to escape from the current object scope 701
  • 8. Ring Documentation, Release 1.5.3 z: 30.000000 x: 10.000000 y: 20.000000 z: 30.000000 100 200 300 100 200 300 10 20 30 60.14 Summary of Scope Rules At first remember that 1 - Each programming language comes with it’s scope rules based on the language goals 2 - Programming in the small is different than Programming in the Large 3 - Some programming language are designed for developing small programs while others are designed for large programs 4 - In programming, If we have access to more than one scope - Then problems may come if we don’t manage things correctly 5 - It’s always more secure to reduce the number of visible scopes 6 - Some programming languages force you to manage the scope in some way, while others not! In Ring 1 - Special and very simple scope rules that are designed for Flexibility first then Security 2 - Ring is designed to support programming in the small and programming in the large. 3 - The language provide the different programming paradigms that you may select from based on the project size. Errors comes only if you selected a bad paradigm for the target project or you are using the paradigm in a way that is not correct or at least not common. 4 - In Ring you have the choice, you can use global variables or avoid them. you can give them a special $ mark or leave them. you can use object-oriented or stay with procedures. you can use the class region (after the class name and before any method) just for attributes or use it for code too. 5 - Just read the next scope rules and think about them then use them in your favorite way. Scope Rules: 1 - At any place in our program code we have only at maximum Three Scopes (Local Scope, Object Scope and Global Scope). 2 - When Ring find a variable it will search in the local scope first then in the object scope then in the global scope. 3 - At any time inside procedures or methods you can use braces { } to access an object and change the current object scope. 4 - In the class region (After the class name and before any method) this is a special region where both of the object scope and the local scope point to the object scope. I.e. No local variables where each variable you define in this region will become an attribute. 60.14. Summary of Scope Rules 702
  • 9. Ring Documentation, Release 1.5.3 5 - Before defining any variable (in any scope and in the class region too) a search process will be done to use the variable if it’s found. 6 - Functions and Methods parameters are defined automatically as local variables to these functions or methods. 7 - Using Object.Attribute will search in the object attributes only. 8 - Using Self.Attribute will lead to a search for Self first then search in Self Attributes. 9 - The Self reference inside class region (after the class name and before any method) always point to the object scope created from the class. 10- The Self reference inside methods will be changed when we uses Braces to be a reference to the object that we access. 11- Writing variable names directly in the class region (after the class name and before any method) means using them or define then (in order). 12- Using self.attribute in the class region reduce search to the object scope (avoid conflict with global scope). From these rules you can understand all types of conflicts and why you may have them and how to avoid them Simple advices to avoid any conflict and use the scope rules in a better way 1 - Try to avoid global variables 2 - Use the Main Function - This will help you to avoid global variables 3 - If you are going to use many global variables use the $ mark before the variable name 4 - In the class region if you don’t respect the advice number three ($) then use self.attribute when you define your attributes 5 - You can use object.attribute and object.method() instead of object { attribute } and object { method() } if you don’t like changing the object scope. 6 - If you will use nested braces in a class - think about using the class region if possible because in this region you will have access to the object that you access using { } + access to the class attributes 7 - If you are inside a class method and used nested braces you will change the object scope with each brace and you will loss the access to the class attributes directly but you have access to the local scope before and after using brace { } , if you will read/modify the class attribute from braces then use This.Attribute because using ‘This’ means (The object created from this class) while using ‘Self’ means (The object in the current object scope). After understanding all of the previous points, You will master this topic. 60.14. Summary of Scope Rules 703
  • 10. CHAPTER SIXTYONE SCOPE RULES FOR FUNCTIONS AND METHODS In this chapter we will learn about the scope rules for functions and methods. You need to know the next information once you started using Ring for large applications. These applications may contains and use • Many Packages and Classes written in Ring • Many Functions written in Ring • Standard Ring Functions (Written in C language) • Functions and Classes written in C/C++ languages 61.1 How Ring find the Functions and Methods? When you call a method or function, Ring will start a search process to find this function If found –> Call the function and store the function pointer in the cache so Ring can use it again with doing another search. If not found —> Runtime error message (That you can avoid using Try/Catch) How the search process is done? Search for functions/methods follow the next order 1 - Search in methods (if we are inside class method or object using braces {}) 2 - Search in functions written by the programmer using Ring Code 3 - Search in functions written in C/C++ like standard Ring functions This enable us to write clean code inside classes methods and avoid any conflict with functions. If we want to call a function with the same name as a method in the class we will need a wrapper function or we will access a temp. object using { } then call that function there. We can replace C/C++ Functions with Ring Functions. We can replace Ring Functions with Ring Methods. Note: Using self.method() is not necessary in any use case. Tip: We can use this.method() to escape from the current active scope that we access using braces {} and call a method in the class that we are inside. 704