all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Help setting nadvice for indent-region
Date: Tue, 09 Feb 2016 00:13:27 +0100	[thread overview]
Message-ID: <87oabqkd7s.fsf@debian.uxu> (raw)
In-Reply-To: CAOj2CQTunApn3jmwL1y-qujTt-BAvRyiGSOk_n8cSayH9FEOPg@mail.gmail.com

John Mastro <john.b.mastro@gmail.com> writes:

> Your solution requires you to define a new `dwim'
> function every time you want overload a function
> like this

Yes, which is very fast and accurate.

> whereas with advice you can simply add it to the
> list of functions to be adviced (assuming it will be
> adviced in the same way).

If you write a defun, you know for sure what it does
and that it will be used as intended.

If you start muck around with existing code you have
two places to look when you want to know what happens,
instead of one place. Only at one of those places is
there even an indication there is another place to
look (i.e., where the advice is, but not where the
original code is).

Also, with a defun, it is used explicitly, but with
the advice or self-modifying code, what make sense for
you can be completely incomprehensible/invisible to
another person or program that uses the same piece of
code, and this makes debugging much more difficult -
also for the reason above (two places), by the way.

Remember the whole monolithic kernel vs.
microkernel thing.

>> It it also more natural and "human-ish" to read
>> without all the computer lingo (`funcall' etc.).
>
> Avoid funcall because it has a fun-y (haha) name?
> This part I can't get behind at all.

Just because people program computer doesn't mean
anyone is benefited from the people themselves turning
into, or acting like, computers. If the code is all
computer lingo this is a bad sign.

Compare the old-school C code which was constantly
pointers, references, bitmasks, all computer stuff,
enough to make your head spin - what does all this
stuff *do*? /* You are not expected to understand this */
To get the size of a vector ("array" in the C lingo),
simple! do

    int n = sizeof(a)/sizeof(a[0]);

compare this to the Lisp `length'.

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2016-02-08 23:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 23:49 Help setting nadvice for indent-region Kaushal Modi
2016-02-05 23:58 ` Kaushal Modi
2016-02-06  0:00   ` Kaushal Modi
2016-02-06  0:30   ` Emanuel Berg
2016-02-06  3:31     ` Kaushal Modi
2016-02-06 10:43 ` Michael Heerdegen
2016-02-07  3:12   ` Kaushal Modi
2016-02-07 17:46     ` Kaushal Modi
2016-02-07 18:51       ` John Mastro
2016-02-08  0:03         ` Emanuel Berg
2016-02-08  4:22           ` Kaushal Modi
2016-02-08 17:05             ` Eli Zaretskii
2016-02-08 17:27               ` Kaushal Modi
2016-02-09  3:07             ` Emanuel Berg
2016-02-08 20:03           ` John Mastro
2016-02-08 23:13             ` Emanuel Berg [this message]
2016-02-11 14:02         ` Stefan Monnier
2016-02-11 17:36           ` Kaushal Modi
2016-02-11 18:10             ` Michael Heerdegen
2016-02-11 18:47               ` Kaushal Modi
2016-02-11 18:56                 ` Kaushal Modi
2016-02-11 19:14                   ` Michael Heerdegen
2016-02-11 20:15                     ` Kaushal Modi
2016-02-11 20:38                       ` Kaushal Modi
2016-02-12 14:09                         ` Michael Heerdegen
2016-02-12 14:21                           ` Michael Heerdegen
2016-02-12 16:02                             ` Kaushal Modi
2016-02-12 19:04                               ` Michael Heerdegen
2016-02-12 13:57                       ` Michael Heerdegen
2016-02-11 19:03                 ` Michael Heerdegen
2016-02-07 23:48       ` Emanuel Berg

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=87oabqkd7s.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --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.