nth-set in Ubuntu Linux

Started by jopython, October 03, 2010, 07:57:58 AM

Previous topic - Next topic

jopython

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


$ 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

#1
Use setf instead of nth-set.



Be careful not to confuse ">" with command prompt!
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

Lutz

#2
'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">http://www.newlisp.org/introduction-to-newlisp-us.pdf



and also accessible from this page:



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



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

cormullion

#3
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

#4
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.