LISP Functions
$10-30 USD
Paid on delivery
Hi I just started learning LISP, and I need someone to help me figure out how to write some functions. Message me for details
Define a function `Last` that takes two parameters, a symbol A and a list of symbols L, and returns the list starting where the last occurrence of symbol A is in L. It returns nil only if A is not in the list.
Examples:
. (Last 'a '(a b c a b c a b c d e f g)) --> (a b c d e f g)
. (Last 'b '(a b c a b c a b c d e f g)) --> (b c d e f g)
. (Last 'c '(a b c a b c a b c d e f g)) --> (c d e f g)
. (Last 'g '(a b c a b c a b c d e f g)) --> (g)
. (Last 'h '(a b c a b c a b c d e f g)) --> nil
Project ID: #18071595