4 ms·
> who sent me a Lisp program computing ... I don't really know Lisp, but how do you get a Lisp to run that expression? I tried it in Emacs Lisp, Racket, Common
by thundergolfer 6y ago
> who sent me a Lisp program computing ...
I don't really know Lisp, but how do you get a Lisp to run that expression? I tried it in Emacs Lisp, Racket, Common Lisp.
It runs just fine in Python, and returns: 29760
- hstaab 6y agoYou must write your own lisp, and that’s the beauty of it.
- qinjian623 6y agoThis is the lisp-way: (* 48 (+ (* 4 10) (* 2 30) (* 5 20) (* 6 20) (* 6 25) (* 15 10) ))
- fredrikholm 6y ago> # sum(years * (hours/week)) * (weeks/year) Appears to be Python? Here's it converted to Common Lisp: (defun sum (years hours-per-week weeks-per-year) (* (* years hours-per-week) weeks-per-year))
- atleta 6y agoDefinitely not LISP. LISP uses a prefix notation, the expression in the post uses infix (like most programming languages).
- breck 6y agoYes it's definitely Python. Not sure why I wrote Lisp (other than that my variants of Lisp look like that, with mixed fix notation).