unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Unbound variable warning/exception
@ 2020-12-19  1:25 Christopher Lam
  2020-12-19  1:46 ` Aleix Conchillo Flaqué
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Lam @ 2020-12-19  1:25 UTC (permalink / raw)
  To: guile-user

Hi guilers, I saw in guix the incredibly useful unbound-variable exception
printer written by Ludovic. I've adapted for use in gnucash as
https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it be
a useful hint to add to the warning in core guile as well?


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

* Re: Unbound variable warning/exception
  2020-12-19  1:25 Unbound variable warning/exception Christopher Lam
@ 2020-12-19  1:46 ` Aleix Conchillo Flaqué
  2020-12-19 10:08   ` Massimiliano Gubinelli
  2020-12-20 21:36   ` Ludovic Courtès
  0 siblings, 2 replies; 8+ messages in thread
From: Aleix Conchillo Flaqué @ 2020-12-19  1:46 UTC (permalink / raw)
  To: Christopher Lam; +Cc: guile-user

On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
<christopher.lck@gmail.com> wrote:
>
> Hi guilers, I saw in guix the incredibly useful unbound-variable exception
> printer written by Ludovic. I've adapted for use in gnucash as
> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it be
> a useful hint to add to the warning in core guile as well?

Wow, this is great!

This should definitely be added to guile by default.

Aleix



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

* Re: Unbound variable warning/exception
  2020-12-19  1:46 ` Aleix Conchillo Flaqué
@ 2020-12-19 10:08   ` Massimiliano Gubinelli
  2020-12-19 13:07     ` Christopher Lam
  2020-12-20 21:36   ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Massimiliano Gubinelli @ 2020-12-19 10:08 UTC (permalink / raw)
  To: guile-user

Hi all,

nice piece of code!

About these "possible unbounded variable" warnings, I have for GNU TeXmacs the opposite need: how can I turn them off? :)

I was also curious to ask: which are currently the major applications of GNU Guile (as extension language)? For example, in TeXmacs we have ~110.000 lines of scheme (still Guile 1.8).  I wanted to give a look around to understand what are good design patterns to use Guile 2+ as extension language.

Best,
Massimiliano

> On 19. Dec 2020, at 02:46, Aleix Conchillo Flaqué <aconchillo@gmail.com> wrote:
> 
> On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
> <christopher.lck@gmail.com> wrote:
>> 
>> Hi guilers, I saw in guix the incredibly useful unbound-variable exception
>> printer written by Ludovic. I've adapted for use in gnucash as
>> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
>> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it be
>> a useful hint to add to the warning in core guile as well?
> 
> Wow, this is great!
> 
> This should definitely be added to guile by default.
> 
> Aleix
> 




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

* Re: Unbound variable warning/exception
  2020-12-19 10:08   ` Massimiliano Gubinelli
@ 2020-12-19 13:07     ` Christopher Lam
  2020-12-19 16:30       ` Massimiliano Gubinelli
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Lam @ 2020-12-19 13:07 UTC (permalink / raw)
  To: Massimiliano Gubinelli; +Cc: guile-user

You can remove these "possibly unbound variable" warning by using modules
appropriately. It's not easy and tedious but necessary to achieve better
module hygiene.

See changes in https://github.com/Gnucash/gnucash/pull/831

On Sat, 19 Dec 2020, 6:08 pm Massimiliano Gubinelli, <m.gubinelli@gmail.com>
wrote:

> Hi all,
>
> nice piece of code!
>
> About these "possible unbounded variable" warnings, I have for GNU TeXmacs
> the opposite need: how can I turn them off? :)
>
> I was also curious to ask: which are currently the major applications of
> GNU Guile (as extension language)? For example, in TeXmacs we have ~110.000
> lines of scheme (still Guile 1.8).  I wanted to give a look around to
> understand what are good design patterns to use Guile 2+ as extension
> language.
>
> Best,
> Massimiliano
>
> > On 19. Dec 2020, at 02:46, Aleix Conchillo Flaqué <aconchillo@gmail.com>
> wrote:
> >
> > On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
> > <christopher.lck@gmail.com> wrote:
> >>
> >> Hi guilers, I saw in guix the incredibly useful unbound-variable
> exception
> >> printer written by Ludovic. I've adapted for use in gnucash as
> >> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
> >> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it
> be
> >> a useful hint to add to the warning in core guile as well?
> >
> > Wow, this is great!
> >
> > This should definitely be added to guile by default.
> >
> > Aleix
> >
>
>


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

