Unix module, Protected symbols

Q&A's, tips, howto's
Locked
semperos
Posts: 12
Joined: Thu Mar 15, 2012 4:50 am

Unix module, Protected symbols

Post by semperos »

Using newLISP 10.4.0, Mac OSX Lion.

At command-line, I start a newLISP REPL with `newlisp`. I get a prompt. I then load the unix module that comes with newLISP like this:

Code: Select all

(load "/usr/share/newlisp/modules/unix.lsp")
This file does, indeed, exist at that location. When I evalute this, I get the following error:

Code: Select all

ERR: symbol is protected in function define : (setuid id)
I'm in the MAIN context when trying this. Am I doing something wrong?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Unix module, Protected symbols

Post by Lutz »

Since version 10.4.0 imported library symbols are protected, which let the old unix.lsp fail when loading. Only this unix.lsp makes extensive use of overwriting symbols.

A fixed version 0.4 can be found here (clear your cache, if accessed earlier):

http://www.newlisp.org/code/modules/unix.lsp.html

also accessible from the modules page in the "Index:Standard" subsection on this page:

http://www.newlisp.org/modules/

Note, this module is still little tested (even the previous version). Any suggestions, improvements or additions are welcome.

Ps: Yes, you should typically load this/all modules from the MAIN context.

semperos
Posts: 12
Joined: Thu Mar 15, 2012 4:50 am

Re: Unix module, Protected symbols

Post by semperos »

Great! Thanks for the fix and the info.

Locked