Characters in LISP Last Updated : 10 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In Lisp data objects of type 'character' are referred to as characters. For representation purposes, we usually denote character objects by preceding a #\ symbol before the character. Any character can be represented by using the #\ symbol before the name of the character. For Example #\a represents a character 'a'. Example 1: Lisp ;Lisp Code to print characters (write #\a) (terpri) (write-char #\a) (terpri) (write-char #\b) Output: Time Complexity: O(1)Auxiliary Space: O(1) Note: "terpri" is a command in Lisp that means "terminate printing" as it is used to terminate a line of output without which the output would be printed in one line. Special Characters in Lisp:There are some predefined special characters in Lisp which are: #\Backspace#\Tab#\Page#\Linefeed#\Return#\RuboutCharacter Comparison Functions:In Lisp programming we don't use numeric comparison functions rather we make use of character comparing functions. There are two sets of character comparing functions: Case-Sensitive Functions: Used when characters are having the same case(lower or upper).Case-Insensitive Functions: Used when characters may be having different cases(lower or upper).S.No.Case Sensitive FunctionsCase-Insensitive FunctionsDescription1char=char-equalChecks if operands are equal or not2char/=char-not-equalChecks if operands are different or not3char<=char-not-greaterpChecks if the value of the left operand is greater than or equal to the value of the next right operand4char>=char-not-lesspChecks if the value of the left operand is less than or equal to the value of the next right operand5char<char-lesspChecks if the values of the operands are monotonically decreasing or not6char>char-greaterpChecks if the values of the operands are monotonically increasing or notNote: If in any of the above-mentioned cases the condition in description is satisfied, then it returns 'T' else returns 'NIL'. Example 2: Lisp ;Lisp Case-Sensitive Comparison (write (char= #\b #\b)) (terpri) (write (char= #\a #\b)) (terpri) (write (char= #\A #\c)) (terpri) (write (char-lessp #\x #\y #\z)) (terpri) (write (char-greaterp #\a #\b #\c)) (terpri) ;Case-Insensitive Comparison (write (char-equal #\a #\A)) (terpri) (write (char-equal #\a #\b)) (terpri) (write (char-lessp #\x #\y #\z)) (terpri) (write (char-greaterp #\a #\b #\c)) Output: Time Complexity: O(1)Auxiliary Space: O(1) Comment More infoAdvertise with us Next Article Characters in Julia K kishanpandeyrkt Follow Improve Article Tags : LISP LISP-Basics Similar Reads Characters in Julia Julia is a dynamic, high-level programming language with high performance and speed that is used to perform operations in scientific computing. It is great for computational complex problems. It is an open-source language so all source code is available easily online. It is as easy to use as Python 2 min read Arrays in LISP LISP, is a list processing, is a programming language widely used in working with data manipulation. LISP allows us to produce single or multiple-dimension arrays using the make-array function. An array can store any LISP object as its elements. Â The index number of the array starts from 0 to the n- 2 min read Atoms in LISP Pre-requisites: Introduction to LISP Function Languages are those languages in which the basic building block is functions. In functional programming, the programmer is concerned only with functionality and not memory related variable storage and assignment sequence. There are some commonly used Fun 2 min read Input From Character Streams in LISP This article is about input from character streams in LISP. Input in LISP can be taken in different ways like input from the user, input from character streams, etc. In LISP input from character streams can be taken from different functions accordingly. Input from character streams can be a string, 3 min read If Construct in LISP In this article, we will discuss the if construct in LISP. The if is a decision-making statement used to check whether the condition is right or wrong. The if the condition is right, then it will go inside the if block and execute the statements under if block. Otherwise, the statements are not exec 2 min read Dolist Construct in LISP DoList in Common LISP is a looping statement used to iterate the elements in a list. Syntax: (dolist input_list) statements... ) Here, The input_list contains the list of elements that are iterated.The statements are present in the loop. Example 1: LISP Program to iterate the list of elements from 1 2 min read Like