all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: find.el --- Build a valid find(1) command with sexps
       [not found] <87k5ji3jd6.fsf@shellarchive.co.uk>
@ 2008-04-01 16:55 ` Richard Stallman
  2008-04-01 17:52   ` Phil Jackson
  2008-04-01 21:17   ` Mathias Dahl
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Stallman @ 2008-04-01 16:55 UTC (permalink / raw)
  To: Phil Jackson; +Cc: emacs-devel

    As the commentary states:

	(find (prune (name ".svn" ".git" ".CVS"))
	      (and (or (name "*.pl" "*.pm" "*.t")
		       (mtime "+1"))
		   (fstype "nfs" "ufs")))

    will become (un-wrapped):

	"find '/home/phil/' \\( \\( -name '.svn' -or -name '.git' -or
	 -name '.CVS' \\) -prune -or -true \\) \\( \\( \\( -name '*.pl'
	 -or -name '*.pm' -or -name '*.t' \\) -or -mtime '+1' \\) -and \\(
	 -fstype 'nfs' -or -fstype 'ufs' \\) \\)"

That seems like a nice feature to add to Emacs,
though I think the entry point's name needs to be something longer
than just `find'.

Also, I think that it should be a function rather than a macro.
(That would require explicitly quoting the arguments.)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: find.el --- Build a valid find(1) command with sexps
  2008-04-01 16:55 ` find.el --- Build a valid find(1) command with sexps Richard Stallman
@ 2008-04-01 17:52   ` Phil Jackson
  2008-04-02 18:45     ` Phil Jackson
  2008-04-01 21:17   ` Mathias Dahl
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Jackson @ 2008-04-01 17:52 UTC (permalink / raw)
  To: rms; +Cc: Phil Jackson, emacs-devel

Richard Stallman <rms@gnu.org> writes:

[...]

> That seems like a nice feature to add to Emacs, though I think the
> entry point's name needs to be something longer than just `find'.

I've changed the name to `find-cmd' after a couple of people pointed out
the cl clash. Michael Olson suggested `make-find-cmd' but I've always
liked to start a function name with something obviously relating to the
function. Still, certainly willing  to change it again.

I would be very happy for it to go in, I've signed the papers already.

> Also, I think that it should be a function rather than a macro.
> (That would require explicitly quoting the arguments.)

I've made that change, will upload to my website.

Cheers,
Phil
-- 
 Phil Jackson
 http://www.shellarchive.co.uk




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: find.el --- Build a valid find(1) command with sexps
  2008-04-01 16:55 ` find.el --- Build a valid find(1) command with sexps Richard Stallman
  2008-04-01 17:52   ` Phil Jackson
@ 2008-04-01 21:17   ` Mathias Dahl
  2008-04-02  1:41     ` Mike Mattie
  2008-04-02  2:53     ` Richard Stallman
  1 sibling, 2 replies; 6+ messages in thread
From: Mathias Dahl @ 2008-04-01 21:17 UTC (permalink / raw)
  To: rms; +Cc: Phil Jackson, emacs-devel

>  Also, I think that it should be a function rather than a macro.
>  (That would require explicitly quoting the arguments.)

Could some explain to a lisp beginner like me what the benefit is? The
macro version seems easier to use as you don't have to quote the
arguments - to me that seems like a good thing.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: find.el --- Build a valid find(1) command with sexps
  2008-04-01 21:17   ` Mathias Dahl
@ 2008-04-02  1:41     ` Mike Mattie
  2008-04-02  2:53     ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Mike Mattie @ 2008-04-02  1:41 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

On Tue, 1 Apr 2008 23:17:10 +0200
"Mathias Dahl" <mathias.dahl@gmail.com> wrote:

> >  Also, I think that it should be a function rather than a macro.
> >  (That would require explicitly quoting the arguments.)
> 
> Could some explain to a lisp beginner like me what the benefit is? The
> macro version seems easier to use as you don't have to quote the
> arguments - to me that seems like a good thing.
> 
> 

I rather like macros but they have their own dangers. The programmer is required to see the code in two
phases at the same time: compile phase, and evaluation phase. Also elisp macros are not hygienic
so there is always the possibility of unintended capture for more complex macros. Also for debugging to
work you need to define a debug spec. Debug-ability goes down as the complexity of the macro increases.

The KISS principle is to engineering what Occam's razor is to science.

Another issue that I haven't seen mentioned is that macros set a far higher bar for documentation.
With the great power of the macro comes a great responsibility to explain to others clearly and
succinctly what your macro does.

These are my experiences at least. I wouldn't concede macros for any other feature in a language,
but they require judicious application.

Macros are certainly not a wand to wave away quotes, though a may have written a few like that ... *couph*.

Cheers,
Mike Mattie

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: find.el --- Build a valid find(1) command with sexps
  2008-04-01 21:17   ` Mathias Dahl
  2008-04-02  1:41     ` Mike Mattie
@ 2008-04-02  2:53     ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2008-04-02  2:53 UTC (permalink / raw)
  To: Mathias Dahl; +Cc: nntp, emacs-devel

    >  Also, I think that it should be a function rather than a macro.
    >  (That would require explicitly quoting the arguments.)

    Could some explain to a lisp beginner like me what the benefit is? The
    macro version seems easier to use as you don't have to quote the
    arguments - to me that seems like a good thing.

A function is better because
(1) you can compute the arguments, and
(2) in general it is better to avoid using macros when they
are not really needed.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: find.el --- Build a valid find(1) command with sexps
  2008-04-01 17:52   ` Phil Jackson
@ 2008-04-02 18:45     ` Phil Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Jackson @ 2008-04-02 18:45 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

Phil Jackson <phil@shellarchive.co.uk> writes:

>> That seems like a nice feature to add to Emacs, though I think the
>> entry point's name needs to be something longer than just `find'.
>
> I've changed the name to `find-cmd' after a couple of people pointed out
> the cl clash. Michael Olson suggested `make-find-cmd' but I've always
> liked to start a function name with something obviously relating to the
> function. Still, certainly willing  to change it again.
>
> I would be very happy for it to go in, I've signed the papers already.

Attached if anyone wants it...


[-- Attachment #2: find.el --]
[-- Type: application/emacs-lisp, Size: 7686 bytes --]

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


Cheers,
Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-04-02 18:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87k5ji3jd6.fsf@shellarchive.co.uk>
2008-04-01 16:55 ` find.el --- Build a valid find(1) command with sexps Richard Stallman
2008-04-01 17:52   ` Phil Jackson
2008-04-02 18:45     ` Phil Jackson
2008-04-01 21:17   ` Mathias Dahl
2008-04-02  1:41     ` Mike Mattie
2008-04-02  2:53     ` Richard Stallman

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.