SlideShare a Scribd company logo
Ring Documentation, Release 1.5.4
Func Test
see "Message from the test function!" + nl
Func Times nCount,F
for x = 1 to nCount
Call F()
next
Output:
Message from the test function!
Message from the test function!
Message from the test function!
Message from the test function!
Message from the test function!
40.4 Anonymous and Nested Functions
Anonymous Functions are functions without names that can be passed as parameters to other functions or stored in
variables.
Syntax:
Func [Parameters] { [statements] }
Example:
test( func x,y {
see "hello" + nl
see "Sum : " + (x+y) + nl
} )
new great { f1() }
times(3, func { see "hello world" + nl } )
func test x
call x(3,3)
see "wow!" + nl
func times n,x
for t=1 to n
call x()
next
Class great
func f1
f2( func { see "Message from f1" + nl } )
func f2 x
call x()
Output:
hello
Sum : 6
40.4. Anonymous and Nested Functions 285
Ring Documentation, Release 1.5.4
wow!
Message from f1
hello world
hello world
hello world
Example:
Func Main
aList = [1,2,3,4]
Map (aList , func x {
return x*x
} )
see aList
aList = [4,9,14,25]
Map(aList, :myfilter )
see aList
aList = [11,12,13,14]
Map (aList , func x {
if x%2=0
return "even"
else
return "odd"
ok
})
see aList
Func myfilter x
if x = 9
return "True"
else
return "False"
ok
Func Map aList,cFunc
for x in aList
x = call cFunc(x)
next
Output:
1
4
9
16
False
True
False
False
odd
even
odd
even
40.5 Equality of functions
We can test if function = function or not using the ‘=’ or ‘!=’ operators
40.5. Equality of functions 286
Ring Documentation, Release 1.5.4
Example:
f1 = func { see "hello" + nl }
f2 = func { see "how are you?" + nl }
f3 = f1
call f1()
call f2()
call f3()
see (f1 = f2) + nl
see (f2 = f3) + nl
see (f1 = f3) + nl
Output:
hello
how are you?
hello
0
0
1
40.5. Equality of functions 287
CHAPTER
FORTYONE
REFLECTION AND META-PROGRAMMING
Since the Ring programming language is a dynamic language, we can get answers about the program code and we can
modify our code during the runtime.
In this chapter we will learn about this and the available functions to use.
41.1 locals() Function
We can get a list of variables names in the current scope using the locals() function.
Syntax:
locals() --> a list contains the variables names in the current scope
Example:
test("hello")
func test cMsg
see cMsg + nl
x = 10
y = 20
z = 30
see locals()
Output:
hello
cmsg
x
y
z
41.2 globals() Function
We can get a list of variables names in the global scope using the globals() function.
Syntax:
288
Ring Documentation, Release 1.5.4
globals() --> a list contains variables names in the global scope
Example:
x=10 y=20 z=30
test()
func test
see "message from test()" + nl +
"Global Variables:" + nl
see globals()
Output:
message from test()
Global Variables:
x
y
z
41.3 functions() Function
We can get a list of functions names written in the Ring language using the functions() function.
Syntax:
functions() --> a list contains functions names
Example:
see functions()
func f1
see "f1" + nl
func f2
see "f2" + nl
func f3
see "f3" + nl
Output:
f1
f2
f3
41.4 cfunctions() Function
We can get a list of functions names written in the C language using the cfunctions() function.
Syntax:
cfunctions() --> a list contains functions names
Example:
41.3. functions() Function 289
Ring Documentation, Release 1.5.4
aList = cfunctions()
See "Count : " + len(aList) + nl
for x in aList
see x + "()" + nl
next
Output:
Count : 197
len()
add()
del()
get()
clock()
...
Note: The complete list is removed from the previous output.
41.5 islocal() Function
We can check if a variable is defined in the local scope or not using the islocal() function.
Syntax:
islocal(cVariableName) --> returns 1 if the variable is defined in the local scope
returns 0 if the variable is not defined in the local scope
Example:
test()
func test
x=10 y=20
see islocal("x") + nl +
islocal("y") + nl +
islocal("z") + nl
Output:
1
1
0
41.6 isglobal() Function
We can check if a variable is defined in the global scope or not using the isglobal() function.
Syntax:
isglobal(cVariableName) --> returns 1 if the variable is defined in the global scope
returns 0 if the variable is not defined in the global scope
Example:
41.5. islocal() Function 290
Ring Documentation, Release 1.5.4
x=10 y=20
test()
func test
see isglobal("x") + nl +
isglobal("y") + nl +
isglobal("z") + nl
Output:
1
1
0
41.7 isfunction() Function
We can check if a Ring function is defined or not using the isfunction() function.
Syntax:
isfunction(cFunctionName) --> returns 1 if the Ring function is defined
returns 0 if the Ring function is not defined
Example:
see isfunction("f1") + nl +
isfunction("f2") + nl +
isfunction("f3") + nl
func f1
see "message from f1()" + nl
func f2
see "message from f2()" + nl
Output:
1
1
0
41.8 iscfunction() Function
We can check if a C function is defined or not using the iscfunction() function.
Syntax:
iscfunction(cFunctionName) --> returns 1 if the C function is defined
returns 0 if the C function is not defined
Example:
see iscfunction("len") + nl +
iscfunction("add") + nl +
iscfunction("test") + nl
41.7. isfunction() Function 291
Ring Documentation, Release 1.5.4
Output:
1
1
0
41.9 packages() Function
We can get a list of packages names using the packages() function.
Syntax:
packages() --> a list contains packages names
Example:
See packages()
Package Package1
Class class1
Func f1
Package Package2
Class class1
Func f1
Package Package3
Class class1
Func f1
Package Package4
Class class1
Func f1
Output:
package1
package2
package3
package4
41.10 ispackage() Function
We can check if a package is defined or not using the ispackage() function.
Syntax:
ispackage(cPackageName) --> returns 1 if the Package is defined
returns 0 if the Package is not defined
Example:
See ispackage("package1") + nl +
ispackage("package4") + nl +
ispackage("package5") + nl +
ispackage("package3") + nl
41.9. packages() Function 292
Ring Documentation, Release 1.5.4
Package Package1
Class class1
Func f1
Package Package2
Class class1
Func f1
Package Package3
Class class1
Func f1
Package Package4
Class class1
Func f1
Output:
1
1
0
1
41.11 classes() Function
We can get a list of classes names using the classes() function.
Syntax:
classes() --> a list contains classes names
Example:
See classes()
Class class1
Func f1
Class class2
Func f1
Class class3
Func f1
Output:
class1
class2
class3
41.12 isclass() Function
We can check if a class is defined or not using the isclass() function.
Syntax:
41.11. classes() Function 293
Ring Documentation, Release 1.5.4
isclass(cClassName) --> returns 1 if the Class is defined
returns 0 if the Class is not defined
Example:
see isclass("class4") + nl +
isclass("class3") + nl +
isclass("class2") + nl
Class class1
func f1
class class2
func f1
class class3
func f1
Output:
0
1
1
41.13 packageclasses() Function
We can get a list of classes names inside a package using the packageclasses() function.
Syntax:
packageclasses(cPackageName) --> a list contains classes names inside the package
Example:
see "classes in Package1" + nl
see packageclasses("Package1")
see "classes in Package2" + nl
see packageclasses("Package2")
Package Package1
Class class1
Func f1
Package Package2
Class class1
Func f1
Class class2
Func f1
Class class3
func f1
Output:
classes in Package1
class1
classes in Package2
class1
41.13. packageclasses() Function 294

