SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.7
func f3
see "f3 method" + nl
class local
Output:
========================================
test method
f1 function
f2 function
f3 method
f3 function
========================================
64.3. Calling a function sharing the name with a method in the current class 752
CHAPTER
SIXTYFIVE
SYNTAX FLEXIBILITY
In this chapter we will learn about some options that are provided automatically by the Ring compiler for syntax
flexibility.
65.1 Change Language Keywords
We can change any keyword using the ChangeRingKeyword command.
Note: Remember to restore the keyword again if the team will mix between styles in the same project.
Tip: The ChangeRingKeyword command is executed in the scanner stage by the compiler (before parsing).
Syntax:
ChangeRingKeyword <oldkeyword> <newkeyword>
Example:
ChangeRingKeyword see print
print "welcome" + nl
ChangeRingKeyword print see
see "Welcome" + nl
Example:
ChangeRingKeyword func function
ChangeRingKeyword see print
ChangeRingKeyword ok endif
ChangeRingKeyword next endfor
ChangeRingKeyword end endwhile
x = 10
while x > 0
print "x = " + x + nl
for t = 1 to 10
if t = 3
print "number three" + nl
endif
endfor
753
Ring Documentation, Release 1.7
x--
endwhile
test()
function test
print "message from test" + nl
ChangeRingKeyword function func
ChangeRingKeyword print see
ChangeRingKeyword endif ok
ChangeRingKeyword endfor next
ChangeRingKeyword endwhile end
65.2 Change Language Operators
We can change any operator using the ChangeRingOperator command.
Note: Remember to restore the operator again if the team will mix between styles in the same project.
Tip: The ChangeRingOperartor command is executed in the scanner stage by the compiler (before parsing).
Syntax:
ChangeRingOperator <oldkeyword> <newkeyword>
Example:
The next program hide the + operator by changing it to _+
changeringoperator + _+
changeringkeyword SEE PRINT
try
print 5 + 10
catch
print nl print "error" print nl
done
changeringoperator _+ +
The next program change the + operator to “plus”.
changeringoperator + plus
changeringkeyword SEE PRINT
Print 5 plus 5
changeringoperator plus +
changeringkeyword PRINT SEE
65.2. Change Language Operators 754
Ring Documentation, Release 1.7
65.3 Load Syntax Files
You may store a group of ChangeRingKeyword and ChangeRingOperator commands in a file to use later in many
source files. You can’t use the Load command to call these files because
• ChangeRingKeyword and ChangeRingOperator commands are executed in the scanner phase by the compiler
(before parsing).
• The load command is executed in the parsing phase (after the scanner phase).
Solution: Use the LoadSyntax Command which is executed in the scanner phase.
Syntax:
LoadSyntax "syntaxfile.ring"
Example:
File : StyleBasicOn.ring
ChangeRingKeyword see print
ChangeRingKeyword ok endif
ChangeRingKeyword next endfor
ChangeRingKeyword end endwhile
File : StyleBasicOff.ring
ChangeRingKeyword print see
ChangeRingKeyword endif ok
ChangeRingKeyword endfor next
ChangeRingKeyword endwhile end
File : UseStyleBasic.ring
LoadSyntax "stylebasicon.ring"
x = 10
while x > 0
print "x = " + x + nl
for t = 1 to 10
if t = 3
print "number three" + nl
endif
endfor
x--
endwhile
LoadSyntax "stylebasicoff.ring"
see "done" + nl
Note: files called by the LoadSyntax command must contains ChangeRingKeyword and ChangeRingOperator com-
mands only.
Tip: files called by the LoadSyntax command doesn’t support functions, packages and classes. just imperative
commands only.
Note: Using this feature you can create many styles that you can use in the same project and you can support Ring
65.3. Load Syntax Files 755
Ring Documentation, Release 1.7
translation to other languages like Arabic, French and so on.
Tip: The effect of LoadSyntax command is related to the current source code file only.
65.4 Using “()” around the function parameters
We can use () around the function parameters (optional).
Example:
hello()
sum(3,4)
func hello()
see "Hello" + nl
func sum(x,y)
see x+y+nl
Output:
Hello
7
Example:
myfunc = func x,y { see x + y + nl }
call myfunc (3,4)
myfunc2 = func (x,y) { see x+y+nl }
call myfunc(3,4)
Output:
7
7
65.5 Using Semi-colon after and between statements
In Ring we can use semi-colon after and between statements (optional).
Example:
# Using semi-colon is optional
see "Hello" + nl ; see "How are you?" + nl ; see "Welcome to Ring" + nl ;
one() ; two() ; three() ;
func one ; see "one" + nl ;
func two ; see "two" + nl ;
func three ; see "three" + nl ;
Output:
65.4. Using “()” around the function parameters 756
Ring Documentation, Release 1.7
Hello
How are you?
Welcome to Ring
one
two
three
65.6 Using $ and @ in the start of the variable name
You can use any unicode character in the variable name also we can use $ and @ in the name.
This feature may help, for example we can start global variables with $ and the object attributes with @.
In other languages like Ruby this is the rule, In the Ring language this is just an option without any force from the
Compiler.
example:
$global_variable = 5
new test { hello() }
class test
@instance_variable = 10
func hello
local_variable = 15
see "Global : " + $global_variable + nl +
"Instance : " + @instance_variable + nl +
"Local : " + local_variable + nl
Output:
Global : 5
Instance : 10
Local : 15
65.7 Using the ‘elseif’ keyword as ‘but’ in if statement
if you don’t like the ‘but’ keyword in if statement Then you can use the ‘elseif’ keyword.
Example:
give x
if x = 1 see "one"
elseif x=2 see "two"
elseif x=3 see "three"
elseif x=4 see "four"
else see "other"
ok
see nl
65.6. Using $ and @ in the start of the variable name 757
Ring Documentation, Release 1.7
65.8 Using the ‘else’ keyword as ‘other’ in switch statement
if you don’t like the ‘other’ keyword in switch statement Then you can use the ‘else’ keyword.
Also you can replace ‘else’ with ‘other’ in if statement.
i.e. ‘other’ keyword is the same as ‘else’ keyword.
Example:
x = 1
switch x
on 10
see "10" + nl
else
see "not 10" + nl
end
Output:
not 10
65.9 Using the ‘end’ keyword in different control structures
We can use the ‘end’ keyword to close different control structures
• If statement
• For loop
• Switch
• While
• Try-Catch
Example:
see "if statement.." + nl
x = 1
if x = 1
see "one" + nl
elseif x=2
see "two" + nl
elseif x=3
see "three" + nl
end
see "for loop.." + nl
for t = 1 to 10
see t
end
see nl
see "switch..." + nl
x = 1
switch x
on 1 see "one" + nl
on 2 see "two" + nl
end
65.8. Using the ‘else’ keyword as ‘other’ in switch statement 758
Ring Documentation, Release 1.7
see "try catch..." + nl
try
x = 1 / 0
catch
see "catching error" + nl
end
Output:
if statement..
one
for loop..
12345678910
switch...
one
try catch...
catching error
65.10 Using braces to start and end different control structures
We can use braces { } to start and end different control structures
• If statement
• For loop
• Switch
• While
• Try-Catch
Example:
see "if statement.." + nl
x = 1
if x = 1 {
see "one" + nl
elseif x=2
see "two" + nl
elseif x=3
see "three" + nl
}
see "for loop.." + nl
for t = 1 to 10 {
see t
}
see nl
see "switch..." + nl
x = 1
switch x {
on 1 see "one" + nl
on 2 see "two" + nl
}
see "try catch..." + nl
try {
65.10. Using braces to start and end different control structures 759
Ring Documentation, Release 1.7
x = 1 / 0
catch
see "catching error" + nl
}
Output:
if statement..
one
for loop..
12345678910
switch...
one
try catch...
catching error
65.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’
We can replace the ‘see’ keyword with the ‘put’ keyword.
Also we can replacew the ‘give’ keyword with the ‘get’ keyword.
Example:
put "Hello World" + nl
put "Enter Your Name ? " Get Name
Put "Hello " + Name
65.12 Using ‘case’ as ‘on’ in switch statements
We can replace the ‘on’ keyword with ‘case’ keyword in the switch statement.
Example (1) :
for x=1 to 10
switch x
case 1 put "one" + nl
case 2 put "two" + nl
case 3 put "thre" + nl
else put "else" + nl
end
end
Example (2) :
for x=1 to 10 {
switch x {
case 1 put "one" + nl
case 2 put "two" + nl
case 3 put "thre" + nl
else put "else" + nl
}
}
65.11. Using ‘put’ and ‘get’ as ‘see’ and ‘give’ 760
Ring Documentation, Release 1.7
65.13 Using ‘def’ as ‘func’ in functions/methods definition
We can use the ‘def’ keyword as the ‘func’ keyword to define functions and methods.
Example:
one() two()
def one put "one" + nl
def two put "two" + nl
65.14 Using braces { } in Packages/Classes/Functions
Example:
load "stdlib.ring"
import mypackage
new myclass {
myfunc()
}
package mypackage
{
class myclass
{
func myfunc
{
print("Hello, World!n")
}
}
}
65.15 Using ‘end’ keyword after Packages/Classes/Functions
Example:
import mypackage
new myclass {
myfunc()
}
package mypackage
class myclass
def myfunc
put "Hello, World!"
end
end
end
65.13. Using ‘def’ as ‘func’ in functions/methods definition 761

