Global variable in Lisp are special, why? Good question! In Common Lisp you can declaare global variables using both `defparameter` and `defvar`, the difference between them is strictly connected with the interactive nature of Lisp.
Пікірлер: 6
@ErikNorlander-go1zv4 ай бұрын
Happy I found your channel, great content on CL, thank you very much!
@the-lisper4 ай бұрын
Thanks for the nice comment!
@RicardoBigEggsАй бұрын
As someone currently starting with CL, this is very useful. Thanks a lot!
@the-lisperАй бұрын
Thanks for the feedback!
@RamsesAldama5 ай бұрын
It is kind of confusing. Because first you said that with defvar you cannot reassign a new value if it already have a value but then in the relp you were able to assign a new value to a defvar that already had a value. Could you explain a little bit further. Thanks.
@the-lisper5 ай бұрын
At the beginning when I reassign with defvar and defparameter to show that in one case the value doesn't change while in the other it does, they are two different shell. In the end, when I can reassign the value with defvar, I use mkunbound before. defvar doesn't throw errors, but the new value is ignored if there is already one