How is Lisp code structured? What are packages and systems?

I am learning Lisp (SBCL) and I am confused about how Lisp code is structured. I find Lisp Packages similar to Python modules?

I want to do something like this.

utilities.py:

def foo():
    print "And there is silence!"

main.py:

import utilities as u

u.foo()

I looked at packages, downloads and asdf systems. I still don’t understand how it all fits together.

+3
source share
3 answers

A package is a namespace for characters. You can import and export symbols from and to symbols. A character may be interned in one package. Packages may be used by other packages.

. , , , .. - . ASDF . . , ,...

.

, . .

+2

Python:

CL Python, . (, ASDF) , Distutils Setuptools Python.

Python CL: . defpackage use-package, . , , .

. Lisp.

+3

, :

  • .
  • (.. ).

About packages: in order to pull out those (which is necessary to prevent character conflicts, etc.), I highly recommend reading the Ron Garret Complete Guide for Idiots on Common Lisp Packages .

+2
source

Source: https://habr.com/ru/post/1792613/


All Articles