Page 1 of 1

nth-set in Ubuntu Linux

Posted: Sun Oct 03, 2010 2:57 pm
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?

Re: nth-set in Ubuntu Linux

Posted: Sun Oct 03, 2010 3:22 pm
by Kazimir Majorinc
Use setf instead of nth-set.

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

Re: nth-set in Ubuntu Linux

Posted: Sun Oct 03, 2010 4:05 pm
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.

Re: nth-set in Ubuntu Linux

Posted: Sun Oct 03, 2010 5:37 pm
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. :)

Re: nth-set in Ubuntu Linux

Posted: Sun Oct 03, 2010 5:58 pm
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.