On 2019-04-06 9:50 am, Thomas Morley wrote:
Though, I'd think you should rethink whatever you plan, I'm very
skeptic about always resetting a toplevel defined list.
It's too destructive.

Also, it is convention to use an exclamation point as a suffix when naming procedures that may modify the structure of arguments to produce their results. This makes it easier for users to know where side effects might exist.

Consider this:

%%%%
#(define (1+last! lst) (list-set! lst (- (length lst) 1) (1+ (last lst))))

#(define foo '(1 2 3))
#(1+last! foo)
#(format #t "\nfoo = ~a" foo)
#(1+last! foo)
#(format #t "\nfoo = ~a" foo)
%%%%


-- Aaron Hill

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to