SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.8
Start the test!
Let us try having an error
Line 1 Error (R24) : Using uninitialized variable : x
in file Ring_EmbeddedCode
End of test!
5. The compiler will ignore new lines after keywords that expect tokens after it
Example:
see
"
Hello, World!
"
test()
func
#======================#
Test
#======================#
?
"
Hello from the Test function
"
Output:
Hello, World!
Hello from the Test function
6. Better code (faster) for the main loop, special loop for eval() function.
7. Better code (faster) for tracking C pointers to avoid using NULL pointers.
8. Better code (faster) for getting the self object using braces.
4.18 Notes to extensions creators
If you have created new extensions for Ring in the C/C++ languages.
You have to rebuild your extension (Generate the DLL file again using Ring 1.8 header files) before usage with Ring
1.8
Because we changed the internal structure of the VM, but no changes to the code are required. just rebuild.
4.18. Notes to extensions creators 51
CHAPTER
FIVE
WHAT IS NEW IN RING 1.7?
In this chapter we will learn about the changes and new features in Ring 1.7 release.
5.1 List of changes and new features
Ring 1.7 comes with many new features!
• New Command: Load Package
• ringvm_see() and ringvm_give() functions
• ring_state_new() and ring_state_mainfile() functions
• Better Trace Library
• Better Ring Notepad
• Better RingQt
• Better Ring2EXE
• Better RingZip
• Better Documentation
• Better Ring VM
• RingLibuv Extension
5.2 New Command: Load Package
Using the ‘load’ command we can use many ring source files in the same project
But all of these files will share the same global scope
Now we have the “Load Package” command too
Using “Load Package” we can load a library (*.ring file) in new global scope
This is very useful to create libraries that avoid conflicts in global variables
Example:
File: loadpackage.ring
52
Ring Documentation, Release 1.8
x = 100
? "Hello, World!"
load package "testloadpackage.ring"
? x
test()
File: testloadpackage.ring
? "Hello from testloadpackage.ring"
x = 1000
test()
func test
? x
Output:
Hello, World!
Hello from testloadpackage.ring
1000
100
1000
5.3 ringvm_see() and ringvm_give() functions
Using the ringvm_see() function we can redefine the behavior of the See command
Also we can use ring_see() to have the original behavior
Example:
see "Hello world" + nl
see 123 + nl
see ["one","two","three"]
see new point {x=10 y=20 z=30}
func ringvm_see t
ring_see("We want to print: ")
ring_See(t)
class point x y z
Output:
We want to print: Hello world
We want to print: 123
We want to print: one
two
three
We want to print: x: 10.000000
y: 20.000000
z: 30.000000
Using the ringvm_give() function we can redefine the behavior of the Give command
Also we can use ring_give() to have the original behavior
5.3. ringvm_see() and ringvm_give() functions 53
Ring Documentation, Release 1.8
Example:
see "Name: " give name
see "Hello " + name
func ringvm_give
see "Mahmoud" + nl
return "Mahmoud"
Output:
Name: Mahmoud
Hello Mahmoud
5.4 ring_state_new() and ring_state_mainfile() functions
Using ring_state_new() and ring_state_mainfile() we can run Ring programs from Ring programs
But unlike ring_state_main(), Here we can control when to delete the Ring state!
This is important when we run GUI programs from GUI programs
Because they will share the GUI Library (RingQt), And In this case the caller will call
qApp.Exec()
So the sub program, will not stop and will return to the Main program
Here deleting the State of the sub programs will lead to a problem when we run the sub program events
So keeping the state is important for sub GUI programs hosted in GUI programs.
5.5 Better Trace Library
The Trace library is updated, In the Debugger at break points we have now the “callstack” command
This command will print the functions call stack.
Example:
load "tracelib.ring"
func main
? "Hello from main!"
test1()
func test1
? "Hello from test1!"
test2()
func test2
? "Hello from test2!"
test3()
func test3
? "Hello from test3!"
breakpoint()
5.4. ring_state_new() and ring_state_mainfile() functions 54
Ring Documentation, Release 1.8
5.6 Better Ring Notepad
Ring Notepad comes with the next updates
1. Support *.cf extension
2. Using Hash function (SHA256) for better “Save Changes?” message
3. Ring Notepad - X Button - Ask for saving changes?
5.7 Better RingQt
The next classes are added to RingQt
1. QStackedWidget
2. QCalendarWidget
3. QOpenGLFunctions
4. QOpenGLContext
5. QSurfaceFormat
6. QOpenGLWidget
7. QOpenGLVersionProfile
8. QOpenGLFunctions_3_2_Core
9. QVector2D
10. QVector3D
11. QVector4D
5.6. Better Ring Notepad 55
Ring Documentation, Release 1.8
12. QQuaternion
13. QMatrix4x4
14. QOpenGLPaintDevice
15. QPaintDevice
16. QOpenGLTimerQuery
17. QOpenGLDebugLogger
18. QOpenGLFramebufferObject
19. QOpenGLVertexArrayObject
20. QOpenGLBuffer
21. QOpenGLShaderProgram
22. QOpenGLShader
23. QOpenGLTexture
5.8 Better Ring2EXE
Ring2EXE is updated to works as expected when we don’t have a C/C++ compiler
Where we can distribute applications and get (exe file and ringo file) in this case.
5.9 Better RingZip
The library is updated to support extracting files contains sub folders!
5.10 Better Documentation
1. RingQt Classes Chapter - The classes are sorted.
5.11 Better Ring VM
1. Better Error Message
2. List2Str() function support lists contains numbers
3. Correct support for numbers contains _ as separator
4. Creating lists without variables (statement –> Expression –> List)
5. IsNULL() - Not case sensitive - treat Null and null like NULL
6. Support adding the Self object to an attribute in this object
7. Using ‘:’ operator then keyword will create lower case literal
8. Printing objects - respect decimals() function
9. When literal is not closed - determine the start of the literal
5.8. Better Ring2EXE 56
Ring Documentation, Release 1.8
10. Better message when printing objects contains lists
11. VarPtr() - Support getting a pointer to variables in the local scope
12. replace performance instructions with normal instructions when creating new threads
5.12 RingLibuv Extension
Ring 1.7 comes with the RingLibuv extension
Libuv is a multi-platform support library with a focus on asynchronous I/O.
Example (Events Loop):
load "libuv.ring"
counter = 0
idler = NULL
func main
idler = new_uv_idle_t()
uv_idle_init(uv_default_loop(), idler)
uv_idle_start(idler, "wait()")
? "Idling..."
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
uv_loop_close(uv_default_loop());
destroy_uv_idle_t(idler)
func wait
counter++
if counter >= 100000
uv_idle_stop(idler)
ok
Output:
Idling...
Example (Server):
load "libuv.ring"
load "objectslib.ring"
? "Testing RingLibuv - Server Side - Using Classes"
open_object(:MyServer)
class MyServer from ObjectControllerParent
DEFAULT_PORT = 13370
DEFAULT_BACKLOG = 1024
addr = new_sockaddr_in()
server = NULL
client = NULL
myloop = NULL
func start
myloop = uv_default_loop()
5.12. RingLibuv Extension 57
Ring Documentation, Release 1.8
server = new_uv_tcp_t()
uv_tcp_init(myloop, server)
uv_ip4_addr("127.0.0.1", DEFAULT_PORT, addr)
uv_tcp_bind(server, addr, 0)
r = uv_listen(server, DEFAULT_BACKLOG, Method(:newconnection) )
if r
? "Listen error " + uv_strerror(r)
return 1
ok
uv_run(myloop, UV_RUN_DEFAULT)
destroy_uv_tcp_t(server)
destroy_uv_sockaddr_in(addr)
func newconnection
? "New Connection"
aPara = uv_Eventpara(server,:connect)
nStatus = aPara[2]
if nStatus < 0
? "New connection error : " + nStatus
return
ok
client = new_uv_tcp_t()
uv_tcp_init(myloop, client)
if uv_accept(server, client) = 0
uv_read_start(client, uv_myalloccallback(),
Method(:echo_read))
ok
func echo_read
aPara = uv_Eventpara(client,:read)
nRead = aPara[2]
buf = aPara[3]
if nRead > 0
req = new_uv_write_t()
wrbuf = uv_buf_init(get_uv_buf_t_base(buf), nread)
uv_write(req, client, wrbuf, 1, Method(:echo_write))
? uv_buf2str(wrbuf)
message = "message from the server to the client"
buf = new_uv_buf_t()
set_uv_buf_t_len(buf,len(message))
set_uv_buf_t_base(buf,varptr("message","char *"))
uv_write(req, client, buf, 1, Method(:echo_write))
ok
func echo_write
aPara = uv_Eventpara(client,:read)
req = aPara[1]
Output:
When we run the client, We will see the message “New Connection”
Then the message “hello from the client”
Testing RingLibuv - Server Side - Using Classes
New Connection
hello from the client
Example (Using Threads):
5.12. RingLibuv Extension 58
Ring Documentation, Release 1.8
load "libuv.ring"
load "objectslib.ring"
? "Testing RingLibuv - Threads - Using Classes"
open_object(:MyThreads)
class MyThreads from ObjectControllerParent
func Start
one_id = new_uv_thread_t()
two_id = new_uv_thread_t()
uv_thread_create(one_id, Method(:One))
uv_thread_create(two_id, Method(:Two))
uv_thread_join(one_id)
uv_thread_join(two_id)
destroy_uv_thread_t(one_id)
destroy_uv_thread_t(two_id)
func one
? "Message from the First Thread!"
func Two
? "Message from the Second Thread!"
Output:
Testing RingLibuv - Threads - Using Classes
Message from the First Thread!
Message from the Second Thread!
For more information about this extension (RingLibuv) check the chapter: Using RingLibuv
5.12. RingLibuv Extension 59
CHAPTER
SIX
WHAT IS NEW IN RING 1.6?
In this chapter we will learn about the changes and new features in Ring 1.6 release.
6.1 List of changes and new features
Ring 1.6 comes with many new features!
• Employee Application
• New Tool: Ring2EXE
• Better Ring For Android
• New Tool : Folder2qrc
• Better Scripts for building Ring
• RingConsoleColors Extension
• RingMurmurHash Extension
• Better Ring Notepad
• Better RingQt
• Better StdLib
• Better RingVM
• Better RingREPL
• Using Tab instead of char(9)
• Using CR as Carriage return
• Using the ! operator as not
• Using && and || operators
• Using ? to print expression then new line
6.2 Employee Application
The Employee application is added to ring/applications
Developer: Ahmed Hassouna
60

