unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* GUILE_WARN_DEPRECATED
@ 2004-12-26 16:51 David Pirotte
  2004-12-26 17:08 ` GUILE_WARN_DEPRECATED Neil Jerram
  0 siblings, 1 reply; 12+ messages in thread
From: David Pirotte @ 2004-12-26 16:51 UTC (permalink / raw)


i'd like to set the GUILE_WARN_DEPRECATED variable within the program
itself, for exemple because if a debug variable is #t, I could set it
to detailed, and if not to "no"

but my guile 'program' (script) does seem to only listen to these
variables when they are 'manually' set before to call it, otherwise
they seem to be set, but probably not in the right environment?

here is my script, the beginning of it:

	#!/bin/sh
	# -*- scheme -*-
	# make process copied from photoblogger
	( cd `dirname $0` && make `basename $0` >/dev/null ) || exit
	exec guile-gnome-0 -e main -s $0 "$@"
	!#

	(use-modules (ice-9 format))

	(setenv "LANG" "fr_FR@euro")
	(setenv "GUILE_WARN_DEPRECATED" "no")
		
	(define *debug-mode* #f)
	(define *version* 0.1)

	(define (main args)
	  (primitive-eval '(use-modules (prospects)))
	  (prospects-init)

	  (cond
	   (*debug-mode*
	    ;; it would be nice to set (prospects) as the current module, but
	    ;; it would probably create heisenbugs.
	    (load-user-init)
	    (primitive-eval '(use-modules (gnome gtk graphical-repl)))
	    (guile-gtk-repl))
	   (else
	    (primitive-eval '(use-modules (gnome glib)))
	    (g-main-loop-run (g-main-loop-new)))))
		


but guile is always displaying the message

	Some deprecated features have been used.  Set the environment
	variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
	program to get more information.  Set it to "no" to suppress
	this message.

unless I set GUILE_WARN_DEPRECATED manually in the xterm form where I
launch the script

thanks
david


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-26 16:51 GUILE_WARN_DEPRECATED David Pirotte
@ 2004-12-26 17:08 ` Neil Jerram
  2004-12-26 22:13   ` GUILE_WARN_DEPRECATED David Pirotte
  0 siblings, 1 reply; 12+ messages in thread
From: Neil Jerram @ 2004-12-26 17:08 UTC (permalink / raw)
  Cc: guile-user

David Pirotte wrote:
> i'd like to set the GUILE_WARN_DEPRECATED variable within the program
> itself, [...] but guile is always displaying the message
> 
> 	Some deprecated features have been used.  Set the environment
> 	variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
> 	program to get more information.  Set it to "no" to suppress
> 	this message.
> 
> unless I set GUILE_WARN_DEPRECATED manually in the xterm form where I
> launch the script

What do you see with GUILE_WARN_DEPRECATED=detailed?  (In other words, 
which part of your program is producing the warnings?)

	Neil


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-26 17:08 ` GUILE_WARN_DEPRECATED Neil Jerram
@ 2004-12-26 22:13   ` David Pirotte
  2004-12-26 23:04     ` GUILE_WARN_DEPRECATED Neil Jerram
  0 siblings, 1 reply; 12+ messages in thread
From: David Pirotte @ 2004-12-26 22:13 UTC (permalink / raw)
  Cc: guile-user

On Sun, 26 Dec 2004 17:08:26 +0000
Neil Jerram <neil@ossau.uklinux.net> wrote:

> What do you see with GUILE_WARN_DEPRECATED=detailed?  (In other words, 
> which part of your program is producing the warnings?)

here it is:

	`scm_sysintern0' is deprecated. Use `scm_define' instead.
	`scm_protect_object' is deprecated. Use `scm_gc_protect_object' instead.

but i know that it comes from :use-module (database postgres), which is a
kind of obsolate version, deliberatly used until i have time to upgrade
to a more recent version of it.

the question i had is more related to why is the variable
GUILE_WARN_DEPRECATED only 'working' when manually set and not when
set within the guile program itself?

as i said, i'd like to recieve the deprecated info only when i set a *debug*
variable, but my users shouldn't see anything

thanks
david



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-26 22:13   ` GUILE_WARN_DEPRECATED David Pirotte
@ 2004-12-26 23:04     ` Neil Jerram
  2004-12-27  9:01       ` GUILE_WARN_DEPRECATED David Pirotte
  0 siblings, 1 reply; 12+ messages in thread
From: Neil Jerram @ 2004-12-26 23:04 UTC (permalink / raw)
  Cc: guile-user

David Pirotte wrote:
> 
> here it is:
> 
> 	`scm_sysintern0' is deprecated. Use `scm_define' instead.
> 	`scm_protect_object' is deprecated. Use `scm_gc_protect_object' instead.
> 
> but i know that it comes from :use-module (database postgres), which is a
> kind of obsolate version, deliberatly used until i have time to upgrade
> to a more recent version of it.

