[Openmcl-devel] CCL Win32 confuses equally named functions

Wimpie Nortje wimpie at selectiveshare.com
Mon Jun 8 05:00:01 PDT 2015


Hans,

The example is below. I put all of it in a single file. When I load the
file I get

;Compiler warnings for "bug.lisp" : ;   In GENERATE-KEY: In the call to
GENERATE-KEY with arguments (NEW-USER NEW-PASSWD *LIBRARY-KEYS-DIR*), ;
3 arguments were provided, but at most 2 are accepted ;     by the
lexically visible definition of GENERATE-KEY

In the real project this was hidden by Quicklisp. It also fails on both
CCL linux 64b and SBCL linux 64b with the same warning. So this was my
mistake. I will have to read up on scoping rules again.

Thanks for your time.


#|*********************************************************************-
#|*******|#
(in-package #:cl-user)

(defpackage #:encryption  (:use #:cl)   (:export #:generate-key))

(in-package #:encryption)

(defun generate-key (new-user new-passwd home-dir
&optional (out *standard-output*))  (declare (ignore new-user new-passwd
home-dir out))  (print "Correct function called."))

#|*********************************************************************-
#|*******|#
(in-package #:cl-user)

(defpackage #:director  (:use    #:cl        #:encryption)  (:export
#:generate-key))

(in-package #:director)

(defparameter *library-keys-dir* #P"C:/tmp/keys")

(defun generate-key (new-user new-passwd)  (encryption:generate-key new-
user new-passwd *library-keys-dir*))

#|*********************************************************************-
#|*******|#
(in-package :cl-user)

(defpackage #:main  (:use #:cl))

(in-package #:main)

(director:generate-key "username" "gpg-passphrase")




--
Wimpie Nortje
Strongroom - Host-proof notepad
Selective Share - Encryption-as-a-Service
https://www.selectiveshare.com[1]
 
 
On Mon, Jun 8, 2015, at 01:16 PM, Hans Hübner wrote:
> Wimpie,
>  
> can you please supply us with a complete, working example of code that demonstrates the problem, in particular including the defpackage forms?
>  
> Thanks,
> Hans
>  
> 2015-06-08 7:03 GMT-04:00 Wimpie Nortje <wimpie at selectiveshare.com>:
>> Hi everyone,
>> 
>> 
I am porting my application from linux 64b to windows 32b. On windows
>> 
CCL calls the wrong function while it works fine in linux.
>> 
>> 
In principle the code looks like this
>> 
>> 
(in-package :b)
>> 
(defun fn (par1 par2 &optional (out *standard-output*))     [3]
>> 
      (do-stuff))
>> 
>> 
(in-package :a)
>> 
(defun fn (par1 par2)                        [2]
>> 
      (b:fn par1 par2 *some-global*))   [1]
>> 
>> 
(in-package :main)
>> 
(a:fn Val1 Val2)
>> 
>> 
>> 
When I run this I get the following error:
>> 
Too many arguments in call to #<Compiled-function B:FN #xE0A390E>:
>> 
3 arguments provided, at most 2 accepted.
>> 
   [Condition of type CCL::TOO-MANY-ARGUMENTS]
>> 
>> 
It seems that the function call at [1] is calling the definition at [2]
>> 
instead of the one at [3]. Also, when I do M-. (slime-edit-definition)
>> 
at [1] it jumps to [2].
>> 
>> 
If I rename b:fn to something else without any other code changes, it
>> 
works.
>> 
>> 
This code works unmodified on linux 64b. I have not yet tried on windows
>> 
64b
>> 
>> 
Is this a bug or am I doing something wrong?
>> 
>> 
I am running CCL Version 1.10-r16196  (WindowsX8632) on Windows XP SP3.
>> 
>> 
>> 
--
>> 
Wimpie Nortje
>> 
Strongroom - Host-proof notepad
>> 
Selective Share - Encryption-as-a-Service
>> https://www.selectiveshare.com
>> 
_______________________________________________
>> 
Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>  
 


Links:

  1. https://www.selectiveshare.com/?pk_campaign=email-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20150608/10b59373/attachment.htm>


More information about the Openmcl-devel mailing list