nth-set in Ubuntu Linux

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
jopython
Posts: 123
Joined: Tue Sep 14, 2010 3:08 pm

nth-set in Ubuntu Linux

Post by jopython »

I am going through the documentation (Introduction to newlisp) and trying to use nth-set as mentioned in page 70:

Code: Select all

$ newlisp
newLISP v.10.2.8 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info.

> (set 't "a b c")
"a b c"
> (nth-set (t 0) ">")

ERR: invalid function : (nth-set (t 0) ">")
What am I doing wrong here?

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Re: nth-set in Ubuntu Linux

Post by Kazimir Majorinc »

Use setf instead of nth-set.

Be careful not to confuse ">" with command prompt!

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

Re: nth-set in Ubuntu Linux

Post by Lutz »

'set-nth' and 'nth-set' were deprecated in version 10.0 (December 2008). Today 'setf' and 'setq' are used to modify places inside lists.

Perhaps you are using an older version of the "Introduction to newLISP" document? You can find a current version here:

http://www.newlisp.org/introduction-to-newlisp-us.pdf

and also accessible from this page:

http://www.newlisp.org/index.cgi?Documentation

If you find any documentation or code on the http://www.newlisp.org web site using these deprecated functions, please let us know, so it can be corrected.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: nth-set in Ubuntu Linux

Post by cormullion »

Sorry if you've found errors in the Intro.

I try to keep up with the constant flow of changes to newLISP terminology, but it's difficult. :) At the moment most of the newLISP documents and code I handle have been updated to at least later 10.1 and early 10.2 versions. There are compatibility issues with versions <= 10.1, and I haven't yet updated anything for the imminent 10.3 version. Older code may encounter problems. Reading release notes is recommended to all who wish to use any newLISP code not distributed as part of the official release!

On Wikibooks, the Intro book (the most recent version) is more or less level with version 10.1 or thereabouts. It requires updating for 10.2.

I'm hoping that newLISP 10.3 will be stable for long enough for me to update everything for compatibility. Time will tell. :)

jopython
Posts: 123
Joined: Tue Sep 14, 2010 3:08 pm

Re: nth-set in Ubuntu Linux

Post by jopython »

Thank you all for the quick response. It's one of those things which makes me interested in newlisp.

It seems i was reading Aug 2008 version 'Intro to newlisp' which had the nth-set.
Its not there in Dec 2008 version anymore.

Locked