all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dan Espen <despen@verizon.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs Lisp vs Perl: Validate Local File Links
Date: Fri, 13 Apr 2012 14:54:44 -0400	[thread overview]
Message-ID: <icsjg7xy17.fsf@home.home> (raw)
In-Reply-To: af59724c-c91b-4201-b40d-3717a75c07a5@8g2000pbm.googlegroups.com

Xah Lee <xahlee@gmail.com> writes:

> 〈Emacs Lisp vs Perl: Validate Local File Links〉
> http://xahlee.org/emacs/elisp_vs_perl_validate_links.html
>
> a comparison of 2 scripts.
>
> lots code, so i won't paste plain text version here.
>
> i have some comments at the bottom. Excerpt:
>
> ------------------
>
> «One thing interesting is to compare the approaches in perl and emacs
> lisp.»
>
> «For our case, regex is not powerful enough to deal with the problem
> by itself, due to the nested nature of html. This is why, in my perl
> code, i split the file by < into segments first, then, use regex to
> deal with now the non-nested segment. This will break if you have <a
> title="x < href=z" href="math.html">math</a>. This cannot be worked
> around unless you really start to write a real parser.»
>
> «The elisp here is more powerful, not because of any lisp features,
> but because emacs's buffer datatype. You can think of it as a
> glorified string datatype, that you can move a cursor back and forth,
> or use regex to search forward or backward, or save cursor positions
> (index) and grab parts of text for further analysis.»
>
> ------------------
>
> If you are a perl coder, and disagree, let me know your opinion.
> (showing working code is very welcome) My comment about perl there
> applies to python too. (python code welcome too.)

Interesting.

Perl, Python, and Lisp have real HTML parsers available.
I've used the ones for Perl and Python.

-- 
Dan Espen


      reply	other threads:[~2012-04-13 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 17:35 Emacs Lisp vs Perl: Validate Local File Links Xah Lee
2012-04-13 18:54 ` Dan Espen [this message]

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=icsjg7xy17.fsf@home.home \
    --to=despen@verizon.net \
    --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.