From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Scheidt Newsgroups: gmane.emacs.help Subject: Re: program to compute gears, with table Date: Fri, 8 Sep 2017 17:09:42 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: References: <86bmmlu54a.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1504890631 8876 195.159.176.226 (8 Sep 2017 17:10:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Sep 2017 17:10:31 +0000 (UTC) User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/7.1 (i386)) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 08 19:10:27 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqMnO-0001pD-08 for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 19:10:22 +0200 Original-Received: from localhost ([::1]:46550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqMnV-0001r9-3k for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 13:10:29 -0400 Original-Path: usenet.stanford.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help,rec.bicycles.tech Original-Lines: 26 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader2.panix.com 1504890582 1370 166.84.1.3 (8 Sep 2017 17:09:42 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Fri, 8 Sep 2017 17:09:42 +0000 (UTC) Original-Xref: usenet.stanford.edu gnu.emacs.help:220094 rec.bicycles.tech:1003519 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114200 Archived-At: In rec.bicycles.tech Emanuel Berg wrote: :Hey guys, does this look right to you? As noted, you need to consider the diameter of the wheel including its tire. The style is awful. In straight common lisp: (defun compute-gear (chainring sprocket wheel) (list chainring sprocket (* (/ chainring sprocket) (* 3.14 wheel)))) (defun gear (chainring sprocket w) (let ((g)) (dolist (c chainring) (dolist (s sprocket) (push (compute-gear c s w) g))) (sort g #'< :key #'third))) (defun print-gears (chainring sprocket wheel) (format nil "~:{ ~d ~d ~f ~%~}" (gear chainring sprocket wheel))) -- sig 46