More Related Content

What's hot

Smarter Testing With Spock
Smarter Testing With SpockSmarter Testing With Spock
Smarter Testing With SpockIT Weekend
 
Showdown of the Asserts by Philipp Krenn
Showdown of the Asserts by Philipp KrennShowdown of the Asserts by Philipp Krenn
Showdown of the Asserts by Philipp KrennJavaDayUA
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the pointseanmcq
 
Java Search Engine Framework
Java Search Engine FrameworkJava Search Engine Framework
Java Search Engine FrameworkAppsterdam Milan
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofitTed Liang
 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using SpockAnuj Aneja
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42Yevhen Bobrov
 
Spock Testing Framework - The Next Generation
Spock Testing Framework - The Next GenerationSpock Testing Framework - The Next Generation
Spock Testing Framework - The Next GenerationBTI360
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydneyjulien.ponge
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialJeff Smith
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radiolupe ga
 
#5 (Remote Method Invocation)
#5 (Remote Method Invocation)#5 (Remote Method Invocation)
#5 (Remote Method Invocation)Ghadeer AlHasan
 
Understanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsUnderstanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsShinpei Hayashi
 
Java libraries you can't afford to miss
Java libraries you can't afford to missJava libraries you can't afford to miss
Java libraries you can't afford to missAndres Almiray
 
Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Kiyotaka Oku
 

