From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: identity function with an echo side effect Date: Wed, 11 Aug 2010 16:19:43 +0200 Organization: Informatimago Message-ID: <87ocd99qps.fsf@kuiper.lan.informatimago.com> References: <324e9d4c-b083-42a3-aa88-4e7b918042e3@h32g2000yqm.googlegroups.com> <87eie6ax5b.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291865231 28903 80.91.229.12 (9 Dec 2010 03:27:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 03:27:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 04:27:07 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQX9u-0007iu-V3 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:27:07 +0100 Original-Received: from localhost ([127.0.0.1]:43804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQX9u-0002Gz-Ai for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:27:06 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help, comp.emacs, comp.emacs.xemacs, gnu.emacs, comp.lang.lisp Original-Lines: 77 Original-X-Trace: individual.net PCi06z7dR5KPnlNnDxCjOg5qhoMLNswFSxkWMsoTd6zLWIrCS5 Cancel-Lock: sha1:Y2E3OTAxOTJjMTgxYzIzYWJjZjBhODE5MzJiYzQ3MTNmMjJkNDJlZg== sha1:nB2Rt07cdbTdtc6TWiocNfKR4PI= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.101 (Gnus v5.10.10) Emacs/23.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:180580 comp.emacs:100337 comp.emacs.xemacs:82488 comp.lang.lisp:291103 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76546 Archived-At: bolega writes: > On Aug 10, 4:03 pm, p...@informatimago.com (Pascal J. Bourguignon) > wrote: >> bolega writes: >> > After searching google groups and emacs apropos extensively, I could >> > not find a function, perhaps I am missing one that can return >> > identically return its argument and has a small side effect of echoing >> > the argument in some place such as for example >> >> > the mini buffer or the point at which C-x C-e is typed. >> >> > For example, calling this function "echo" , usage would look like >> > this : >> >> > (cdr ( echo (cdr (echo (cdr (echo '(a b c d))))))) >> >> > echo: >> > '(a b c d) or (a b c d)  (I am not sure which would be appropriate) >> > (b c d) >> > (c d) >> >> > result: >> > (d) >> >> > Is there a need for quotes to prevent evaluation of alphabets at any >> > phase ? No. Expressions are evaluated only by EVAL or LOAD (and at compilation time, compilation time expressions by COMPILE and COMPILE-FILE). Otherwise, values are just values, they don't get evaluated magically (for what reason should they?) >> In Common Lisp, you can use PRINT for this. >> >> CL-USER> (cdr (print (cdr (print (cdr (print '(a b c d))))))) >> >> (A B C D) >> (B C D) >> (C D) >> (D) >> CL-USER> >> [...] > > If you dont mind, how many years have you spent on learning emacs/ > lisp ? 20 years. > Can you kindly give a reading syllabus, books list and possibly time > for completion from your perspective and what to get out of each book > since they have some common repetition. http://www.cliki.net/admin/search?words=books In particular, I like to advise: Common Lisp: A Gentle Introduction to Symbolic Computation http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html http://www.cs.cmu.edu/~dst/LispBook/ > Are there any implicit quotations taking place in the above sequence > of cdr, print ... ? Since CDR and PRINT are function, no implicit quotation occurs: the result values are directly passed as argument to the next function. Only macros receive their arguments un-evaluated, which could be characterized as an "implicit quotation". -- __Pascal Bourguignon__ http://www.informatimago.com/