More Related Content

PDF
The Ring programming language version 1.3 book - Part 23 of 88
PDF
The Ring programming language version 1.5.3 book - Part 32 of 184
PDF
The Ring programming language version 1.5.2 book - Part 31 of 181
PDF
The Ring programming language version 1.9 book - Part 40 of 210
PDF
The Ring programming language version 1.6 book - Part 34 of 189
PDF
The Ring programming language version 1.8 book - Part 37 of 202
PDF
The Ring programming language version 1.4.1 book - Part 9 of 31
PDF
The Ring programming language version 1.2 book - Part 21 of 84
The Ring programming language version 1.3 book - Part 23 of 88
The Ring programming language version 1.5.3 book - Part 32 of 184
The Ring programming language version 1.5.2 book - Part 31 of 181
The Ring programming language version 1.9 book - Part 40 of 210
The Ring programming language version 1.6 book - Part 34 of 189
The Ring programming language version 1.8 book - Part 37 of 202
The Ring programming language version 1.4.1 book - Part 9 of 31
The Ring programming language version 1.2 book - Part 21 of 84

What's hot (20)

PDF
The Ring programming language version 1.7 book - Part 35 of 196
PDF
The Ring programming language version 1.10 book - Part 42 of 212
PDF
The Ring programming language version 1.7 book - Part 36 of 196
PDF
The Ring programming language version 1.5.1 book - Part 74 of 180
PDF
The Ring programming language version 1.7 book - Part 30 of 196
PDF
The Ring programming language version 1.6 book - Part 81 of 189
PDF
The Ring programming language version 1.3 book - Part 6 of 88
PDF
The Ring programming language version 1.5.1 book - Part 31 of 180
PDF
The Ring programming language version 1.8 book - Part 38 of 202
PDF
The Ring programming language version 1.10 book - Part 35 of 212
PDF
The Ring programming language version 1.10 book - Part 41 of 212
PDF
The Ring programming language version 1.5.4 book - Part 78 of 185
PDF
FP in Java - Project Lambda and beyond
PDF
The Ring programming language version 1.5.2 book - Part 26 of 181
PDF
The Ring programming language version 1.5.1 book - Part 32 of 180
PDF
OOP and FP - Become a Better Programmer
PDF
From object oriented to functional domain modeling
PDF
The Ring programming language version 1.6 book - Part 184 of 189
PDF
Laziness, trampolines, monoids and other functional amenities: this is not yo...
PPTX
Unit Testing with Foq
The Ring programming language version 1.7 book - Part 35 of 196
The Ring programming language version 1.10 book - Part 42 of 212
The Ring programming language version 1.7 book - Part 36 of 196
The Ring programming language version 1.5.1 book - Part 74 of 180
The Ring programming language version 1.7 book - Part 30 of 196
The Ring programming language version 1.6 book - Part 81 of 189
The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.5.1 book - Part 31 of 180
The Ring programming language version 1.8 book - Part 38 of 202
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 41 of 212
The Ring programming language version 1.5.4 book - Part 78 of 185
FP in Java - Project Lambda and beyond
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.1 book - Part 32 of 180
OOP and FP - Become a Better Programmer
From object oriented to functional domain modeling
The Ring programming language version 1.6 book - Part 184 of 189
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Unit Testing with Foq
Ad

