Author: admin
-
Arrays
LISP allows you to define single or multiple-dimension arrays using the make-array function. An array can store any LISP object as its elements. All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. The number of dimensions of an array is called its rank.…
-
Characters
In LISP, characters are represented as data objects of type character. You can denote a character object preceding #\ before the character itself. For example, #\a means the character a. Space and other special characters can be denoted by preceding #\ before the name of the character. For example, #\SPACE represents the space character. The following…
-
Numbers
Common Lisp defines several kinds of numbers. The number data type includes various kinds of numbers supported by LISP. The number types supported by LISP are − The following diagram shows the number hierarchy and various numeric data types available in LISP − Various Numeric Types in LISP The following table describes various number type data available…
-
Node.js Streams
Streams are the objects that facilitate you to read data from a source and write data to a destination. There are four types of streams in Node.js: Each type of stream is an Event emitter instance and throws several events at different times. Following are some commonly used events: Node.js Reading from stream Create a…
-
Predicates
Predicates are functions that test their arguments for some specific conditions and returns nil if the condition is false, or some non-nil value is the condition is true. The following table shows some of the most commonly used predicates − Sr.No. Predicate & Description 1 atomIt takes one argument and returns t if the argument…
-
Functions
A function is a group of statements that together perform a task. You can divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division usually is so each function performs a specific task. Defining Functions in LISP The macro named defun is used…
-
Error Handling
Go programming provides a pretty simple error handling framework with inbuilt error interface type of the following declaration − Functions normally return error as last return value. Use errors.New to construct a basic error message as following − Use return value and error message. Example Live Demo When the above code is compiled and executed, it produces…
-
Interfaces
Go programming provides another data type called interfaces which represents a set of method signatures. The struct data type implements these interfaces to have method definitions for the method signature of the interfaces. Syntax Example Live Demo When the above code is compiled and executed, it produces the following result −
-
Loops
There may be a situation, when you need to execute a block of code numbers of times. A loop statement allows us to execute a statement or group of statements multiple times and following is the general form of a loop statement in most of the programming languages. LISP provides the following types of constructs…
-
Recursion
Recursion is the process of repeating items in a self-similar way. The same concept applies in programming languages as well. If a program allows to call a function inside the same function, then it is called a recursive function call. Take a look at the following example − The Go programming language supports recursion. That…