From: Marc Tfardy <bum@cyk.cyk>
To: help-gnu-emacs@gnu.org
Subject: Re: Element-Relative Sequence Insertion
Date: Thu, 11 Jun 2009 17:01:09 +0200 [thread overview]
Message-ID: <h0r67m$tu9$3@news.onet.pl> (raw)
In-Reply-To: <7chbym25xy.fsf@pbourguignon.anevia.com>
>>> It does, but you have to decrypt it first.
>> (defun insert-after (elt lst new)
>> (cond ((null lst)
>> '())
>> ((eq new (car lst))
>> (cons (car lst) (cons elt (cdr lst))))
>> (t
>> (cons (car lst) (insert-after elt (cdr lst) new)))))
>>
>> (defun insert-before (elt lst new)
>> (cond ((null lst)
>> '())
>> ((eq new (car lst))
>> (cons elt lst))
>> (t
>> (cons (car lst) (insert-before elt (cdr lst) new)))))
>>
>> What is the price? ;-)
>
> What's the point in renaming the parameters and introducing bugs?
>
> Check again the order of the parameters!
OK, this was a mistake. But it's "only" cosmetics ;-) I tested this
with:
(insert-after 'X '(a b c) 'b)
(a b X c)
(insert-before 'X '(a b c) 'b)
(a X b c)
so I unintended assumed your right arguments order ;)
> Notice that (eq 3.141592 3.141592) --> nil ; which is the reason why
> eql should be used by default.
Yes, this was my big fault. Sorry.
> And bad points for not being able to use rot13.
>
> You lose. :-)
Oh shit... :-)
regards
Marc
next prev parent reply other threads:[~2009-06-11 15:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 12:11 Element-Relative Sequence Insertion Nordlöw
2009-06-11 12:38 ` Pascal J. Bourguignon
2009-06-11 12:51 ` Nordlöw
2009-06-11 13:01 ` Pascal J. Bourguignon
2009-06-11 14:18 ` Marc Tfardy
2009-06-11 14:36 ` Pascal J. Bourguignon
2009-06-11 15:01 ` Marc Tfardy [this message]
2009-06-13 16:47 ` Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='h0r67m$tu9$3@news.onet.pl' \
--to=bum@cyk.cyk \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).