Newsgroups: gnu.emacs.help, comp.emacs, comp.emacs.xemacs, gnu.emacs, comp.lang.lisp
From: p...@informatimago.com (Pascal J. Bourguignon)
Date: Wed, 11 Aug 2010 01:03:12 +0200
Local: Tues, Aug 10 2010 7:03 pm
Subject: Re: identity function with an echo side effect
bolega <gnuist...@gmail.com> writes: In Common Lisp, you can use PRINT for this. > 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 > (cdr ( echo (cdr (echo (cdr (echo '(a b c d))))))) > echo: > result: > Is there a need for quotes to prevent evaluation of alphabets at any CL-USER> (cdr (print (cdr (print (cdr (print '(a b c d))))))) (A B C D) In emacs lisp too, but the output of print goes to the *Message* buffer. M-x ielm RET and you get: (a b c d) (b c d) (c d) in the minibuffer and in *Message*. Or, in an emacs lisp buffer: (cdr (print (cdr (print (cdr (print '(a b c d))))))) C-u C-x C-e inserts: (a b c d) (b c d) (c d) -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||