More Related Content

What's hot

The Ring programming language version 1.9 book - Part 86 of 210
The Ring programming language version 1.9 book - Part 86 of 210The Ring programming language version 1.9 book - Part 86 of 210
The Ring programming language version 1.9 book - Part 86 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.5.4 book - Part 75 of 185The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.5.4 book - Part 75 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 85 of 184
The Ring programming language version 1.5.3 book - Part 85 of 184The Ring programming language version 1.5.3 book - Part 85 of 184
The Ring programming language version 1.5.3 book - Part 85 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196Mahmoud Samir Fayed
 
'Getting' Clojure - '(parentheses are just hugs for your code)
'Getting' Clojure - '(parentheses are just hugs for your code)'Getting' Clojure - '(parentheses are just hugs for your code)
'Getting' Clojure - '(parentheses are just hugs for your code)Gary Trakhman
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 41 of 189
The Ring programming language version 1.6 book - Part 41 of 189The Ring programming language version 1.6 book - Part 41 of 189
The Ring programming language version 1.6 book - Part 41 of 189Mahmoud Samir Fayed
 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestHoward Lewis Ship
 
The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212Mahmoud Samir Fayed
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)martincabrera
 
C++ course start
C++ course startC++ course start
C++ course startNet3lem
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 37 of 180
The Ring programming language version 1.5.1 book - Part 37 of 180The Ring programming language version 1.5.1 book - Part 37 of 180
The Ring programming language version 1.5.1 book - Part 37 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196Mahmoud Samir Fayed
 
