. , , "" . . - , use-package , . , load , , OP cl-user::divisble-by. , , , OP.
:
util.lisp file2.lisp:
$ cat util.lisp
(defpackage :euler-util
(:use :common-lisp)
(:export :divisible-by))
(in-package :euler-util)
(defun divisible-by (x y)
(equal 0 (mod x y)))
$ cat file2.lisp
(load "util.lisp")
(use-package :euler-util)
(defun euler-1 ()
(loop for i from 3 to 999 when (or (divisible-by i 3) (divisible-by i 5)) sum i))
: - "DIVISIBLE-BY" CL-USER, , , :
$ sbcl --noinform
* (defun divisible-by (&rest args) (declare (ignore args)))
DIVISIBLE-BY
* (load "file2")
debugger invoked on a NAME-CONFLICT in thread #<THREAD "initial thread" RUNNING
{1002979041}>:
USE-PACKAGE #<PACKAGE "EULER-UTIL"> causes name-conflicts in
#<PACKAGE "COMMON-LISP-USER"> between the following symbols:
EULER-UTIL:DIVISIBLE-BY, COMMON-LISP-USER::DIVISIBLE-BY
See also:
The ANSI Standard, Section 11.1.1.2.5
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RESOLVE-CONFLICT] Resolve conflict.
1: [RETRY ] Retry EVAL of current toplevel form.
2: [CONTINUE ] Ignore error and continue loading file "…/file2.lisp".
3: [ABORT ] Abort loading file "…/file2.lisp".
4: Exit debugger, returning to top level.
(NAME-CONFLICT
#<PACKAGE "COMMON-LISP-USER">
USE-PACKAGE
#<PACKAGE "EULER-UTIL">
EULER-UTIL:DIVISIBLE-BY
DIVISIBLE-BY)
, . SBCL , ( ) SLIME. . , : --noinform ; --eval "'divisible-by" cl-user:divisible-by; --load file2.lisp . , , .
$ sbcl --noinform --eval "'divisible-by" --load file2.lisp
debugger invoked on a NAME-CONFLICT in thread #<THREAD "initial thread" RUNNING
{1002979311}>:
USE-PACKAGE #<PACKAGE "EULER-UTIL"> causes name-conflicts in
#<PACKAGE "COMMON-LISP-USER"> between the following symbols:
EULER-UTIL:DIVISIBLE-BY, COMMON-LISP-USER::DIVISIBLE-BY
See also:
The ANSI Standard, Section 11.1.1.2.5
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RESOLVE-CONFLICT] Resolve conflict.
1: [RETRY ] Retry EVAL of current toplevel form.
2: [CONTINUE ] Ignore error and continue loading file "/home/taylorj/tmp/package-issue/file2.lisp".
3: [ABORT ] Abort loading file "/home/taylorj/tmp/package-issue/file2.lisp".
4: Ignore runtime option --load "file2.lisp".
5: Skip rest of --eval and --load options.
6: Skip to toplevel READ/EVAL/PRINT loop.
7: [QUIT ] Quit SBCL (calling #'QUIT, killing the process).
(NAME-CONFLICT
#<PACKAGE "COMMON-LISP-USER">
USE-PACKAGE
#<PACKAGE "EULER-UTIL">
EULER-UTIL:DIVISIBLE-BY
DIVISIBLE-BY)
0, :
0] 0
Select a symbol to be made accessible in package COMMON-LISP-USER:
1. EULER-UTIL:DIVISIBLE-BY
2. COMMON-LISP-USER::DIVISIBLE-BY
Enter an integer (between 1 and 2): 1
euler-util:divisible-by , CL-USER, , :
* (euler-1)
233168
.
, , , , , , . , (, , "DIVISIBLE-BY" CL-USER. Lisp :
$ sbcl --load file2.lisp --noinform
* (euler-1)
233168