Common Lisp: defvar vs defparameter

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 6

  • @RicardoBigEggs
    @RicardoBigEggs 5 หลายเดือนก่อน +1

    As someone currently starting with CL, this is very useful. Thanks a lot!

    • @the-lisper
      @the-lisper  5 หลายเดือนก่อน

      Thanks for the feedback!

  • @ErikNorlander-go1zv
    @ErikNorlander-go1zv 8 หลายเดือนก่อน +1

    Happy I found your channel, great content on CL, thank you very much!

    • @the-lisper
      @the-lisper  8 หลายเดือนก่อน

      Thanks for the nice comment!

  • @RamsesAldama
    @RamsesAldama 9 หลายเดือนก่อน

    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-lisper
      @the-lisper  9 หลายเดือนก่อน +4

      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