[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: export from an imported module
From: |
Damien Mattei |
Subject: |
Re: export from an imported module |
Date: |
Mon, 30 Oct 2023 15:40:17 +0100 |
thank you
it works now for the first time, i do not really know what was wrong, i just do:
rm -rf .cache/guile
and tried a re-export and it is ok.
I know the local cache but between multiple architecture with same
code shared via dropbox can cause problems
now it is ok like in Racket code, i again have a module version of
Scheme+ (no more need to includes files all is in a module now):
(define-module (Scheme+)
#:use-module (for_next_step)
#:use-module (growable-vector)
;;#:use-module (ice-9 local-eval)
#:use-module (infix-operators)
#:use-module (overload)
#:use-module (array)
#:use-module (ice-9 match)
#:use-module (ice-9 arrays) ;; for array-copy
#:use-module (srfi srfi-1) ;; any,every
#:use-module (srfi srfi-69) ;; Basic hash tables
#:use-module (srfi srfi-31) ;; rec
#:use-module (srfi srfi-26) ;; cut
#:re-export (for
for-basic
for-next
for-basic/break
for-basic/break-cont
for/break-cont
define-overload-procedure
overload-procedure
define-overload-existing-procedure
overload-existing-procedure
define-overload-operator
overload-operator
define-overload-existing-operator
overload-existing-operator
define-overload-n-arity-operator
overload-n-arity-operator
define-overload-existing-n-arity-operator
overload-existing-n-arity-operator
overload-function ;; see how to do the same for operator,
see the possible problem with infix precedence?
;;$ovrld-square-brackets-lst$
overload-square-brackets
;;find-getter-and-setter-for-overloaded-square-brackets
find-getter-for-overloaded-square-brackets
find-setter-for-overloaded-square-brackets
infix-operators-lst
set-infix-operators-lst!
replace-operator!
)
#:replace (do when unless)
#:export ($nfx$
!*prec
def $bracket-apply$ <- ← -> → <+ ⥆ +> ⥅ declare $> $+> condx ≠
** <v v> ⇜ ⇝ repeat % << >> & $ | ) ;; <> is already defined in Guile
) ;; end module definitions
simply used like that:
(use-modules (Scheme+)
(matrix+)
; (infix-operators)
; (overload)
(srfi srfi-42) ; Eager Comprehensions
(oop goops)
(srfi srfi-43)) ; vectors
no more need to add the sub-modules of Scheme+ : infix-operators ,
overload, for_next_step in the main program ,just (use-modules
(Scheme+)) is enought.
Damien
....
On Mon, Oct 30, 2023 at 10:29 AM Mikael Djurfeldt <mikael@djurfeldt.com> wrote:
>
> Well, not sure what you mean, and if there is a problem it must be something
> in your code. I attach a simple example where the module (b) re-exports a
> definition from the used module (a).
>
> You need to have the directory re-export on your %load-path in order to be
> able to ,use (b) after which you should be able to type x and get 1.
>
> Best regards,
> Mikael
>
> On Mon, Oct 30, 2023 at 8:37 AM Damien Mattei <damien.mattei@gmail.com> wrote:
>>
>> i tried:
>>
>> ;;; WARNING: compilation of /usr/local/share/guile/site/3.0/Scheme+.scm
>> failed:
>> ;;; re-exporting local variable: infix-operators-lst
>> While compiling expression:
>> re-exporting local variable: infix-operators-lst
>>
>> anyway it works with loading each module separately at different
>> levels, code is perheaps more clean to read like that instead of
>> calculating what modules should re-export above which complex things
>> and sometimes cause re-exporting the same variable from multiple
>> modules...
>>
>> On Sun, Oct 29, 2023 at 11:06 PM Mikael Djurfeldt <mikael@djurfeldt.com>
>> wrote:
>> >
>> > #:re-export
>> >
>> > Den sön 29 okt. 2023 23:05Mikael Djurfeldt <mikael@djurfeldt.com> skrev:
>> >>
>> >> Look at #re-export here:
>> >>
>> >> https://www.gnu.org/software/guile/manual/html_node/Creating-Guile-Modules.html
>> >>
>> >> Den sön 29 okt. 2023 21:55Damien Mattei <damien.mattei@gmail.com> skrev:
>> >>>
>> >>> i noticed that in Guile if i use a module in a module i can not export
>> >>> the definitions of the used module. It is possible in Racket but in
>> >>> guile it even cause problems.
>> >>>