TDD by Controlling Dependencies
TDD by Controlling DependenciesTDD by Controlling Dependencies
TDD by Controlling DependenciesJorge Ortiz
 
The Ring programming language version 1.5.1 book - Part 74 of 180
The Ring programming language version 1.5.1 book - Part 74 of 180The Ring programming language version 1.5.1 book - Part 74 of 180
The Ring programming language version 1.5.1 book - Part 74 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196Mahmoud Samir Fayed
 

What's hot (20)

The Ring programming language version 1.9 book - Part 86 of 210
The Ring programming language version 1.9 book - Part 86 of 210The Ring programming language version 1.9 book - Part 86 of 210
The Ring programming language version 1.9 book - Part 86 of 210
 
The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.5.4 book - Part 75 of 185The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.5.4 book - Part 75 of 185
 
The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.5.2 book - Part 13 of 181
 
The Ring programming language version 1.5.3 book - Part 85 of 184
The Ring programming language version 1.5.3 book - Part 85 of 184The Ring programming language version 1.5.3 book - Part 85 of 184
The Ring programming language version 1.5.3 book - Part 85 of 184
 
The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.7 book - Part 30 of 196
 
'Getting' Clojure - '(parentheses are just hugs for your code)
'Getting' Clojure - '(parentheses are just hugs for your code)'Getting' Clojure - '(parentheses are just hugs for your code)
'Getting' Clojure - '(parentheses are just hugs for your code)
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212
 
The Ring programming language version 1.6 book - Part 41 of 189
The Ring programming language version 1.6 book - Part 41 of 189The Ring programming language version 1.6 book - Part 41 of 189
The Ring programming language version 1.6 book - Part 41 of 189
 
Spock: A Highly Logical Way To Test
Spock: A Highly Logical Way To TestSpock: A Highly Logical Way To Test
Spock: A Highly Logical Way To Test
 
The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212
 
Spockを使おう!
Spockを使おう!Spockを使おう!
Spockを使おう!
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)
 
C++ course start
C++ course startC++ course start
C++ course start
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181
 
