Going forward with learning, defvar
is used to define variables. Continue with the last program written in hello.lisp
. Here is how we can define the hello, world
program again with variables.
I read many places that variables are normally defined with star(*
) around it (on both-sides) to mark it as global variable and *
is a valid character to define a variable.
Not just *
but hyphen(-
) is also used define multi-words variables as kebab-case
and this is recommended instead of camelCase
or snake_case
.
Frankly speaking, I haven’t seen a program like above anywhere else (defining a variable and then using it in the next line without context). Maybe in functional programming, most of the variables are bound to the scope and only defined where needed.
But, defvar
is used to define the variable in Common Lisp.