development release newLISP 9.2.16

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

development release newLISP 9.2.16

Post by Lutz »

More bug-fixes for the 9.3 release on February 1st.

Files and changes notes: http://newlisp.org/downloads/development/

Lutz

m i c h a e l
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Post 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

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

Post 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

Locked