News for hackers. Stuff that matters.
Re:30k Hours (2019) by thundergolfer on Thursday February 25, 2021 @09:24PM (#26270819)
> 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

Re:30k Hours (2019) by fredrikholm on Friday February 26, 2021 @04:22AM (#26272885)
> # 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))
Re:30k Hours (2019) by hstaab on Thursday February 25, 2021 @11:05PM (#26271250)
You must write your own lisp, and that’s the beauty of it.
Re:30k Hours (2019) by atleta on Friday February 26, 2021 @08:37AM (#26274613)
Definitely not LISP. LISP uses a prefix notation, the expression in the post uses infix (like most programming languages).
Re:30k Hours (2019) by breck on Friday February 26, 2021 @09:35AM (#26275159)
Yes it's definitely Python. Not sure why I wrote Lisp (other than that my variants of Lisp look like that, with mixed fix notation).
Re:30k Hours (2019) by qinjian623 on Friday February 26, 2021 @04:16AM (#26272842)
This is the lisp-way:

(* 48 (+ (* 4 10) (* 2 30) (* 5 20) (* 6 20) (* 6 25) (* 15 10) ))