What's hot (20)

Smarter Testing With Spock
Smarter Testing With SpockSmarter Testing With Spock
Smarter Testing With Spock
 
Showdown of the Asserts by Philipp Krenn
Showdown of the Asserts by Philipp KrennShowdown of the Asserts by Philipp Krenn
Showdown of the Asserts by Philipp Krenn
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the point
 
Java Search Engine Framework
Java Search Engine FrameworkJava Search Engine Framework
Java Search Engine Framework
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofit
 
Storm 0.8.2
Storm 0.8.2Storm 0.8.2
Storm 0.8.2
 
Unit/Integration Testing using Spock
Unit/Integration Testing using SpockUnit/Integration Testing using Spock
Unit/Integration Testing using Spock
 
Spock Framework
Spock FrameworkSpock Framework
Spock Framework
 
Understanding greenlet
Understanding greenletUnderstanding greenlet
Understanding greenlet
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
 
Spock Testing Framework - The Next Generation
Spock Testing Framework - The Next GenerationSpock Testing Framework - The Next Generation
Spock Testing Framework - The Next Generation
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydney
 
Programming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorialProgramming with ZooKeeper - A basic tutorial
Programming with ZooKeeper - A basic tutorial
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radio
 
#5 (Remote Method Invocation)
#5 (Remote Method Invocation)#5 (Remote Method Invocation)
#5 (Remote Method Invocation)
 
Understanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring EffectsUnderstanding Source Code Differences by Separating Refactoring Effects
Understanding Source Code Differences by Separating Refactoring Effects
 
Java libraries you can't afford to miss
Java libraries you can't afford to missJava libraries you can't afford to miss
Java libraries you can't afford to miss
 
Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介Grails/Groovyによる開発事例紹介
Grails/Groovyによる開発事例紹介
 
Code red SUM
Code red SUMCode red SUM
Code red SUM
 

Similar to The Ring programming language version 1.8 book - Part 9 of 202

The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 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.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
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189Mahmoud 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.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.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202Mahmoud 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.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.10 book - Part 59 of 212
The Ring programming language version 1.10 book - Part 59 of 212The Ring programming language version 1.10 book - Part 59 of 212
The Ring programming language version 1.10 book - Part 59 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210Mahmoud Samir Fayed
 
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.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196Mahmoud 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.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184Mahmoud 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
 

Similar to The Ring programming language version 1.8 book - Part 9 of 202 (20)

The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 of 185The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.5.4 book - Part 14 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.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
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189
 
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.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.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202
 
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.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.10 book - Part 59 of 212
The Ring programming language version 1.10 book - Part 59 of 212The Ring programming language version 1.10 book - Part 59 of 212
The Ring programming language version 1.10 book - Part 59 of 212
 
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.10 book - Part 13 of 212
 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210
 
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.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.10 book - Part 102 of 212
 
The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196The Ring programming language version 1.7 book - Part 8 of 196
The Ring programming language version 1.7 book - Part 8 of 196
 
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.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.10 book - Part 21 of 212
 
The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181
 
The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184
 
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
 

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

Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Recently uploaded (20)

Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

