Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Redis

You're reading from  Learning Redis

Product type Book
Published in Jun 2015
Publisher
ISBN-13 9781783980123
Pages 318 pages
Edition 1st Edition
Languages
Author (1):
Vinoo Das Vinoo Das
Profile icon Vinoo Das

Brief introduction on Lua


Okay, by now we all know that LUA is an interpreted language and it has support in Redis. To make use of the capability of Redis, let's learn couple of things about LUA. Types and values supported in LUA are as follows:

  • Nil: Nil is a type with single value nil. On comparing it with Java, it can be taken as null.

  • Booleans: These will have either true or false as values.

  • Numbers: These represent double precession floating point numbers. So we can write our numbers as 1, 1.1, 2e+10, and so on.

  • String: These represent a sequence of characters as is common in most of the scripting and programming languages. In LUA, strings are immutable in nature; for example, "Learning Redis" and 'Learning Redis'. LUA provides methods in string library to find substring, replace characters, and so on.

  • Tables: These are like arrays which can be indexed with numbers and strings except nil.

Control statements and loops in LUA are as follows:

  • The if then else statement: As in Java, where...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}