unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* include bug in guile
@ 2016-03-29 17:16 rain1
  2016-03-30  1:05 ` Wette, Matthew R (3441)
  0 siblings, 1 reply; 4+ messages in thread
From: rain1 @ 2016-03-29 17:16 UTC (permalink / raw)
  To: guile-devel

I think this is a bug in guile relating to "include":

a.scm: (define a 1)
b.scm: (include "a.scm") (display a) (newline)

guile -l b.scm # prints 1

now update
a.scm: (define a 2)

guile -l b.scm # still prints 1




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

* Re: include bug in guile
  2016-03-29 17:16 include bug in guile rain1
@ 2016-03-30  1:05 ` Wette, Matthew R (3441)
  2016-03-31 12:39   ` Wette, Matthew R (3441)
  0 siblings, 1 reply; 4+ messages in thread
From: Wette, Matthew R (3441) @ 2016-03-30  1:05 UTC (permalink / raw)
  To: rain1@openmailbox.org; +Cc: guile-devel@gnu.org

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


On Mar 29, 2016, at 10:16 AM, rain1@openmailbox.org<mailto:rain1@openmailbox.org> wrote:

I think this is a bug in guile relating to "include":

a.scm: (define a 1)
b.scm: (include "a.scm") (display a) (newline)

guile -l b.scm # prints 1

now update
a.scm: (define a 2)

guile -l b.scm # still prints 1

I have noticed this behavior and have learned to live with it.  Given the following from the Guile Reference manual (2.0.11), I think it is not considered a bug.

"On the other hand, include does have all the disadvantages of early binding: once the code with the include is compiled, no change to the included file is reflected in the future behavior of the including form."


[-- Attachment #2: Type: text/html, Size: 1886 bytes --]

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

* Re: include bug in guile
  2016-03-30  1:05 ` Wette, Matthew R (3441)
@ 2016-03-31 12:39   ` Wette, Matthew R (3441)
  2016-03-31 12:55     ` rain1
  0 siblings, 1 reply; 4+ messages in thread
From: Wette, Matthew R (3441) @ 2016-03-31 12:39 UTC (permalink / raw)
  To: rain1@openmailbox.org; +Cc: guile-devel@gnu.org

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


On Mar 29, 2016, at 6:05 PM, Wette, Matthew R (3441) <matthew.r.wette@jpl.nasa.gov<mailto:matthew.r.wette@jpl.nasa.gov>> wrote:


On Mar 29, 2016, at 10:16 AM, rain1@openmailbox.org<mailto:rain1@openmailbox.org> wrote:

I think this is a bug in guile relating to "include":

a.scm: (define a 1)
b.scm: (include "a.scm") (display a) (newline)

guile -l b.scm # prints 1

now update
a.scm: (define a 2)

guile -l b.scm # still prints 1

I have noticed this behavior and have learned to live with it.  Given the following from the Guile Reference manual (2.0.11), I think it is not considered a bug.

"On the other hand, include does have all the disadvantages of early binding: once the code with the include is compiled, no change to the included file is reflected in the future behavior of the including form.”

And I will add that an implementation that checked all includes would have to carry a tree of source dependencies for each binary .go file.  The alternative seems unattractive to me so I am happy to live with the current implementation. — Matt

[-- Attachment #2: Type: text/html, Size: 2545 bytes --]

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

* Re: include bug in guile
  2016-03-31 12:39   ` Wette, Matthew R (3441)
@ 2016-03-31 12:55     ` rain1
  0 siblings, 0 replies; 4+ messages in thread
From: rain1 @ 2016-03-31 12:55 UTC (permalink / raw)
  To: Wette, Matthew R (3441); +Cc: guile-devel

On 2016-03-31 13:39, Wette, Matthew R (3441) wrote:
>> On Mar 29, 2016, at 6:05 PM, Wette, Matthew R (3441)
>> <matthew.r.wette@jpl.nasa.gov> wrote:
>> 
>>> On Mar 29, 2016, at 10:16 AM, rain1@openmailbox.org wrote:
>>> 
>>> I think this is a bug in guile relating to "include":
>>> 
>>> a.scm: (define a 1)
>>> b.scm: (include "a.scm") (display a) (newline)
>>> 
>>> guile -l b.scm # prints 1
>>> 
>>> now update
>>> a.scm: (define a 2)
>>> 
>>> guile -l b.scm # still prints 1
>> 
>> I have noticed this behavior and have learned to live with it. Given
>> the following from the Guile Reference manual (2.0.11), I think it
>> is not considered a bug.
>> 
>> "On the other hand, include does have all the disadvantages of early
>> binding: once the code with the include is compiled, no change to
>> the included file is reflected in the future behavior of the
>> including form.”
>  And I will add that an implementation that checked all includes would
> have to carry a tree of source dependencies for each binary .go file.
> The alternative seems unattractive to me so I am happy to live with
> the current implementation. — Matt

I think you are right and this can't be considered a bug, even though it 
may introduce bugs in programming if used wrong.

wingo mentioned to me that LOAD can be used as an alternative to INCLUDE 
if we want late binding instead of early.

Thanks!



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

end of thread, other threads:[~2016-03-31 12:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 17:16 include bug in guile rain1
2016-03-30  1:05 ` Wette, Matthew R (3441)
2016-03-31 12:39   ` Wette, Matthew R (3441)
2016-03-31 12:55     ` rain1

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).