Similar to The Ring programming language version 1.5.4 book - Part 32 of 185 (20)

PDF
The Ring programming language version 1.5.1 book - Part 30 of 180
PDF
The Ring programming language version 1.5.2 book - Part 33 of 181
PDF
The Ring programming language version 1.8 book - Part 39 of 202
PDF
The Ring programming language version 1.3 book - Part 25 of 88
PDF
The Ring programming language version 1.6 book - Part 36 of 189
PDF
The Ring programming language version 1.4 book - Part 6 of 30
PDF
The Ring programming language version 1.9 book - Part 42 of 210
PDF
The Ring programming language version 1.5.3 book - Part 34 of 184
PDF
The Ring programming language version 1.2 book - Part 23 of 84
PDF
The Ring programming language version 1.5.4 book - Part 34 of 185
PDF
The Ring programming language version 1.2 book - Part 13 of 84
PDF
The Ring programming language version 1.9 book - Part 31 of 210
PDF
The Ring programming language version 1.10 book - Part 32 of 212
PDF
The Ring programming language version 1.3 book - Part 15 of 88
PDF
The Ring programming language version 1.5.4 book - Part 35 of 185
PDF
The Ring programming language version 1.7 book - Part 38 of 196
PDF
The Ring programming language version 1.3 book - Part 18 of 88
PDF
The Ring programming language version 1.3 book - Part 13 of 88
PDF
The Ring programming language version 1.7 book - Part 27 of 196
PDF
The Ring programming language version 1.10 book - Part 43 of 212
The Ring programming language version 1.5.1 book - Part 30 of 180
The Ring programming language version 1.5.2 book - Part 33 of 181
The Ring programming language version 1.8 book - Part 39 of 202
The Ring programming language version 1.3 book - Part 25 of 88
The Ring programming language version 1.6 book - Part 36 of 189
The Ring programming language version 1.4 book - Part 6 of 30
The Ring programming language version 1.9 book - Part 42 of 210
The Ring programming language version 1.5.3 book - Part 34 of 184
The Ring programming language version 1.2 book - Part 23 of 84
The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.2 book - Part 13 of 84
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.10 book - Part 32 of 212
The Ring programming language version 1.3 book - Part 15 of 88
The Ring programming language version 1.5.4 book - Part 35 of 185
The Ring programming language version 1.7 book - Part 38 of 196
The Ring programming language version 1.3 book - Part 18 of 88
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.7 book - Part 27 of 196
The Ring programming language version 1.10 book - Part 43 of 212
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 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 210 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 205 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 203 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 200 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 197 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 194 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

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