* Re: Unbound variable warning/exception
  2020-12-19 13:07     ` Christopher Lam
@ 2020-12-19 16:30       ` Massimiliano Gubinelli
  0 siblings, 0 replies; 8+ messages in thread
From: Massimiliano Gubinelli @ 2020-12-19 16:30 UTC (permalink / raw)
  To: Christopher Lam; +Cc: guile-user

Thanks, there is indeed some interesting and useful code there. 

However I would prefer not to make large changes in this moment.  I removed most of the warnings by proper use of modules but we still have some circular dependencies among modules and these are sources of some warning which for the moment I just want to silence. I think as long as they are warnings there should be the option to suppress them. There is no error in the code, but the current way circular module dependence in guile is handled does not recognize it... 

Best,
Max



> On 19. Dec 2020, at 14:07, Christopher Lam <christopher.lck@gmail.com> wrote:
> 
> You can remove these "possibly unbound variable" warning by using modules appropriately. It's not easy and tedious but necessary to achieve better module hygiene.
> 
> See changes in https://github.com/Gnucash/gnucash/pull/831 <https://github.com/Gnucash/gnucash/pull/831>
> On Sat, 19 Dec 2020, 6:08 pm Massimiliano Gubinelli, <m.gubinelli@gmail.com <mailto:m.gubinelli@gmail.com>> wrote:
> Hi all,
> 
> nice piece of code!
> 
> About these "possible unbounded variable" warnings, I have for GNU TeXmacs the opposite need: how can I turn them off? :)
> 
> I was also curious to ask: which are currently the major applications of GNU Guile (as extension language)? For example, in TeXmacs we have ~110.000 lines of scheme (still Guile 1.8).  I wanted to give a look around to understand what are good design patterns to use Guile 2+ as extension language.
> 
> Best,
> Massimiliano
> 
> > On 19. Dec 2020, at 02:46, Aleix Conchillo Flaqué <aconchillo@gmail.com <mailto:aconchillo@gmail.com>> wrote:
> > 
> > On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
> > <christopher.lck@gmail.com <mailto:christopher.lck@gmail.com>> wrote:
> >> 
> >> Hi guilers, I saw in guix the incredibly useful unbound-variable exception
> >> printer written by Ludovic. I've adapted for use in gnucash as
> >> https://github.com/Gnucash/gnucash/commit/6f951784 <https://github.com/Gnucash/gnucash/commit/6f951784> -- there are now in
> >> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it be
> >> a useful hint to add to the warning in core guile as well?
> > 
> > Wow, this is great!
> > 
> > This should definitely be added to guile by default.
> > 
> > Aleix
> > 
> 



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

* Re: Unbound variable warning/exception
  2020-12-19  1:46 ` Aleix Conchillo Flaqué
  2020-12-19 10:08   ` Massimiliano Gubinelli
@ 2020-12-20 21:36   ` Ludovic Courtès
  2020-12-20 23:11     ` Christopher Lam
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2020-12-20 21:36 UTC (permalink / raw)
  To: guile-user

Hi,

Aleix Conchillo Flaqué <aconchillo@gmail.com> skribis:

> On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
> <christopher.lck@gmail.com> wrote:
>>
>> Hi guilers, I saw in guix the incredibly useful unbound-variable exception
>> printer written by Ludovic. I've adapted for use in gnucash as
>> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
>> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it be
>> a useful hint to add to the warning in core guile as well?
>
> Wow, this is great!
>
> This should definitely be added to guile by default.

In Guix, the hint is displayed by an 'unbound-variable exception
handler, not by the 'unbound-variable printer; I think doing it in the
printer could be confusing.

Perhaps what could be done is export an 'unbound-variable handler that
does all this, and have the REPL use it?

Thanks,
Ludo’.




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

