all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: weber <hugows@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: "push" creating circular objects
Date: Wed, 20 Aug 2008 14:50:08 -0700 (PDT)	[thread overview]
Message-ID: <efb2e8e5-292c-42d6-b77b-430dd72a745a@2g2000hsn.googlegroups.com> (raw)
In-Reply-To: uabf7tsiw.fsf@gmail.com

On Aug 20, 4:07 pm, Charles Sebold <cseb...@gmail.com> wrote:
> On 20 Aug 2008, Charles Sebold wrote:
>
> > I just changed it from push to append, with no change in behavior:
>
> Now I tried something even more radical, a completely different approach
> to the problem, just to see what happens.
>
> (defun Textile-list-context (textile-list-tag)
>   "Return list of HTML tags corresponding to list context (ol, ul)."
>   (let ((my-list (delete " " (delete "" (split-string textile-list-tag "")))))
>     (mapcar (lambda (x)
>               (cond
>                ((string= x "#")
>                 "ol")
>                ((string= x "*")
>                 "ul")
>                (t
>                 nil))) my-list)))
>
> _It still returns a circular list._
>
> And it still does the right thing, when I call it from a scratch buffer.
>
> Clearly there is something deep about lists that I don't get right now.
> --
> Charles Sebold                                      20th of August, 2008

Minor variation:

(defun test2 (str)
  (let (my-list)
	(with-temp-buffer
	  (insert str)
	  (goto-char (point-min))
	  (while (not (eobp))
		(cond
		  ((= (char-after) ?#)
		   (push "ol" my-list))
		  ((= (char-after) ?*)
		   (push "ul" my-list)))
		(forward-char 1)))
	my-list))

no need to bind my-list to nil too :)

-hugo


  parent reply	other threads:[~2008-08-20 21:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 13:25 "push" creating circular objects Charles Sebold
2008-08-20 16:27 ` Charles Sebold
2008-08-20 19:07   ` Charles Sebold
2008-08-20 21:47     ` weber
2008-08-20 21:50     ` weber [this message]
2008-08-21 14:12       ` Charles Sebold
2008-08-21 14:25         ` xraysmalevich
2008-08-21 15:23           ` Charles Sebold
2008-08-21 18:41         ` Pascal J. Bourguignon
2008-08-21 20:25           ` Charles Sebold
2008-08-21 16:14 ` John Paul Wallington
2008-08-21 16:49   ` Charles Sebold
2008-08-23 11:43     ` Nikolaj Schumacher
2008-08-23 12:17     ` Pascal J. Bourguignon

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efb2e8e5-292c-42d6-b77b-430dd72a745a@2g2000hsn.googlegroups.com \
    --to=hugows@gmail.com \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.