From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: Return value not as expected in Emacs Lisp function Date: Wed, 07 Aug 2013 23:07:05 +0200 Organization: Informatimago Message-ID: <87pptpnrba.fsf@informatimago.com> References: <8738qlfic3.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1375909694 30091 80.91.229.3 (7 Aug 2013 21:08:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Aug 2013 21:08:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 07 23:08:17 2013 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 1V7Axt-0005SR-0g for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Aug 2013 23:08:17 +0200 Original-Received: from localhost ([::1]:37387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7Axs-0007ou-I5 for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Aug 2013 17:08:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7AxL-0007Sw-Ff for help-gnu-emacs@gnu.org; Wed, 07 Aug 2013 17:07:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7AxF-0000Tq-Lt for help-gnu-emacs@gnu.org; Wed, 07 Aug 2013 17:07:43 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7AxF-0000Tf-GI for help-gnu-emacs@gnu.org; Wed, 07 Aug 2013 17:07:37 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V7AxD-0004yO-By for help-gnu-emacs@gnu.org; Wed, 07 Aug 2013 23:07:35 +0200 Original-Received: from amontsouris-651-1-213-230.w92-140.abo.wanadoo.fr ([92.140.4.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Aug 2013 23:07:35 +0200 Original-Received: from pjb by amontsouris-651-1-213-230.w92-140.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 07 Aug 2013 23:07:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: amontsouris-651-1-213-230.w92-140.abo.wanadoo.fr Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:NGM4NWExZmY0YTkxOWQ5MzU2NTQ3MjUwNjFiNzRmYTM2YjQ1ZWRhZQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:92772 Archived-At: Thorsten Jolitz writes: > and I ask myself what happened between the second-last and the last line of > the function? I cannot reproduce this with a MWE, and the real function is too > convoluted to present it here, so I keep the problem description on an > abstract level. On an abstract leve, I can't debug a function if I don't have it's code. That's the reason d'être of the MWE, and by default the real code. > I'm actually only interested in the result string as a return value, the > message statement is just for logging. But why is the string produced by > 'mapconcat' missing in the return value? The real question is why you use mapconcat to produce a string representation of a sexp? Just use prin1-to-string! (let ((list '((click NIL 1) (press NIL 1) (click NIL 4) (click NIL 1)))) (prin1-to-string `(prog ,@list ))) --> "(prog (click NIL 1) (press NIL 1) (click NIL 4) (click NIL 1))" Notice: - emacs lisp is a lisp-2, not a lst-1. - NIL is true: (not (not 'NIL)) --> t (not 'NIL) --> nil (if 'NIL 'true 'false) --> true -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. You know you've been lisping too long when you see a recent picture of George Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin