From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Swami Tota Ram Shankar Newsgroups: gmane.emacs.help Subject: Re: Style Issues in Lisp and Scheme programming, setq versus let ... and onion structure with multiple cores or eyes or kernels Re: string to list or string to array Date: Mon, 22 Oct 2012 20:02:00 -0700 (PDT) Message-ID: <492ccf3f-9658-4446-913e-3d0600011702@y8g2000yqy.googlegroups.com> References: <62642868-f757-4115-a047-34c319a1c30f@o5g2000yqi.googlegroups.com> <87pq4c848a.fsf@kuiper.lan.informatimago.com> <4e87f58c-72fc-457b-8596-c792c39472e5@m4g2000yqb.googlegroups.com> <87zk3f7ey7.fsf@kuiper.lan.informatimago.com> <657d823b-990f-4a2b-a57c-2c644099ddcd@z2g2000yqj.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1350961516 9771 80.91.229.3 (23 Oct 2012 03:05:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Oct 2012 03:05:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 23 05:05:23 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TQUny-0007Ev-Dj for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Oct 2012 05:05:22 +0200 Original-Received: from localhost ([::1]:45654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQUno-0002RQ-7m for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Oct 2012 23:05:12 -0400 Original-Received: by 10.224.189.16 with SMTP id dc16mr5164979qab.0.1350961320834; Mon, 22 Oct 2012 20:02:00 -0700 (PDT) Original-Received: by 10.182.74.35 with SMTP id q3mr696800obv.17.1350961320674; Mon, 22 Oct 2012 20:02:00 -0700 (PDT) Original-Path: usenet.stanford.edu!x14no4961676qar.0!news-out.google.com!r17ni57592152qap.0!nntp.google.com!x14no4961674qar.0!postnews.google.com!y8g2000yqy.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp,comp.lang.scheme Complaints-To: groups-abuse@google.com Injection-Info: y8g2000yqy.googlegroups.com; posting-host=108.82.92.30; posting-account=dlefMQoAAABzowG6c0cULB8igkwPchCd Original-NNTP-Posting-Host: 108.82.92.30 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0,gzip(gfe) Injection-Date: Tue, 23 Oct 2012 03:02:00 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:195045 comp.emacs:102646 comp.lang.lisp:311480 comp.lang.scheme:89159 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87374 Archived-At: On Oct 22, 7:36=A0pm, PJ Weisberg wrote: > On Mon, Oct 22, 2012 at 6:16 PM, Swami Tota Ram Shankar > > wrote: > > For example, the imperative programming style, flows nicely from top > > to bottom. The eye has to move L->R and top to bottom to understand > > the screenful module, as in C. > > > I have found that let, and functional style leads to an onion type > > structure. > > > f(g(h(x,y),z,k(alpha,beta,l(theta)))w) > > That could be valid C code, but it's probably not Lisp code, unless > you really do have a function named "x,y". > > > If it is short, its not an issue, but the multiple cores or eyes of > > the onion, makes it impossible to grasp the structure. > > Just one small tip: when reading lisp code, pay more attention to the > indentation then to the parentheses. =A0Of course the > compiler/interpreter doesn't pay attention to the indentation, but the > author probably did. > Can you suggest some skeleton (defun function (var1 var2 var3) "" (interactive "swith strings and \ns to allow suggested defaults and avoid typing and simply RTN") taking care of defaults if null or "" (let* (()()()) ) ) btw, lisp's prefix notation, (f x y z) is more expressive and convenient for expressing currying (((f x) y) z) than f(x y z). I expect incisive and penetrating analysis of code organization and using that to improve readability.