How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the Common Lisp programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the Common Lisp programming language
Table of Contents
Problem Statement
Idiomatically determine all the lowercase and uppercase letters (of the Latin [English] alphabet) being used currently by a computer programming language. The method should find the letters regardless of the hardware architecture that is being used (ASCII, EBCDIC, or other).
Display the set of all: that can be used (allowed) by the computer program, where letter is a member of the Latin (English) alphabet: a ──► z and A ──► Z.
You may want to mention what hardware architecture is being used, and if applicable, the operating system.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Idiomatically determine all the lowercase and uppercase letters step by step in the Common Lisp programming language
Source code in the common programming language
(flet ((do-case (converter)
;; A = 10, B = 11, ... Z = 35
(loop for radix from 10 to 35
for char = (funcall converter (digit-char radix 36)) do
(format t "~&~8D #\\~24A ~S"
;; The codes and names vary across systems
(char-code char) (char-name char) char))))
(format t "~&;;; Code Full Name Appearance")
;; Using a local function reduces code duplication
(do-case #'char-downcase) (do-case #'char-upcase))
;;; Code Full Name Appearance
97 #\LATIN_SMALL_LETTER_A #\a
98 #\LATIN_SMALL_LETTER_B #\b
99 #\LATIN_SMALL_LETTER_C #\c
100 #\LATIN_SMALL_LETTER_D #\d
101 #\LATIN_SMALL_LETTER_E #\e
102 #\LATIN_SMALL_LETTER_F #\f
103 #\LATIN_SMALL_LETTER_G #\g
104 #\LATIN_SMALL_LETTER_H #\h
105 #\LATIN_SMALL_LETTER_I #\i
106 #\LATIN_SMALL_LETTER_J #\j
107 #\LATIN_SMALL_LETTER_K #\k
108 #\LATIN_SMALL_LETTER_L #\l
109 #\LATIN_SMALL_LETTER_M #\m
110 #\LATIN_SMALL_LETTER_N #\n
111 #\LATIN_SMALL_LETTER_O #\o
112 #\LATIN_SMALL_LETTER_P #\p
113 #\LATIN_SMALL_LETTER_Q #\q
114 #\LATIN_SMALL_LETTER_R #\r
115 #\LATIN_SMALL_LETTER_S #\s
116 #\LATIN_SMALL_LETTER_T #\t
117 #\LATIN_SMALL_LETTER_U #\u
118 #\LATIN_SMALL_LETTER_V #\v
119 #\LATIN_SMALL_LETTER_W #\w
120 #\LATIN_SMALL_LETTER_X #\x
121 #\LATIN_SMALL_LETTER_Y #\y
122 #\LATIN_SMALL_LETTER_Z #\z
65 #\LATIN_CAPITAL_LETTER_A #\A
66 #\LATIN_CAPITAL_LETTER_B #\B
67 #\LATIN_CAPITAL_LETTER_C #\C
68 #\LATIN_CAPITAL_LETTER_D #\D
69 #\LATIN_CAPITAL_LETTER_E #\E
70 #\LATIN_CAPITAL_LETTER_F #\F
71 #\LATIN_CAPITAL_LETTER_G #\G
72 #\LATIN_CAPITAL_LETTER_H #\H
73 #\LATIN_CAPITAL_LETTER_I #\I
74 #\LATIN_CAPITAL_LETTER_J #\J
75 #\LATIN_CAPITAL_LETTER_K #\K
76 #\LATIN_CAPITAL_LETTER_L #\L
77 #\LATIN_CAPITAL_LETTER_M #\M
78 #\LATIN_CAPITAL_LETTER_N #\N
79 #\LATIN_CAPITAL_LETTER_O #\O
80 #\LATIN_CAPITAL_LETTER_P #\P
81 #\LATIN_CAPITAL_LETTER_Q #\Q
82 #\LATIN_CAPITAL_LETTER_R #\R
83 #\LATIN_CAPITAL_LETTER_S #\S
84 #\LATIN_CAPITAL_LETTER_T #\T
85 #\LATIN_CAPITAL_LETTER_U #\U
86 #\LATIN_CAPITAL_LETTER_V #\V
87 #\LATIN_CAPITAL_LETTER_W #\W
88 #\LATIN_CAPITAL_LETTER_X #\X
89 #\LATIN_CAPITAL_LETTER_Y #\Y
90 #\LATIN_CAPITAL_LETTER_Z #\Z
You may also check:How to resolve the algorithm Self-describing numbers step by step in the Ruby programming language
You may also check:How to resolve the algorithm A+B step by step in the Agena programming language
You may also check:How to resolve the algorithm First-class functions step by step in the Java programming language
You may also check:How to resolve the algorithm Matrix multiplication step by step in the APL programming language
You may also check:How to resolve the algorithm Angle difference between two bearings step by step in the IS-BASIC programming language