all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Stefan Huchler <stefan.huchler@mail.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Strange eval behaviour
Date: Sat, 19 Nov 2016 00:35:17 +0100	[thread overview]
Message-ID: <87h974l5u2.fsf@web.de> (raw)
In-Reply-To: <87fumo67vi.fsf@mail.de> (Stefan Huchler's message of "Fri, 18 Nov 2016 18:00:17 +0100")

Stefan Huchler <stefan.huchler@mail.de> writes:

> Or did you refer here to something different you saw? bytecompiling
> only throw warnings about this params variables. And thats only
> warnings...

But the warnings are there for a reason, and the reason is that the code
can potentially error when being run.  In general, the warnings mean
that you do something you definitely should not do.  Let's fix these
warnings, and then I can have a look at the code again if you want.

Also try to follow the essence of functional programming: reduce side
effects of functions to a minimum.  When a function has side effects,
make it clear (e.g. in the doc or the name of the function).  If you
really need to set any global variable, declare that variable with
`defvar' and prefix its name with the prefix of your library.  In
general, the way functions transfer information in Lisp is by the return
value, not by setting variables.  For avoiding some bad habits it's very
helpful to use lexical-binding - you can enable it with a specification
in the file's first line.

Maybe consider reading a good book about lisp (since learning by doing
is not a good approach in Lisp).  Maybe "Land of Lisp" (haven't read it,
but it has a good title song) or "On Lisp" by Graham (a classical, but
harder to read; reading some of the first chapters might be a good idea
anyway).


Regards,

Michael.



  reply	other threads:[~2016-11-18 23:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-13 21:28 Strange eval behaviour Stefan Huchler
2016-11-14 15:04 ` Stefan Monnier
2016-11-15  1:55   ` Stefan Huchler
2016-11-18  2:38     ` Michael Heerdegen
2016-11-18 16:51       ` Stefan Huchler
2016-11-18 23:19         ` Michael Heerdegen
2016-11-22 23:57           ` Stefan Huchler
2016-11-23  9:19             ` Michael Heerdegen
2016-11-23 14:20               ` Stefan Huchler
2016-11-18 17:00       ` Stefan Huchler
2016-11-18 23:35         ` Michael Heerdegen [this message]
2016-11-22 14:43           ` Stefan Huchler
2016-11-27  4:25           ` Stefan Huchler
2016-11-27  4:29           ` Stefan Huchler

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=87h974l5u2.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stefan.huchler@mail.de \
    /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.