The Ring programming language version 1.8 book - Part 9 of 202

  • 1. Ring Documentation, Release 1.8 Start the test! Let us try having an error Line 1 Error (R24) : Using uninitialized variable : x in file Ring_EmbeddedCode End of test! 5. The compiler will ignore new lines after keywords that expect tokens after it Example: see " Hello, World! " test() func #======================# Test #======================# ? " Hello from the Test function " Output: Hello, World! Hello from the Test function 6. Better code (faster) for the main loop, special loop for eval() function. 7. Better code (faster) for tracking C pointers to avoid using NULL pointers. 8. Better code (faster) for getting the self object using braces. 4.18 Notes to extensions creators If you have created new extensions for Ring in the C/C++ languages. You have to rebuild your extension (Generate the DLL file again using Ring 1.8 header files) before usage with Ring 1.8 Because we changed the internal structure of the VM, but no changes to the code are required. just rebuild. 4.18. Notes to extensions creators 51
  • 2. CHAPTER FIVE WHAT IS NEW IN RING 1.7? In this chapter we will learn about the changes and new features in Ring 1.7 release. 5.1 List of changes and new features Ring 1.7 comes with many new features! • New Command: Load Package • ringvm_see() and ringvm_give() functions • ring_state_new() and ring_state_mainfile() functions • Better Trace Library • Better Ring Notepad • Better RingQt • Better Ring2EXE • Better RingZip • Better Documentation • Better Ring VM • RingLibuv Extension 5.2 New Command: Load Package Using the ‘load’ command we can use many ring source files in the same project But all of these files will share the same global scope Now we have the “Load Package” command too Using “Load Package” we can load a library (*.ring file) in new global scope This is very useful to create libraries that avoid conflicts in global variables Example: File: loadpackage.ring 52
  • 3. Ring Documentation, Release 1.8 x = 100 ? "Hello, World!" load package "testloadpackage.ring" ? x test() File: testloadpackage.ring ? "Hello from testloadpackage.ring" x = 1000 test() func test ? x Output: Hello, World! Hello from testloadpackage.ring 1000 100 1000 5.3 ringvm_see() and ringvm_give() functions Using the ringvm_see() function we can redefine the behavior of the See command Also we can use ring_see() to have the original behavior Example: see "Hello world" + nl see 123 + nl see ["one","two","three"] see new point {x=10 y=20 z=30} func ringvm_see t ring_see("We want to print: ") ring_See(t) class point x y z Output: We want to print: Hello world We want to print: 123 We want to print: one two three We want to print: x: 10.000000 y: 20.000000 z: 30.000000 Using the ringvm_give() function we can redefine the behavior of the Give command Also we can use ring_give() to have the original behavior 5.3. ringvm_see() and ringvm_give() functions 53
  • 4. Ring Documentation, Release 1.8 Example: see "Name: " give name see "Hello " + name func ringvm_give see "Mahmoud" + nl return "Mahmoud" Output: Name: Mahmoud Hello Mahmoud 5.4 ring_state_new() and ring_state_mainfile() functions Using ring_state_new() and ring_state_mainfile() we can run Ring programs from Ring programs But unlike ring_state_main(), Here we can control when to delete the Ring state! This is important when we run GUI programs from GUI programs Because they will share the GUI Library (RingQt), And In this case the caller will call qApp.Exec() So the sub program, will not stop and will return to the Main program Here deleting the State of the sub programs will lead to a problem when we run the sub program events So keeping the state is important for sub GUI programs hosted in GUI programs. 5.5 Better Trace Library The Trace library is updated, In the Debugger at break points we have now the “callstack” command This command will print the functions call stack. Example: load "tracelib.ring" func main ? "Hello from main!" test1() func test1 ? "Hello from test1!" test2() func test2 ? "Hello from test2!" test3() func test3 ? "Hello from test3!" breakpoint() 5.4. ring_state_new() and ring_state_mainfile() functions 54
  • 5. Ring Documentation, Release 1.8 5.6 Better Ring Notepad Ring Notepad comes with the next updates 1. Support *.cf extension 2. Using Hash function (SHA256) for better “Save Changes?” message 3. Ring Notepad - X Button - Ask for saving changes? 5.7 Better RingQt The next classes are added to RingQt 1. QStackedWidget 2. QCalendarWidget 3. QOpenGLFunctions 4. QOpenGLContext 5. QSurfaceFormat 6. QOpenGLWidget 7. QOpenGLVersionProfile 8. QOpenGLFunctions_3_2_Core 9. QVector2D 10. QVector3D 11. QVector4D 5.6. Better Ring Notepad 55
  • 6. Ring Documentation, Release 1.8 12. QQuaternion 13. QMatrix4x4 14. QOpenGLPaintDevice 15. QPaintDevice 16. QOpenGLTimerQuery 17. QOpenGLDebugLogger 18. QOpenGLFramebufferObject 19. QOpenGLVertexArrayObject 20. QOpenGLBuffer 21. QOpenGLShaderProgram 22. QOpenGLShader 23. QOpenGLTexture 5.8 Better Ring2EXE Ring2EXE is updated to works as expected when we don’t have a C/C++ compiler Where we can distribute applications and get (exe file and ringo file) in this case. 5.9 Better RingZip The library is updated to support extracting files contains sub folders! 5.10 Better Documentation 1. RingQt Classes Chapter - The classes are sorted. 5.11 Better Ring VM 1. Better Error Message 2. List2Str() function support lists contains numbers 3. Correct support for numbers contains _ as separator 4. Creating lists without variables (statement –> Expression –> List) 5. IsNULL() - Not case sensitive - treat Null and null like NULL 6. Support adding the Self object to an attribute in this object 7. Using ‘:’ operator then keyword will create lower case literal 8. Printing objects - respect decimals() function 9. When literal is not closed - determine the start of the literal 5.8. Better Ring2EXE 56
  • 7. Ring Documentation, Release 1.8 10. Better message when printing objects contains lists 11. VarPtr() - Support getting a pointer to variables in the local scope 12. replace performance instructions with normal instructions when creating new threads 5.12 RingLibuv Extension Ring 1.7 comes with the RingLibuv extension Libuv is a multi-platform support library with a focus on asynchronous I/O. Example (Events Loop): load "libuv.ring" counter = 0 idler = NULL func main idler = new_uv_idle_t() uv_idle_init(uv_default_loop(), idler) uv_idle_start(idler, "wait()") ? "Idling..." uv_run(uv_default_loop(), UV_RUN_DEFAULT); uv_loop_close(uv_default_loop()); destroy_uv_idle_t(idler) func wait counter++ if counter >= 100000 uv_idle_stop(idler) ok Output: Idling... Example (Server): load "libuv.ring" load "objectslib.ring" ? "Testing RingLibuv - Server Side - Using Classes" open_object(:MyServer) class MyServer from ObjectControllerParent DEFAULT_PORT = 13370 DEFAULT_BACKLOG = 1024 addr = new_sockaddr_in() server = NULL client = NULL myloop = NULL func start myloop = uv_default_loop() 5.12. RingLibuv Extension 57
  • 8. Ring Documentation, Release 1.8 server = new_uv_tcp_t() uv_tcp_init(myloop, server) uv_ip4_addr("127.0.0.1", DEFAULT_PORT, addr) uv_tcp_bind(server, addr, 0) r = uv_listen(server, DEFAULT_BACKLOG, Method(:newconnection) ) if r ? "Listen error " + uv_strerror(r) return 1 ok uv_run(myloop, UV_RUN_DEFAULT) destroy_uv_tcp_t(server) destroy_uv_sockaddr_in(addr) func newconnection ? "New Connection" aPara = uv_Eventpara(server,:connect) nStatus = aPara[2] if nStatus < 0 ? "New connection error : " + nStatus return ok client = new_uv_tcp_t() uv_tcp_init(myloop, client) if uv_accept(server, client) = 0 uv_read_start(client, uv_myalloccallback(), Method(:echo_read)) ok func echo_read aPara = uv_Eventpara(client,:read) nRead = aPara[2] buf = aPara[3] if nRead > 0 req = new_uv_write_t() wrbuf = uv_buf_init(get_uv_buf_t_base(buf), nread) uv_write(req, client, wrbuf, 1, Method(:echo_write)) ? uv_buf2str(wrbuf) message = "message from the server to the client" buf = new_uv_buf_t() set_uv_buf_t_len(buf,len(message)) set_uv_buf_t_base(buf,varptr("message","char *")) uv_write(req, client, buf, 1, Method(:echo_write)) ok func echo_write aPara = uv_Eventpara(client,:read) req = aPara[1] Output: When we run the client, We will see the message “New Connection” Then the message “hello from the client” Testing RingLibuv - Server Side - Using Classes New Connection hello from the client Example (Using Threads): 5.12. RingLibuv Extension 58
  • 9. Ring Documentation, Release 1.8 load "libuv.ring" load "objectslib.ring" ? "Testing RingLibuv - Threads - Using Classes" open_object(:MyThreads) class MyThreads from ObjectControllerParent func Start one_id = new_uv_thread_t() two_id = new_uv_thread_t() uv_thread_create(one_id, Method(:One)) uv_thread_create(two_id, Method(:Two)) uv_thread_join(one_id) uv_thread_join(two_id) destroy_uv_thread_t(one_id) destroy_uv_thread_t(two_id) func one ? "Message from the First Thread!" func Two ? "Message from the Second Thread!" Output: Testing RingLibuv - Threads - Using Classes Message from the First Thread! Message from the Second Thread! For more information about this extension (RingLibuv) check the chapter: Using RingLibuv 5.12. RingLibuv Extension 59
  • 10. CHAPTER SIX WHAT IS NEW IN RING 1.6? In this chapter we will learn about the changes and new features in Ring 1.6 release. 6.1 List of changes and new features Ring 1.6 comes with many new features! • Employee Application • New Tool: Ring2EXE • Better Ring For Android • New Tool : Folder2qrc • Better Scripts for building Ring • RingConsoleColors Extension • RingMurmurHash Extension • Better Ring Notepad • Better RingQt • Better StdLib • Better RingVM • Better RingREPL • Using Tab instead of char(9) • Using CR as Carriage return • Using the ! operator as not • Using && and || operators • Using ? to print expression then new line 6.2 Employee Application The Employee application is added to ring/applications Developer: Ahmed Hassouna 60