This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

corrupt environment?


Emanuel Borsboom writes:

 > I'm running into a strange problem that I can't figure out, shown by the
 > following example:
 > 
 > (define get-value '*)
 > (let (...)
 >   ...				<--- [stuff before `define']
 >   (define value 42)
 >   (set! get-value (lambda () value))
 >   ...
 >   (write (eq? value (get-value))) (newline)	;prints #t
 >   (define foo 'bar)				
 >   (write (eq? value (get-value))) (newline)	;prints #f
 >   ...
 > )
 > 
 > This is in the context of a much larger (~3000 lines) program that uses
 > guile-gtk.
 > 
 > Any idea what could cause this?

nested `define' forms are syntactic sugar.  i remember that guile had a
problem where it did not properly handle the (improper usage) case where
there were other expressions before the define form in any particular
lexical scope.  this may be related to what you are seeing.

as an experiment, move the [stuff before `define'] above after the
`(define value 42)' (and all other defines) and see what happens.
actually, better would be to move all defines to the beginning of the
`let'.

i believe someone wrote a macro that would allow you to place define
forms arbitrarily in a scope, not just at the beginning.

the rest of this post is only peripherally related:

hmm, does guile@cygnus.com have an archive refbot?  it would be cool to
have the following text:

	(archive-refbot 'search-keywords 
			'("define bug" "order"))

generate a posting by the bot saying "so and so discussed this before,
here is a URL".  there is at least one auto-faq program out there
(sorry, can't remeber, this is why i'd like a bot in the first place)
that the archive-refbot could coordinate w/ to generate faqs, etc.
other useful commands besides 'search-keywords might be 'summarize
(useful for generating guile news, a la other post), 'sw-hist (sort of a
specific-type of search for package releases), etc.

ideally, archive-refbot would: be configurable, be able to accept
expressions to evaluate (in a restricted environment), cache requests
and results, integrate w/ guile-projects, and so on.

ok now i'm getting excited...  is guile@cygnus.com a majordomo setup?
what does it use for its archiving program?  is there any objection to
using guile for mailing list activities by the administration?

thi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]