guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] emacs: Move guix-guile-program to 'guix-config'.


From: Alex Kost
Subject: Re: [PATCH 3/4] emacs: Move guix-guile-program to 'guix-config'.
Date: Wed, 29 Jul 2015 11:36:27 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Mathieu Lirzin (2015-07-28 00:48 +0300) wrote:

[...]
> diff --git a/emacs/guix-config.el.in b/emacs/guix-config.el.in
> index 542de15..ed2e846 100644
> --- a/emacs/guix-config.el.in
> +++ b/emacs/guix-config.el.in
> @@ -19,6 +19,15 @@
>  
>  ;;; Code:
>  
> +(defconst guix-guile-program "@GUILE@"
> +  "Name of the guile executable used for Guix REPL.
> +May be either a string (the name of the executable) or a list of
> +strings of the form:
> +
> +  (NAME . ARGS)
> +
> +Where ARGS is a list of arguments to the guile program.")

The potential problem with 'defconst', is that it overrides the current
value if it already exists.  For example, evaluate the following:

(setq a 1)
(defconst a 2)
(setq b 1)
(defvar b 2)

As you can see the value of 'a' is 2, while the value of 'b' is 1.  So
if a user sets 'guix-guile-program' before (require 'guix-init), the
final value will be what is defined by 'defconst', not what is set by a
user.  That's why I think it is better to use 'defvar' for
'guix-guile-program'.

-- 
Alex, who hates 'defconst's and 'defsubst's.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]