Cody

Problem 44382. Parse me a Lisp

Description

In Lisp and its variants, function calls are done using parenthesis where the first item in the parenthesis is the function being called and the following items are arguments to the function. Given a mathematical ( + - * / ) expression using this notation, return the result. Note: In Lisp, functions that normally take only two arguments can be called with many arguments, with the function being applied to all elements from left to right.

Simple example

(+ 1 1 1 1 1)

would give 5.

Complicated example

(* (* 10 (+ 1 4)) (+ 10 (/ 12 2 3) 1) 0.1)

would give 65.

Solution Stats

37.5% Correct | 62.5% Incorrect
Last solution submitted on May 23, 2019

Problem Comments

Solution Comments

Recent Solvers61

Suggested Problems

More from this Author57