Fair enough - I wanted to be sure that the warnings weren't from before 
your (setenv ...) code.

> 
> the question i had is more related to why is the variable
> GUILE_WARN_DEPRECATED only 'working' when manually set and not when
> set within the guile program itself?
> 
> as i said, i'd like to recieve the deprecated info only when i set a *debug*
> variable, but my users shouldn't see anything

I'm afraid I don't know the proper answer here.  However, you could work 
around this by wrapping your program in a shell script (which sets 
GUILE_WARN_DEPRECATED and then execs the actual program).  Would that help?

	Neil


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-26 23:04     ` GUILE_WARN_DEPRECATED Neil Jerram
@ 2004-12-27  9:01       ` David Pirotte
  2004-12-27 11:48         ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen
  0 siblings, 1 reply; 12+ messages in thread
From: David Pirotte @ 2004-12-27  9:01 UTC (permalink / raw)


On Sun, 26 Dec 2004 23:04:28 +0000
Neil Jerram <neil@ossau.uklinux.net> wrote:

> I'm afraid I don't know the proper answer here.  However, you could work 
> around this by wrapping your program in a shell script (which sets 
> GUILE_WARN_DEPRECATED and then execs the actual program).  Would that help?

that's what I was doing, but not really clean, 2 executables for one,
and when to install on several box ... but if no other workaround,
i'll continue off course.

thanks
david


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27  9:01       ` GUILE_WARN_DEPRECATED David Pirotte
@ 2004-12-27 11:48         ` Thien-Thi Nguyen
  2004-12-27 14:56           ` GUILE_WARN_DEPRECATED David Pirotte
  0 siblings, 1 reply; 12+ messages in thread
From: Thien-Thi Nguyen @ 2004-12-27 11:48 UTC (permalink / raw)
  Cc: guile-user

   From: David Pirotte <david@altosw.be>
   Date: Mon, 27 Dec 2004 10:01:46 +0100

   but not really clean, 2 executables for one

perhaps you can use a shell-script header that sets
env vars prior to invoking the guile interpreter:

#!/bin/sh
foo=bar
export foo
exec ${GUILE-guile} -s $0
!#

does that work?

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 11:48         ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen
@ 2004-12-27 14:56           ` David Pirotte
  2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
  2004-12-27 18:05             ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen
  0 siblings, 2 replies; 12+ messages in thread
From: David Pirotte @ 2004-12-27 14:56 UTC (permalink / raw)
  Cc: guile-user, ttn

On Mon, 27 Dec 2004 12:48:28 +0100
Thien-Thi Nguyen <ttn@surf.glug.org> wrote:

> perhaps you can use a shell-script header that sets
> env vars prior to invoking the guile interpreter:
> 
> #!/bin/sh
> foo=bar
> export foo
> exec ${GUILE-guile} -s $0
> !#

hum, really too bad because the arg analysis has then to be written
in shell, where you propose the setting, exactly what I'm trying to avoid

but why is this so impossible to control behavior of a 'guile
variable' within guile itself? why guile isn't listening to my
setting? is this a module/environment limitation?



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 14:56           ` GUILE_WARN_DEPRECATED David Pirotte
@ 2004-12-27 15:19             ` Marius Vollmer
  2004-12-27 16:27               ` GUILE_WARN_DEPRECATED David Pirotte
                                 ` (2 more replies)
  2004-12-27 18:05             ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen
  1 sibling, 3 replies; 12+ messages in thread
From: Marius Vollmer @ 2004-12-27 15:19 UTC (permalink / raw)
  Cc: guile-user, ttn, ttn

David Pirotte <david@altosw.be> writes:

> but why is this so impossible to control behavior of a 'guile
> variable' within guile itself? why guile isn't listening to my
> setting? is this a module/environment limitation?

The reason is actually quite simple: guile only looks once at the
environment variable, during initialization.  After that, you can not
change the deprecation mode, which could be called a bug.

