> A workaround (that would temporarily loose wxMaxima's ability to set
> maxima's current working directory until a fix is found) would be
> deleting the line from the affected file that reads:

>        #+gcl (si:chdir dir)

> Will fix the bug as soon as someone finds out how.

Hi,

I think you just have to add a colon:

Change

        #+gcl (si:chdir dir)

into

        #+gcl (si::chdir dir)

On my system, the error message vanishes and I can call the "wxcd"
function from within maxima (maxima appears to work normally, too):

         :lisp (wx-cd "/usr/lib/");
         /usr/lib/

I think the bug is caused because in newer versions of gcl, "chdir"
is still defined in the "si" package, but isn't exported---meaning that
it does not belong to the public part of the API of the package which
is accessible from other packages by calling it with the package name
and a one colon qualifier.  Using two colons makes it possible to
access any symbol in a package[1]. 

I believe it's a bug in gcl (I'm not a Lisper).

On a Debian Stable box, I get the following result when calling
"si:chdir":

icafe@cafe2016:~$ gcl
GCL (GNU Common Lisp)  2.6.12 CLtL1    Oct 28 2014 10:02:30
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/

>(si:chdir "/home")

"/home"

Doing the same on Debian Unstable:

toto@talkietoaster: ~ $ /usr/bin/gcl                                            
                                                [12:34:07]
GCL (GNU Common Lisp)  2.6.12 CLtL1    Fri Apr 22 15:51:11 UTC 2016
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License:  GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files:
/tmp/

>(si:chdir "/home")

Error: ERROR "Cannot find the external symbol CHDIR in #<\"SYSTEM\" package>."
Fast links are on: do (si::use-fast-links nil) for debugging
Signalled by SYSTEM::GCL-TOP-LEVEL.
ERROR "Cannot find the external symbol CHDIR in #<\"SYSTEM\" package>."

Broken at SYSTEM::GCL-TOP-LEVEL.  Type :H for Help.
    1  Return to top level. 
>>1

Top level.
>(si::chdir "/home")

#p"/home/"

I can fix this by manually exporting "chdir":

>(in-package :si)

#<"SYSTEM" package>

SYSTEM>(export 'chdir)

T

SYSTEM>(in-package "COMMON-LISP-USER")

#<"COMMON-LISP-USER" package>

>(si:chdir "/home")

#p"/home/"

The output is somewhat different, "/home/" vs. #p"/home/". I don't
know if that's important.

Toto


Footnotes: 
[1]  Peter Seibel: Practical Common Lisp, chapter 21, page 264 
(http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html)

Reply via email to