;;; Procedure: ;;; snoc ;;; Parameters: ;;; lst, a list ;;; val, any kind of value ;;; Purpose: ;;; Add val to the end of lst ;;; Produces: ;;; newlst, a list ;;; Preconditions: ;;; [Standard] ;;; Postconditions: ;;; (list-ref newlst pos) = (list-ref lst pos) for all positions in lst. ;;; (list-ref newlst (length lst)) = val (define snoc (lambda (lst val) (append lst (list val))))