🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #361

clos and packages

#361
From: Matthew Brand
Date: Mon, 10 Dec 1990 23:50
43 lines
2134 bytes
	Evidently in Common Lisp, CLOS and packages don't get along
	very well.  Specifically, it's impossible to export a method
	from two packages and then use them without producing a name 
	clash.  

	For example, let's say I have a spline package and a fractal
	package, both defining the method "show".  E.g.:

;;; FILE "spline.lisp"			;;; FILE "fractal.lisp"
(provide 'spline-utilities)		(provide 'fractal-utilities)
(in-package 'spline-package)		(in-package 'fractal-package)
(export '(show))			(export '(show))
(defmethod show ((s spline)) .... )	(defmethod show ((s fractal)) .... )

	;;; transcript
	> (load "spline-utilities")
	#P"/homes/brand/work/spline-utilities"
	> (load "fractal-utilities")
	#P"/homes/brand/work/fractal-utilities"
	> (use-package 'spline-package)
	T
	> (use-package 'fractal-package)
	>>Error: If the USER package were to 'use' the FRACTAL-PACKAGE package,
             there would be name conflicts with symbols found in the 
             following packages ("SPLINE-PACKAGE" "FRACTAL-PACKAGE")
             The particular symbols involved are:
             (SHOW)

	Now if I have to have a different name for the method of each
	package, that rather defeats the point of using an object system.
	On the other hand, since CLOS doesn't allow me to make functions
	private or public, I need to use packages.  Whoever wrote the intern
	function forgot to check whether or not a symbol references a method;
	in that case interning should proceed, provided that the argument
	lists are congruent.  Hence my question:

	Does anybody have a fix for this?

	Also, does this only happen in Lucid CommonLisp with PCL?

	help much appreciated,
	matt brand
Technical Details
Message-ID: <183@anaxagoras.ils.nwu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ils.nwu.edu!brand

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ils.nwu.edu!brand
From: brand@ils.nwu.edu (Matthew Brand)
Newsgroups: comp.lang.clos
Subject: clos and packages
Message-ID: <183@anaxagoras.ils.nwu.edu>
Date: 10 Dec 90 23:50:28 GMT
Sender: news@ils.nwu.edu
Reply-To: brand@ils.nwu.edu (Matthew Brand)
Organization: The Institute for the Learning Sciences, Northwestern U.
Lines: 43