I think I will add a debug option (to be set with 'debug-enable', say)
that controls the deprecation mode.  Opinions?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
@ 2004-12-27 16:27               ` David Pirotte
  2004-12-28  1:52               ` GUILE_WARN_DEPRECATED Steve Tell
  2005-01-11 17:48               ` GUILE_WARN_DEPRECATED Marius Vollmer
  2 siblings, 0 replies; 12+ messages in thread
From: David Pirotte @ 2004-12-27 16:27 UTC (permalink / raw)
  Cc: guile-user, ttn, ttn

On 27 Dec 2004 16:19:33 +0100
Marius Vollmer <mvo@zagadka.de> wrote:

> The reason is actually quite simple: guile only looks once at the
> environment variable, during initialization.  After that, you can not
> change the deprecation mode, which could be called a bug.

the funny thing is that it prints the deprecated messages only
when we quit the application, which is why i was wondering ...

> I think I will add a debug option (to be set with 'debug-enable', say)
> that controls the deprecation mode.  Opinions?

sounds good to me, but really isn't a priority, i was more curious
then bothered and can write as suggested, veriable setting at the
beginning ... then guile code comes in action ..

thanks a lot
david


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 14:56           ` GUILE_WARN_DEPRECATED David Pirotte
  2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
@ 2004-12-27 18:05             ` Thien-Thi Nguyen
  1 sibling, 0 replies; 12+ messages in thread
From: Thien-Thi Nguyen @ 2004-12-27 18:05 UTC (permalink / raw)
  Cc: guile-user

   From: David Pirotte <david@altosw.be>
   Date: Mon, 27 Dec 2004 15:56:40 +0100

   hum, really too bad because the arg analysis has then to be written
   in shell, where you propose the setting, exactly what I'm trying to
   avoid

perhaps there is a way to disable the runtime env var dependency when
building a new interpreter.  if you are amenable to going that route, i
can suggest trying (unofficial ;-) Guile 1.4.x, which doesn't have this
particular problem (although undoubtedly it has others):

http://www.glug.org/people/ttn/software/guile/

if you are wed to a Guile w/ this dependency, that's another matter.

thi


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
  2004-12-27 16:27               ` GUILE_WARN_DEPRECATED David Pirotte
@ 2004-12-28  1:52               ` Steve Tell
  2005-01-11 17:48               ` GUILE_WARN_DEPRECATED Marius Vollmer
  2 siblings, 0 replies; 12+ messages in thread
From: Steve Tell @ 2004-12-28  1:52 UTC (permalink / raw)
  Cc: guile-user, ttn, ttn, David Pirotte

On Mon, 27 Dec 2004, Marius Vollmer wrote:

> David Pirotte <david@altosw.be> writes:
> 
> > but why is this so impossible to control behavior of a 'guile
> > variable' within guile itself? why guile isn't listening to my
> > setting? is this a module/environment limitation?
> 
> The reason is actually quite simple: guile only looks once at the
> environment variable, during initialization.  After that, you can not
> change the deprecation mode, which could be called a bug.

That fits - it does work to putenv() before calling scm_boot_guile or 
scm_init_guile().
I generally do:
        if (getenv("GUILE_WARN_DEPRECATED") == NULL)
                putenv("GUILE_WARN_DEPRECATED=no");

> I think I will add a debug option (to be set with 'debug-enable', say)
> that controls the deprecation mode.  Opinions?
 
Sounds like great idea to me.  
Developers of guile-using programs (should) care about 
deprecation-warnings, but their users often don't.

Steve


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: GUILE_WARN_DEPRECATED
  2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
  2004-12-27 16:27               ` GUILE_WARN_DEPRECATED David Pirotte
  2004-12-28  1:52               ` GUILE_WARN_DEPRECATED Steve Tell
@ 2005-01-11 17:48               ` Marius Vollmer
  2 siblings, 0 replies; 12+ messages in thread
From: Marius Vollmer @ 2005-01-11 17:48 UTC (permalink / raw)
  Cc: guile-user

Marius Vollmer <mvo@zagadka.de> writes:

> I think I will add a debug option (to be set with 'debug-enable', say)
> that controls the deprecation mode.  Opinions?

Done!


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

end of thread, other threads:[~2005-01-11 17:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-26 16:51 GUILE_WARN_DEPRECATED David Pirotte
2004-12-26 17:08 ` GUILE_WARN_DEPRECATED Neil Jerram
2004-12-26 22:13   ` GUILE_WARN_DEPRECATED David Pirotte
2004-12-26 23:04     ` GUILE_WARN_DEPRECATED Neil Jerram
2004-12-27  9:01       ` GUILE_WARN_DEPRECATED David Pirotte
2004-12-27 11:48         ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen
2004-12-27 14:56           ` GUILE_WARN_DEPRECATED David Pirotte
2004-12-27 15:19             ` GUILE_WARN_DEPRECATED Marius Vollmer
2004-12-27 16:27               ` GUILE_WARN_DEPRECATED David Pirotte
2004-12-28  1:52               ` GUILE_WARN_DEPRECATED Steve Tell
2005-01-11 17:48               ` GUILE_WARN_DEPRECATED Marius Vollmer
2004-12-27 18:05             ` GUILE_WARN_DEPRECATED Thien-Thi Nguyen

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