ailisp / flute

A beautiful, easilly composable HTML5 generation library in Common Lisp
64 stars 7 forks source link

parenscript and flute name conflict #10

Closed jakeisnt closed 2 years ago

jakeisnt commented 2 years ago

When attempting to use parenscript and flute in the same namespace, lots of flute's names conflict, and lisp interpreters produce errors:

USE-PACKAGE #<PACKAGE "PARENSCRIPT"> causes name-conflicts in
#<PACKAGE "FLUTE-PAGE"> between the following symbols:
  PARENSCRIPT:VAR, FLUTE:VAR
   [Condition of type SB-EXT:NAME-CONFLICT]

Restarts:
 0: [KEEP-OLD] Keep symbols already accessible in FLUTE-PAGE (shadowing others).
 1: [TAKE-NEW] Make newly exposed symbols accessible in FLUTE-PAGE, uninterning old ones.
 2: [RESOLVE-CONFLICT] Resolve conflict.
 3: [RETRY] Retry SLY interactive evaluation request.
 4: [*ABORT] Return to SLY's top level.
 5: [ABORT] abort thread (#<THREAD "slynk-worker" RUNNING {10054CEBB3}>)

How would you recommend that this is resolved? Thanks!

vindarel commented 2 years ago

Hi, are you trying to :use both packages? This would try to import all their symbols in your package: this is likely to clash. It is generally not encouraged to "use" a package. You can "use" one package and access the symbols of the other ones with its package prefix, like flute:foo. You can create a package-local nickname to give an even shorter package prefix to a package (f:foo).

(uiop:define-package mypackage
  (:use :cl)
  (:local-nicknames
                    (:alex :alexandria)
                    (:csv :cl-csv)
                    (:http :dexador)))
jakeisnt commented 2 years ago

That makes sense! Thank you so much for the help.