Improve cond-expand/eval-when usage based on feedback from the guile developers

Basically two things:
- whenever eval-when is used, the expand keyword should be added (not yet documented)
- eval-when is not needed for use-modules, because use-modules is a macro that performs the eval-when by itself

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23460 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2013-11-29 19:18:08 +00:00
parent da57bb7f0b
commit 7581076364
11 changed files with 11 additions and 17 deletions

View File

@ -26,7 +26,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(compile load eval expand)
(gnc:module-load "gnucash/engine" 0)))
(else
(gnc:module-load "gnucash/engine" 0)))

View File

@ -11,7 +11,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(compile load eval expand)
(load-extension "libgnc-core-utils" "scm_init_sw_core_utils_module")))
(else
(load-extension "libgnc-core-utils" "scm_init_sw_core_utils_module")))

View File

@ -12,7 +12,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(compile load eval expand)
(load-extension "libgnc-module" "scm_init_sw_gnc_module_module")))
(else
(load-extension "libgnc-module" "scm_init_sw_gnc_module_module")))

View File

@ -13,7 +13,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(compile load eval expand)
(load-extension "libgnc-gnome" "scm_init_sw_gnome_module")))
(else
(load-extension "libgnc-gnome" "scm_init_sw_gnome_module")))

View File

@ -41,9 +41,7 @@
(use-modules (ice-9 regex)) ; for regular expressions
(cond-expand
(guile-2
(eval-when
(compile load eval)
(use-modules (ice-9 local-eval)))) ; for the-environment
(use-modules (ice-9 local-eval))) ; for the-environment
(else ))
(use-modules (srfi srfi-13)) ; for extra string functions

View File

@ -35,7 +35,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(compile load eval expand)
(define gnc:menuname-business-reports (N_ "_Business"))))
(else
(define gnc:menuname-business-reports (N_ "_Business"))))

View File

@ -26,9 +26,7 @@
(cond-expand
(guile-2
(eval-when
(compile load eval)
(use-modules (ice-9 local-eval)))) ; for the-environment
(use-modules (ice-9 local-eval))) ; for the-environment
(else ))
(use-modules (gnucash main))
(use-modules (gnucash gnc-module))

View File

@ -87,9 +87,7 @@
(use-modules (ice-9 rdelim)) ; for read-line
(cond-expand
(guile-2
(eval-when
(compile load eval)
(use-modules (ice-9 local-eval)))) ; for the-environment
(use-modules (ice-9 local-eval))) ; for the-environment
(else ))
(use-modules (gnucash printf))
(use-modules (gnucash app-utils)) ; for _

View File

@ -11,7 +11,7 @@
(cond-expand
(guile-2
(define-syntax-rule (begin-for-syntax form ...)
(eval-when (load compile eval) (begin form ...))))
(eval-when (load compile eval expand) (begin form ...))))
(else
(define begin-for-syntax begin)))

View File

@ -10,7 +10,7 @@
(cond-expand
(guile-2
(define-syntax-rule (begin-for-syntax form ...)
(eval-when (load compile eval) (begin form ...))))
(eval-when (load compile eval expand) (begin form ...))))
(else
(define begin-for-syntax begin)))

View File

@ -10,7 +10,7 @@
(cond-expand
(guile-2
(define-syntax-rule (begin-for-syntax form ...)
(eval-when (load compile eval) (begin form ...))))
(eval-when (load compile eval expand) (begin form ...))))
(else
(define begin-for-syntax begin)))