Page 1 of 1
					
				development release newLISP 9.2.16
				Posted: Mon Jan 14, 2008 8:43 pm
				by Lutz
				More bug-fixes for the 9.3 release on February 1st.
Files and changes notes: 
http://newlisp.org/downloads/development/  
Lutz
 
			 
			
					
				
				Posted: Tue Jan 15, 2008 12:35 am
				by m i c h a e l
				Hi Lutz!
Thanks for the new release.
I've been incorporating the new syntax of 
assoc and 
set-assoc into the latest FOOP script and was surprised 
set-assoc didn't work like 
replace-assoc in the following way:
Code: Select all
(replace-assoc Lid (Jar (Lid))) ;=> (Jar) and $0 is (Lid)
(set '$0 nil)
(set-assoc ((Jar (Lid)) Lid)) ;=> (Jar (Lid)) and $0 is (Lid)
Is this intentional?
m i c h a e l
 
			 
			
					
				
				Posted: Tue Jan 15, 2008 1:05 pm
				by Lutz
				Yes, this is intentional. 'set-assoc' should behave like all other 'set'- functions returning the current version of the object, if the second argument is missing. In this case 'set-assoc' does not behave like 'replace-assoc', which can delete the element referenced.
In this case consistency with other 'set'- functions is more important than to maintain delete functionality  from 'replace-assoc', which will stay until something else can take its place.
There is a lot more to say about this, but without introducing a new pair of functions (e.g. pop-ref pop-assoc) for eliminating elements in a list by search, the current situation seems to be a good compromise.
Lutz