all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: user <user0012@cocaine.ninja>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How can I write this function better?
Date: Tue, 14 Mar 2017 13:44:33 +0100	[thread overview]
Message-ID: <877f3s9gem.fsf@jane> (raw)
In-Reply-To: <87zigprm7q.fsf@cocaine.ninja>


On 2017-03-13, at 20:49, user <user0012@cocaine.ninja> wrote:

> Hello help-gnu-emacs, I'm looking for pointers with my luser-0x0 function. I'm
> sure there are better ways I could write this. I'm not asking to have you
> rewrite it for me, that'd be rude of me, but rather what I should to look at,
> such as documentation or learning new constructs etc. I'm _very_ new to
> programming and Lisp (learning Lisp and Forth as my first languages; quite
> fun). An explanation, which I first wrote for myself, is below the code.
>
> Thanks.

Quick comments off the top of my head (maybe completely wrong...)

1. No need to create one-use variables (there are probably various
schools on that...).

2. I think there is no need for `apply', either.

3. Instead of the low-level-ish set-process-filter and start-process,
why not use something much simpler like `call-process-shell-command'?

Hth,

-- 
Marcin Borkowski



  reply	other threads:[~2017-03-14 12:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 19:49 How can I write this function better? user
2017-03-14 12:44 ` Marcin Borkowski [this message]
2017-03-14 17:48 ` John Mastro
2017-03-15  9:55   ` Patrick
2017-03-16  8:30     ` Thien-Thi Nguyen

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=877f3s9gem.fsf@jane \
    --to=mbork@mbork.pl \
    --cc=help-gnu-emacs@gnu.org \
    --cc=user0012@cocaine.ninja \
    /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.