* Re: Unbound variable warning/exception
  2020-12-20 21:36   ` Ludovic Courtès
@ 2020-12-20 23:11     ` Christopher Lam
  2020-12-21 10:48       ` Jérémy Korwin-Zmijowski
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Lam @ 2020-12-20 23:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

The exception printer would be a good one to upgrade.

The dilemma is whether to search available modules in the current
repository, or in the whole of core guile. Do we want to show e.g. "Unbound
variable: vector-for-each. Did you forget (use-modules (srfi srfi-43))" ?

On Sun, 20 Dec 2020 at 21:36, Ludovic Courtès <ludo@gnu.org> wrote:

> Hi,
>
> Aleix Conchillo Flaqué <aconchillo@gmail.com> skribis:
>
> > On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
> > <christopher.lck@gmail.com> wrote:
> >>
> >> Hi guilers, I saw in guix the incredibly useful unbound-variable
> exception
> >> printer written by Ludovic. I've adapted for use in gnucash as
> >> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
> >> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it
> be
> >> a useful hint to add to the warning in core guile as well?
> >
> > Wow, this is great!
> >
> > This should definitely be added to guile by default.
>
> In Guix, the hint is displayed by an 'unbound-variable exception
> handler, not by the 'unbound-variable printer; I think doing it in the
> printer could be confusing.
>
> Perhaps what could be done is export an 'unbound-variable handler that
> does all this, and have the REPL use it?
>
> Thanks,
> Ludo’.
>
>
>


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

* Re: Unbound variable warning/exception
  2020-12-20 23:11     ` Christopher Lam
@ 2020-12-21 10:48       ` Jérémy Korwin-Zmijowski
  0 siblings, 0 replies; 8+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-12-21 10:48 UTC (permalink / raw)
  To: guile-user, Christopher Lam, Ludovic Courtès; +Cc: guile-user

Hello !

Looking in the all of core Guile could save time!
I can see already an emacs geiser trick to add it automatically haha.
Auto-completion + auto-use-module = Awesome!

Cheers,

Jérémy

Le 21 décembre 2020 00:11:38 GMT+01:00, Christopher Lam <christopher.lck@gmail.com> a écrit :
>The exception printer would be a good one to upgrade.
>
>The dilemma is whether to search available modules in the current
>repository, or in the whole of core guile. Do we want to show e.g. "Unbound
>variable: vector-for-each. Did you forget (use-modules (srfi srfi-43))" ?
>
>On Sun, 20 Dec 2020 at 21:36, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> Hi,
>>
>> Aleix Conchillo Flaqué <aconchillo@gmail.com> skribis:
>>
>> > On Fri, Dec 18, 2020 at 5:26 PM Christopher Lam
>> > <christopher.lck@gmail.com> wrote:
>> >>
>> >> Hi guilers, I saw in guix the incredibly useful unbound-variable
>> exception
>> >> printer written by Ludovic. I've adapted for use in gnucash as
>> >> https://github.com/Gnucash/gnucash/commit/6f951784 -- there are now in
>> >> guile 3.0.4 many more unbound-var warnings than in 3.0.2 -- wouldn't it
>> be
>> >> a useful hint to add to the warning in core guile as well?
>> >
>> > Wow, this is great!
>> >
>> > This should definitely be added to guile by default.
>>
>> In Guix, the hint is displayed by an 'unbound-variable exception
>> handler, not by the 'unbound-variable printer; I think doing it in the
>> printer could be confusing.
>>
>> Perhaps what could be done is export an 'unbound-variable handler that
>> does all this, and have the REPL use it?
>>
>> Thanks,
>> Ludo’.
>>
>>
>>

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


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

end of thread, other threads:[~2020-12-21 10:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-19  1:25 Unbound variable warning/exception Christopher Lam
2020-12-19  1:46 ` Aleix Conchillo Flaqué
2020-12-19 10:08   ` Massimiliano Gubinelli
2020-12-19 13:07     ` Christopher Lam
2020-12-19 16:30       ` Massimiliano Gubinelli
2020-12-20 21:36   ` Ludovic Courtès
2020-12-20 23:11     ` Christopher Lam
2020-12-21 10:48       ` Jérémy Korwin-Zmijowski

unofficial mirror of guile-user@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-user/0 guile-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-user guile-user/ https://yhetil.org/guile-user \
		guile-user@gnu.org
	public-inbox-index guile-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.user
	nntp://news.gmane.io/gmane.lisp.guile.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git