unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#12459: Strange issue with circular dependancies
@ 2012-09-17 11:48 rixed
  2012-11-23 22:44 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: rixed @ 2012-09-17 11:48 UTC (permalink / raw)
  To: 12459

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]

While the compiler does manage most circular dependancies, some cases still
cannot be compiled.

For instance, with the attached circ-{a,b,c}.scm the compilation of b fails
with:

% GUILE_LOAD_PATH=. guile-tools compile -Warity-mismatch -Wformat -Wunused-variable -Wduplicate-case-datum -Wbad-case-datum -o circ-b.go circ-b.scm
Backtrace:
In ice-9/boot-9.scm:
2131: 19 [save-module-excursion #<procedure 2648a80 at ice-9/boot-9.scm:2787:17 ()>]
2797: 18 [#<procedure 2648a80 at ice-9/boot-9.scm:2787:17 ()>]
In unknown file:
   ?: 17 [primitive-load-path "circ-a" #f]
In ice-9/eval.scm:
 487: 16 [#<procedure 210ac60 at ice-9/eval.scm:481:4 (exp)> (use-modules # #)]
In ice-9/psyntax.scm:
1091: 15 [expand-top-sequence ((use-modules (circ-b) (circ-c))) () ...]
 976: 14 [scan ((use-modules (circ-b) (circ-c))) () ...]
 270: 13 [scan ((# #) #(syntax-object *unspecified* # #)) () (()) ...]
In ice-9/boot-9.scm:
3258: 12 [process-use-modules (((circ-b)) ((circ-c)))]
 621: 11 [map #<procedure 21d8fe0 at ice-9/boot-9.scm:3258:25 (mif-args)> ((#) (#))]
3259: 10 [#<procedure 21d8fe0 at ice-9/boot-9.scm:3258:25 (mif-args)> ((circ-c))]
2594: 9 [resolve-interface (circ-c) #:select ...]
2519: 8 [#<procedure 21cb760 at ice-9/boot-9.scm:2507:4 (name #:optional autoload version #:key ensure)> # ...]
2786: 7 [try-module-autoload (circ-c) #f]
2131: 6 [save-module-excursion #<procedure 26507b0 at ice-9/boot-9.scm:2787:17 ()>]
2797: 5 [#<procedure 26507b0 at ice-9/boot-9.scm:2787:17 ()>]
In unknown file:
   ?: 4 [primitive-load-path "circ-c" #f]
In ice-9/eval.scm:
 435: 3 [eval #<memoized (define y (@ (circ-b) fb))> ()]
 432: 2 [eval #<memoized (@ (circ-b) fb)> ()]
In unknown file:
   ?: 1 [memoize-variable-access! #<memoized (@ (circ-b) fb)> #f]
In ice-9/boot-9.scm:
 106: 0 [#<procedure 23e9100 at ice-9/boot-9.scm:97:6 (thrown-k . args)> unbound-variable ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure 23e9100 at ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: In procedure module-lookup: Unbound variable: fb

Note that it compiles if you remove (circ-c) from used-modules in circ-a.scm.


[-- Attachment #2: circ-a.scm --]
[-- Type: text/plain, Size: 134 bytes --]

(define-module (circ-a))
(use-modules (circ-b)
             (circ-c))

(define x 123)
(export x)
(define (fa) (1+ (fb)))
(export fa)


[-- Attachment #3: circ-b.scm --]
[-- Type: text/plain, Size: 72 bytes --]

(define-module (circ-b))

(define (fb) (1+ (@ (circ-a) x)))
(export fb)

[-- Attachment #4: circ-c.scm --]
[-- Type: text/plain, Size: 56 bytes --]

(define-module (circ-c))

(define y (@ (circ-b) fb))
;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12459: Strange issue with circular dependancies
  2012-09-17 11:48 bug#12459: Strange issue with circular dependancies rixed
@ 2012-11-23 22:44 ` Ludovic Courtès
  2012-11-26  8:54   ` rixed
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2012-11-23 22:44 UTC (permalink / raw)
  To: rixed; +Cc: 12459

Hi,

rixed@happyleptic.org skribis:

> While the compiler does manage most circular dependancies, some cases still
> cannot be compiled.

It’s really not supposed to work, neither at compile time nor at run time.

Sometimes it turns out to work “by chance” as in this case, or because
there are autoloads to defer the cycle.  But in general, it should
really be avoided.

Won’t fix?  :-)

Ludo’.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12459: Strange issue with circular dependancies
  2012-11-23 22:44 ` Ludovic Courtès
@ 2012-11-26  8:54   ` rixed
  2012-11-27 21:38     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: rixed @ 2012-11-26  8:54 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 12459

> Won???t fix?  :-)

Fine with me.
I couldn't name a single compiler that can handle circular dependancies.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#12459: Strange issue with circular dependancies
  2012-11-26  8:54   ` rixed
@ 2012-11-27 21:38     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2012-11-27 21:38 UTC (permalink / raw)
  To: 12459-done; +Cc: rixed

tags 12459 wontfix
thanks





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-27 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 11:48 bug#12459: Strange issue with circular dependancies rixed
2012-11-23 22:44 ` Ludovic Courtès
2012-11-26  8:54   ` rixed
2012-11-27 21:38     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).