<div dir="ltr"><div class="gmail_default" style="font-size:small">Wimpie,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Your code behaved as it did because your USE of the ENCRYPTION package by the DIRECTOR package, as Hans surmised, caused the GENERATE-KEY definition in the DIRECTOR package to overwrite the definition in the ENCRYPTION package, since DIRECTOR:GENERATE-KEY is the same symbol as ENCRYPTION:GENERATE-KEY.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><span style="font-size:small">How your code ever "worked" I don't know, but since you said it did, I tried it in 64-bit Darwin, x8664 Linux, 32-bit ARM Linux, and both 32-bit and 64-bit Windows. Same error on all platforms: "I</span>n the call to GENERATE-KEY with arguments (NEW-USER NEW-PASSWD *LIBRARY-KEYS-DIR*), 3 arguments were provided, but at most 2 are accepted". To behave otherwise would be a bug in the package system.</div><div class="gmail_default"><br></div><div class="gmail_default">-Bill</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 8:09 AM, Wimpie Nortje <span dir="ltr"><<a href="mailto:wimpie@selectiveshare.com" target="_blank">wimpie@selectiveshare.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div>Thanks, I will do that.<br></div><span class="">
<div> </div>
<div><div>--<br></div>
<div>Wimpie Nortje<br></div>
<div>Strongroom - Host-proof notepad<br></div>
<div>Selective Share - Encryption-as-a-Service<br></div>
<div><a href="https://www.selectiveshare.com/?pk_campaign=email-sig" target="_blank">https://www.selectiveshare.com</a><br></div>
</div>
<div> </div>
<div> </div>
</span><div><div class="h5"><div>On Mon, Jun 8, 2015, at 02:05 PM, Hans Hübner wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div>Wimpie,<br></div>
<div> </div>
<div>the problem is caused by:<br></div>
<div> </div>
<div><div>(defpackage #:director<br></div>
<div> (:use #:cl<br></div>
<div> #:encryption)<br></div>
<div> (:export #:generate-key))<br></div>
</div>
<div> </div>
<div>I would recommend not :USEing the #:encryption package and instead qualify all external symbols.<br></div>
<div> </div>
<div>-Hans<br></div>
</div>
<div><div> </div>
<div><div>2015-06-08 8:00 GMT-04:00 Wimpie Nortje <span dir="ltr"><<a href="mailto:wimpie@selectiveshare.com" target="_blank">wimpie@selectiveshare.com</a>></span>:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><u></u><br></div>
<div><div>Hans,<br></div>
<div> </div>
<div>The example is below. I put all of it in a single file. When I load the file I get<br></div>
<div> </div>
<div>;Compiler warnings for "bug.lisp" :<br></div>
<div>; In GENERATE-KEY: In the call to GENERATE-KEY with arguments (NEW-USER NEW-PASSWD *LIBRARY-KEYS-DIR*),<br></div>
<div>; 3 arguments were provided, but at most 2 are accepted<br></div>
<div>; by the lexically visible definition of GENERATE-KEY<br></div>
<div> </div>
<div>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.<br></div>
<div> </div>
<div>Thanks for your time.<br></div>
<div> </div>
<div> </div>
<div>#|****************************************************************************|#<br></div>
<div>(in-package #:cl-user)<br></div>
<div> </div>
<div>(defpackage #:encryption<br></div>
<div> (:use #:cl)<br></div>
<div> (:export #:generate-key)) <br></div>
<div> </div>
<div>(in-package #:encryption)<br></div>
<div> </div>
<div>(defun generate-key (new-user new-passwd home-dir <br></div>
<div> &optional (out *standard-output*))<br></div>
<div> (declare (ignore new-user new-passwd home-dir out))<br></div>
<div> (print "Correct function called."))<br></div>
<div> </div>
<div>#|****************************************************************************|#<br></div>
<div>(in-package #:cl-user)<br></div>
<div> </div>
<div>(defpackage #:director<br></div>
<div> (:use #:cl<br></div>
<div> #:encryption)<br></div>
<div> (:export #:generate-key))<br></div>
<div> </div>
<div>(in-package #:director)<br></div>
<div> </div>
<div>(defparameter *library-keys-dir* #P"C:/tmp/keys")<br></div>
<div> </div>
<div>(defun generate-key (new-user new-passwd)<br></div>
<div> (encryption:generate-key new-user new-passwd *library-keys-dir*))<br></div>
<div> </div>
<div>#|****************************************************************************|#<br></div>
<div>(in-package :cl-user)<br></div>
<div> </div>
<div>(defpackage #:main<br></div>
<div> (:use #:cl))<br></div>
<div> </div>
<div>(in-package #:main)<br></div>
<div> </div>
<div>(director:generate-key "username" "gpg-passphrase")<br></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><div><span>--</span><br></div>
<div><span>Wimpie Nortje</span><br></div>
<div><span>Strongroom - Host-proof notepad</span><br></div>
<div><span>Selective Share - Encryption-as-a-Service</span><br></div>
<div><span><a href="https://www.selectiveshare.com/?pk_campaign=email-sig" target="_blank">https://www.selectiveshare.com</a></span><br></div>
</div>
<div> </div>
<div> </div>
<div> </div>
<div><div><div>On Mon, Jun 8, 2015, at 01:16 PM, Hans Hübner wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div>Wimpie,<br></div>
<div> </div>
<div>can you please supply us with a complete, working example of code that demonstrates the problem, in particular including the defpackage forms?<br></div>
<div> </div>
<div>Thanks,<br></div>
<div>Hans<br></div>
</div>
<div><div> </div>
<div><div>2015-06-08 7:03 GMT-04:00 Wimpie Nortje <span dir="ltr"><<a href="mailto:wimpie@selectiveshare.com" target="_blank">wimpie@selectiveshare.com</a>></span>:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi everyone,<br> <br>
I am porting my application from linux 64b to windows 32b. On windows<br>
CCL calls the wrong function while it works fine in linux.<br> <br>
In principle the code looks like this<br> <br>
(in-package :b)<br>
(defun fn (par1 par2 &optional (out *standard-output*)) [3]<br>
(do-stuff))<br> <br>
(in-package :a)<br>
(defun fn (par1 par2) [2]<br>
(b:fn par1 par2 *some-global*)) [1]<br> <br>
(in-package :main)<br>
(a:fn Val1 Val2)<br> <br> <br>
When I run this I get the following error:<br>
Too many arguments in call to #<Compiled-function B:FN #xE0A390E>:<br>
3 arguments provided, at most 2 accepted.<br>
[Condition of type CCL::TOO-MANY-ARGUMENTS]<br> <br>
It seems that the function call at [1] is calling the definition at [2]<br>
instead of the one at [3]. Also, when I do M-. (slime-edit-definition)<br>
at [1] it jumps to [2].<br> <br>
If I rename b:fn to something else without any other code changes, it<br>
works.<br> <br>
This code works unmodified on linux 64b. I have not yet tried on windows<br>
64b<br> <br>
Is this a bug or am I doing something wrong?<br> <br>
I am running CCL Version 1.10-r16196 (WindowsX8632) on Windows XP SP3.<br> <br> <br>
--<br>
Wimpie Nortje<br>
Strongroom - Host-proof notepad<br>
Selective Share - Encryption-as-a-Service<br> <a href="https://www.selectiveshare.com" target="_blank">https://www.selectiveshare.com</a><br>
_______________________________________________<br>
Openmcl-devel mailing list<br> <a href="mailto:Openmcl-devel@clozure.com" target="_blank">Openmcl-devel@clozure.com</a><br> <a href="https://lists.clozure.com/mailman/listinfo/openmcl-devel" target="_blank">https://lists.clozure.com/mailman/listinfo/openmcl-devel</a></blockquote></div>
<div> </div>
</div>
</blockquote><div> </div>
</div>
</div>
</div>
</blockquote></div>
<div> </div>
</div>
</blockquote></div></div></div>
<br>_______________________________________________<br>
Openmcl-devel mailing list<br>
<a href="mailto:Openmcl-devel@clozure.com">Openmcl-devel@clozure.com</a><br>
<a href="https://lists.clozure.com/mailman/listinfo/openmcl-devel" target="_blank">https://lists.clozure.com/mailman/listinfo/openmcl-devel</a><br>
<br></blockquote></div><br></div>