Grails Transactions
Grails TransactionsGrails Transactions
Grails Transactions
 
The Ring programming language version 1.5.1 book - Part 37 of 180
The Ring programming language version 1.5.1 book - Part 37 of 180The Ring programming language version 1.5.1 book - Part 37 of 180
The Ring programming language version 1.5.1 book - Part 37 of 180
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196
 
TDD by Controlling Dependencies
TDD by Controlling DependenciesTDD by Controlling Dependencies
TDD by Controlling Dependencies
 
The Ring programming language version 1.5.1 book - Part 74 of 180
The Ring programming language version 1.5.1 book - Part 74 of 180The Ring programming language version 1.5.1 book - Part 74 of 180
The Ring programming language version 1.5.1 book - Part 74 of 180
 
The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196
 

Similar to The Ring programming language version 1.7 book - Part 79 of 196

The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.6 book - Part 16 of 189The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.6 book - Part 16 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.7 book - Part 17 of 196The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.7 book - Part 17 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 9 of 196
The Ring programming language version 1.7 book - Part 9 of 196The Ring programming language version 1.7 book - Part 9 of 196
The Ring programming language version 1.7 book - Part 9 of 196Mahmoud Samir Fayed
 
PE1 Module 4.ppt
PE1 Module 4.pptPE1 Module 4.ppt
PE1 Module 4.pptbalewayalew
 
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 189 of 194
The Ring programming language version 1.5.3 book - Part 189 of 194The Ring programming language version 1.5.3 book - Part 189 of 194
The Ring programming language version 1.5.3 book - Part 189 of 194Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.3 book - Part 6 of 88The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.3 book - Part 6 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 5 of 31
The Ring programming language version 1.4.1 book - Part 5 of 31The Ring programming language version 1.4.1 book - Part 5 of 31
The Ring programming language version 1.4.1 book - Part 5 of 31Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31Mahmoud Samir Fayed
 
Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Dave Hulbert
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184Mahmoud Samir Fayed
 

Similar to The Ring programming language version 1.7 book - Part 79 of 196 (20)

The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185The Ring programming language version 1.5.4 book - Part 74 of 185
The Ring programming language version 1.5.4 book - Part 74 of 185
 
The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184The Ring programming language version 1.5.3 book - Part 14 of 184
The Ring programming language version 1.5.3 book - Part 14 of 184
 
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
 
The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210The Ring programming language version 1.9 book - Part 20 of 210
The Ring programming language version 1.9 book - Part 20 of 210
 
The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.6 book - Part 16 of 189The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.6 book - Part 16 of 189
 
The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202The Ring programming language version 1.8 book - Part 18 of 202
The Ring programming language version 1.8 book - Part 18 of 202
 
The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196
 
The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.7 book - Part 17 of 196The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.7 book - Part 17 of 196
 
The Ring programming language version 1.7 book - Part 9 of 196
The Ring programming language version 1.7 book - Part 9 of 196The Ring programming language version 1.7 book - Part 9 of 196
The Ring programming language version 1.7 book - Part 9 of 196
 
PE1 Module 4.ppt
PE1 Module 4.pptPE1 Module 4.ppt
PE1 Module 4.ppt
 
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.5.1 book - Part 13 of 180
 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180
 
The Ring programming language version 1.5.3 book - Part 189 of 194
The Ring programming language version 1.5.3 book - Part 189 of 194The Ring programming language version 1.5.3 book - Part 189 of 194
The Ring programming language version 1.5.3 book - Part 189 of 194
 
The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210
 
The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.3 book - Part 6 of 88The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.3 book - Part 6 of 88
 
The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84The Ring programming language version 1.2 book - Part 10 of 84
The Ring programming language version 1.2 book - Part 10 of 84
 
The Ring programming language version 1.4.1 book - Part 5 of 31
The Ring programming language version 1.4.1 book - Part 5 of 31The Ring programming language version 1.4.1 book - Part 5 of 31
The Ring programming language version 1.4.1 book - Part 5 of 31
 
The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31
 
Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
 

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

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

