Mukul Latiyan has Published 474 Articles

What does # mean in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:28:42

457 Views

The unary operator # is known as the Length operator in Lua. It is used almost everywhere in Lua. By everywhere, I meant that anywhere we would require to calculate the length of the any string or can also be used in tables also, but when it comes to table, ... Read More

What are some of the important Scientific Libraries used in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:25:40

224 Views

While we know that Lua does a great job when we want to use it as an embedded language, it can also exceed its basic uses and can be used in extreme cases such as Machine Learning and statistical analysis.There are many scientific libraries that are present in the market ... Read More

What are Closures in Lua Programming?

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:23:46

811 Views

In Lua, any function is a closure. In a narrower sense, a closure is an anonymous function like the returned function in your example.Closures are first-class: they can be assigned to variables, passed to functions and returned from them. They can be both keys and values in Lua tables.Unlike C++ ... Read More

The __index metamethod in Lua Programming

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:20:29

1K+ Views

Whenever we try to access a field that hasn’t been declared in a table in Lua, the answer we get is nil. While this is true, but the reason for it is that when such access happens, the interpreter triggers a search for an __index metamethod and if it doesn’t ... Read More

table.unpack() function in Lua programming

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:17:40

14K+ Views

When we want to return multiple values from a table, we make use of the table.unpack() function. It takes a list and returns multiple values.Syntaxtable.unpack{x, y, z, ....}ExampleThe table.unpack() function provides us with all the values that are passed to it as an argument, but we can also specify which ... Read More

table.pack() function in Lua programming

Mukul Latiyan

Mukul Latiyan

Updated on 19-Jul-2021 11:16:16

4K+ Views

When we want to return a table as a result from multiple values passed into a function, then we make use of the table.pack() function. The table.pack() function is a variadic function.Syntaxtable.pack(x, y, z, ....)ExampleThe table.pack() function provides a table formed with all the values that are passed to it ... Read More

while and do-while in Dart Programming

Mukul Latiyan

Mukul Latiyan

Updated on 24-May-2021 12:23:52

156 Views

While and do-while loops are also present in Dart's arsenal. They are quite similar in terms of syntax and functionality to the C's while and do-while loops.While loopA while loop is an indefinite loop that can be modified to run for a finite number of iterations based on the condition ... Read More

Variables in Dart Programming

Mukul Latiyan

Mukul Latiyan

Updated on 24-May-2021 12:23:21

56 Views

Dart being a statically typed language demands that we declare the type of variable that we going to use. In simpler terms, it is necessary that we define what kind of data we are going to store in the variable before making use of it.ExampleConsider the example shown below − Live ... Read More

Typedef in Dart Programming

Mukul Latiyan

Mukul Latiyan

Updated on 24-May-2021 12:22:56

61 Views

In Dart, we make use of Typedef when we want to create an alias for a function type that we can use as type annotations for declaring variables and return types of that function type.A typedef holds type information when a function type is assigned to a variable.Syntaxtypedef functionName(parameters)We make use ... Read More

This keyword in Dart Programming

Mukul Latiyan

Mukul Latiyan

Updated on 24-May-2021 12:22:32

683 Views

This keyword in dart is used to remove the ambiguity that can be caused if the class attributes and the parameters have the same name. This keyword basically represents an implicit object pointing to the current class object.We usually prefix the class attribute with this keyword whenever we want to ... Read More

Advertisements