For example, I’ve seen someone defining a package like so:

(defpackage :foobar
  (:use :cl))

instead of:

(defpackage foobar
  (:use cl))

Is there any actual difference? Or it’s just a personal preference, and has no effect on the program at all?

  • release-account@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    I prefer `#:foobar` because it simplifies auto-completion. Every time you start typing out a keyword, the package name tends to appear towards the top of the list, and it’s kinda annoying. Maybe we just need smarter auto complete frameworks that take the frequency of symbol use into account, but it’s easy enough just to use `#:foobar`.

    • SlowValue@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      Maybe we just need smarter auto complete frameworks that take the frequency of symbol use into account,

      Since quite some years there is company-prescient in case you are using Emacs with SLIME / SLY and company.el. Look at its readme to learn there exist other similar packages (Imo since more than a decade already).