The Ring programming language version 1.7 book - Part 79 of 196

  • 1. Ring Documentation, Release 1.7 func f3 see "f3 method" + nl class local Output: ======================================== test method f1 function f2 function f3 method f3 function ======================================== 64.3. Calling a function sharing the name with a method in the current class 752
  • 2. CHAPTER SIXTYFIVE SYNTAX FLEXIBILITY In this chapter we will learn about some options that are provided automatically by the Ring compiler for syntax flexibility. 65.1 Change Language Keywords We can change any keyword using the ChangeRingKeyword command. Note: Remember to restore the keyword again if the team will mix between styles in the same project. Tip: The ChangeRingKeyword command is executed in the scanner stage by the compiler (before parsing). Syntax: ChangeRingKeyword <oldkeyword> <newkeyword> Example: ChangeRingKeyword see print print "welcome" + nl ChangeRingKeyword print see see "Welcome" + nl Example: ChangeRingKeyword func function ChangeRingKeyword see print ChangeRingKeyword ok endif ChangeRingKeyword next endfor ChangeRingKeyword end endwhile x = 10 while x > 0 print "x = " + x + nl for t = 1 to 10 if t = 3 print "number three" + nl endif endfor 753
  • 3. Ring Documentation, Release 1.7 x-- endwhile test() function test print "message from test" + nl ChangeRingKeyword function func ChangeRingKeyword print see ChangeRingKeyword endif ok ChangeRingKeyword endfor next ChangeRingKeyword endwhile end 65.2 Change Language Operators We can change any operator using the ChangeRingOperator command. Note: Remember to restore the operator again if the team will mix between styles in the same project. Tip: The ChangeRingOperartor command is executed in the scanner stage by the compiler (before parsing). Syntax: ChangeRingOperator <oldkeyword> <newkeyword> Example: The next program hide the + operator by changing it to _+ changeringoperator + _+ changeringkeyword SEE PRINT try print 5 + 10 catch print nl print "error" print nl done changeringoperator _+ + The next program change the + operator to “plus”. changeringoperator + plus changeringkeyword SEE PRINT Print 5 plus 5 changeringoperator plus + changeringkeyword PRINT SEE 65.2. Change Language Operators 754
  • 4. Ring Documentation, Release 1.7 65.3 Load Syntax Files You may store a group of ChangeRingKeyword and ChangeRingOperator commands in a file to use later in many source files. You can’t use the Load command to call these files because • ChangeRingKeyword and ChangeRingOperator commands are executed in the scanner phase by the compiler (before parsing). • The load command is executed in the parsing phase (after the scanner phase). Solution: Use the LoadSyntax Command which is executed in the scanner phase. Syntax: LoadSyntax "syntaxfile.ring" Example: File : StyleBasicOn.ring ChangeRingKeyword see print ChangeRingKeyword ok endif ChangeRingKeyword next endfor ChangeRingKeyword end endwhile File : StyleBasicOff.ring ChangeRingKeyword print see ChangeRingKeyword endif ok ChangeRingKeyword endfor next ChangeRingKeyword endwhile end File : UseStyleBasic.ring LoadSyntax "stylebasicon.ring" x = 10 while x > 0 print "x = " + x + nl for t = 1 to 10 if t = 3 print "number three" + nl endif endfor x-- endwhile LoadSyntax "stylebasicoff.ring" see "done" + nl Note: files called by the LoadSyntax command must contains ChangeRingKeyword and ChangeRingOperator com- mands only. Tip: files called by the LoadSyntax command doesn’t support functions, packages and classes. just imperative commands only. Note: Using this feature you can create many styles that you can use in the same project and you can support Ring 65.3. Load Syntax Files 755
  • 5. Ring Documentation, Release 1.7 translation to other languages like Arabic, French and so on. Tip: The effect of LoadSyntax command is related to the current source code file only. 65.4 Using “()” around the function parameters We can use () around the function parameters (optional). Example: hello() sum(3,4) func hello() see "Hello" + nl func sum(x,y) see x+y+nl Output: Hello 7 Example: myfunc = func x,y { see x + y + nl } call myfunc (3,4) myfunc2 = func (x,y) { see x+y+nl } call myfunc(3,4) Output: 7 7 65.5 Using Semi-colon after and between statements In Ring we can use semi-colon after and between statements (optional). Example: # Using semi-colon is optional see "Hello" + nl ; see "How are you?" + nl ; see "Welcome to Ring" + nl ; one() ; two() ; three() ; func one ; see "one" + nl ; func two ; see "two" + nl ; func three ; see "three" + nl ; Output: 65.4. Using “()” around the function parameters 756
  • 6. Ring Documentation, Release 1.7 Hello How are you? Welcome to Ring one two three 65.6 Using $ and @ in the start of the variable name You can use any unicode character in the variable name also we can use $ and @ in the name. This feature may help, for example we can start global variables with $ and the object attributes with @. In other languages like Ruby this is the rule, In the Ring language this is just an option without any force from the Compiler. example: $global_variable = 5 new test { hello() } class test @instance_variable = 10 func hello local_variable = 15 see "Global : " + $global_variable + nl + "Instance : " + @instance_variable + nl + "Local : " + local_variable + nl Output: Global : 5 Instance : 10 Local : 15 65.7 Using the ‘elseif’ keyword as ‘but’ in if statement if you don’t like the ‘but’ keyword in if statement Then you can use the ‘elseif’ keyword. Example: give x if x = 1 see "one" elseif x=2 see "two" elseif x=3 see "three" elseif x=4 see "four" else see "other" ok see nl 65.6. Using $ and @ in the start of the variable name 757
  • 7. Ring Documentation, Release 1.7 65.8 Using the ‘else’ keyword as ‘other’ in switch statement if you don’t like the ‘other’ keyword in switch statement Then you can use the ‘else’ keyword. Also you can replace ‘else’ with ‘other’ in if statement. i.e. ‘other’ keyword is the same as ‘else’ keyword. Example: x = 1 switch x on 10 see "10" + nl else see "not 10" + nl end Output: not 10 65.9 Using the ‘end’ keyword in different control structures We can use the ‘end’ keyword to close different control structures • If statement • For loop • Switch • While • Try-Catch Example: see "if statement.." + nl x = 1 if x = 1 see "one" + nl elseif x=2 see "two" + nl elseif x=3 see "three" + nl end see "for loop.." + nl for t = 1 to 10 see t end see nl see "switch..." + nl x = 1 switch x on 1 see "one" + nl on 2 see "two" + nl end 65.8. Using the ‘else’ keyword as ‘other’ in switch statement 758
  • 8. Ring Documentation, Release 1.7 see "try catch..." + nl try x = 1 / 0 catch see "catching error" + nl end Output: if statement.. one for loop.. 12345678910 switch... one try catch... catching error 65.10 Using braces to start and end different control structures We can use braces { } to start and end different control structures • If statement • For loop • Switch • While • Try-Catch Example: see "if statement.." + nl x = 1 if x = 1 { see "one" + nl elseif x=2 see "two" + nl elseif x=3 see "three" + nl } see "for loop.." + nl for t = 1 to 10 { see t } see nl see "switch..." + nl x = 1 switch x { on 1 see "one" + nl on 2 see "two" + nl } see "try catch..." + nl try { 65.10. Using braces to start and end different control structures 759
  • 9. Ring Documentation, Release 1.7 x = 1 / 0 catch see "catching error" + nl } Output: if statement.. one for loop.. 12345678910 switch... one try catch... catching error 65.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’ We can replace the ‘see’ keyword with the ‘put’ keyword. Also we can replacew the ‘give’ keyword with the ‘get’ keyword. Example: put "Hello World" + nl put "Enter Your Name ? " Get Name Put "Hello " + Name 65.12 Using ‘case’ as ‘on’ in switch statements We can replace the ‘on’ keyword with ‘case’ keyword in the switch statement. Example (1) : for x=1 to 10 switch x case 1 put "one" + nl case 2 put "two" + nl case 3 put "thre" + nl else put "else" + nl end end Example (2) : for x=1 to 10 { switch x { case 1 put "one" + nl case 2 put "two" + nl case 3 put "thre" + nl else put "else" + nl } } 65.11. Using ‘put’ and ‘get’ as ‘see’ and ‘give’ 760
  • 10. Ring Documentation, Release 1.7 65.13 Using ‘def’ as ‘func’ in functions/methods definition We can use the ‘def’ keyword as the ‘func’ keyword to define functions and methods. Example: one() two() def one put "one" + nl def two put "two" + nl 65.14 Using braces { } in Packages/Classes/Functions Example: load "stdlib.ring" import mypackage new myclass { myfunc() } package mypackage { class myclass { func myfunc { print("Hello, World!n") } } } 65.15 Using ‘end’ keyword after Packages/Classes/Functions Example: import mypackage new myclass { myfunc() } package mypackage class myclass def myfunc put "Hello, World!" end end end 65.13. Using ‘def’ as ‘func’ in functions/methods definition 761