The Ring programming language version 1.5.4 book - Part 32 of 185

  • 1. Ring Documentation, Release 1.5.4 Func Test see "Message from the test function!" + nl Func Times nCount,F for x = 1 to nCount Call F() next Output: Message from the test function! Message from the test function! Message from the test function! Message from the test function! Message from the test function! 40.4 Anonymous and Nested Functions Anonymous Functions are functions without names that can be passed as parameters to other functions or stored in variables. Syntax: Func [Parameters] { [statements] } Example: test( func x,y { see "hello" + nl see "Sum : " + (x+y) + nl } ) new great { f1() } times(3, func { see "hello world" + nl } ) func test x call x(3,3) see "wow!" + nl func times n,x for t=1 to n call x() next Class great func f1 f2( func { see "Message from f1" + nl } ) func f2 x call x() Output: hello Sum : 6 40.4. Anonymous and Nested Functions 285
  • 2. Ring Documentation, Release 1.5.4 wow! Message from f1 hello world hello world hello world Example: Func Main aList = [1,2,3,4] Map (aList , func x { return x*x } ) see aList aList = [4,9,14,25] Map(aList, :myfilter ) see aList aList = [11,12,13,14] Map (aList , func x { if x%2=0 return "even" else return "odd" ok }) see aList Func myfilter x if x = 9 return "True" else return "False" ok Func Map aList,cFunc for x in aList x = call cFunc(x) next Output: 1 4 9 16 False True False False odd even odd even 40.5 Equality of functions We can test if function = function or not using the ‘=’ or ‘!=’ operators 40.5. Equality of functions 286
  • 3. Ring Documentation, Release 1.5.4 Example: f1 = func { see "hello" + nl } f2 = func { see "how are you?" + nl } f3 = f1 call f1() call f2() call f3() see (f1 = f2) + nl see (f2 = f3) + nl see (f1 = f3) + nl Output: hello how are you? hello 0 0 1 40.5. Equality of functions 287
  • 4. CHAPTER FORTYONE REFLECTION AND META-PROGRAMMING Since the Ring programming language is a dynamic language, we can get answers about the program code and we can modify our code during the runtime. In this chapter we will learn about this and the available functions to use. 41.1 locals() Function We can get a list of variables names in the current scope using the locals() function. Syntax: locals() --> a list contains the variables names in the current scope Example: test("hello") func test cMsg see cMsg + nl x = 10 y = 20 z = 30 see locals() Output: hello cmsg x y z 41.2 globals() Function We can get a list of variables names in the global scope using the globals() function. Syntax: 288
  • 5. Ring Documentation, Release 1.5.4 globals() --> a list contains variables names in the global scope Example: x=10 y=20 z=30 test() func test see "message from test()" + nl + "Global Variables:" + nl see globals() Output: message from test() Global Variables: x y z 41.3 functions() Function We can get a list of functions names written in the Ring language using the functions() function. Syntax: functions() --> a list contains functions names Example: see functions() func f1 see "f1" + nl func f2 see "f2" + nl func f3 see "f3" + nl Output: f1 f2 f3 41.4 cfunctions() Function We can get a list of functions names written in the C language using the cfunctions() function. Syntax: cfunctions() --> a list contains functions names Example: 41.3. functions() Function 289
  • 6. Ring Documentation, Release 1.5.4 aList = cfunctions() See "Count : " + len(aList) + nl for x in aList see x + "()" + nl next Output: Count : 197 len() add() del() get() clock() ... Note: The complete list is removed from the previous output. 41.5 islocal() Function We can check if a variable is defined in the local scope or not using the islocal() function. Syntax: islocal(cVariableName) --> returns 1 if the variable is defined in the local scope returns 0 if the variable is not defined in the local scope Example: test() func test x=10 y=20 see islocal("x") + nl + islocal("y") + nl + islocal("z") + nl Output: 1 1 0 41.6 isglobal() Function We can check if a variable is defined in the global scope or not using the isglobal() function. Syntax: isglobal(cVariableName) --> returns 1 if the variable is defined in the global scope returns 0 if the variable is not defined in the global scope Example: 41.5. islocal() Function 290
  • 7. Ring Documentation, Release 1.5.4 x=10 y=20 test() func test see isglobal("x") + nl + isglobal("y") + nl + isglobal("z") + nl Output: 1 1 0 41.7 isfunction() Function We can check if a Ring function is defined or not using the isfunction() function. Syntax: isfunction(cFunctionName) --> returns 1 if the Ring function is defined returns 0 if the Ring function is not defined Example: see isfunction("f1") + nl + isfunction("f2") + nl + isfunction("f3") + nl func f1 see "message from f1()" + nl func f2 see "message from f2()" + nl Output: 1 1 0 41.8 iscfunction() Function We can check if a C function is defined or not using the iscfunction() function. Syntax: iscfunction(cFunctionName) --> returns 1 if the C function is defined returns 0 if the C function is not defined Example: see iscfunction("len") + nl + iscfunction("add") + nl + iscfunction("test") + nl 41.7. isfunction() Function 291
  • 8. Ring Documentation, Release 1.5.4 Output: 1 1 0 41.9 packages() Function We can get a list of packages names using the packages() function. Syntax: packages() --> a list contains packages names Example: See packages() Package Package1 Class class1 Func f1 Package Package2 Class class1 Func f1 Package Package3 Class class1 Func f1 Package Package4 Class class1 Func f1 Output: package1 package2 package3 package4 41.10 ispackage() Function We can check if a package is defined or not using the ispackage() function. Syntax: ispackage(cPackageName) --> returns 1 if the Package is defined returns 0 if the Package is not defined Example: See ispackage("package1") + nl + ispackage("package4") + nl + ispackage("package5") + nl + ispackage("package3") + nl 41.9. packages() Function 292
  • 9. Ring Documentation, Release 1.5.4 Package Package1 Class class1 Func f1 Package Package2 Class class1 Func f1 Package Package3 Class class1 Func f1 Package Package4 Class class1 Func f1 Output: 1 1 0 1 41.11 classes() Function We can get a list of classes names using the classes() function. Syntax: classes() --> a list contains classes names Example: See classes() Class class1 Func f1 Class class2 Func f1 Class class3 Func f1 Output: class1 class2 class3 41.12 isclass() Function We can check if a class is defined or not using the isclass() function. Syntax: 41.11. classes() Function 293
  • 10. Ring Documentation, Release 1.5.4 isclass(cClassName) --> returns 1 if the Class is defined returns 0 if the Class is not defined Example: see isclass("class4") + nl + isclass("class3") + nl + isclass("class2") + nl Class class1 func f1 class class2 func f1 class class3 func f1 Output: 0 1 1 41.13 packageclasses() Function We can get a list of classes names inside a package using the packageclasses() function. Syntax: packageclasses(cPackageName) --> a list contains classes names inside the package Example: see "classes in Package1" + nl see packageclasses("Package1") see "classes in Package2" + nl see packageclasses("Package2") Package Package1 Class class1 Func f1 Package Package2 Class class1 Func f1 Class class2 Func f1 Class class3 func f1 Output: classes in Package1 class1 classes in Package2 class1 41.13. packageclasses() Function 294