* Deprecation question - is proposed code-change back-portable to V1.8.7?
@ 2012-08-16 11:30 Ian Hulin
2012-08-16 13:51 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Ian Hulin @ 2012-08-16 11:30 UTC (permalink / raw)
To: guile-user
Hi all,
In working with Guile V2.0.6, compiling the following code gives
deprecation errors for both scm_sym2var and scm_module_lookup_closure.
From looking at the docs following the recommendations in the
deprecation messages, it looks like the offending line needs to change to
return scm_module_variable ( module, sym);
Does scm_module_variable internally do what scm_module_lookup_closure
did, and if so, does Guile 1.8.7 do exactly the same as Guile 2.06?
Asking hear as we're getting near to a release and I don't want to
break anything bigtime on the LilyPond repo.
Cheers,
Ian Hulin
/* Lookup SYM, but don't give error when it is not defined. */
SCM
ly_module_lookup (SCM module, SCM sym)
{
#define FUNC_NAME __FUNCTION__
SCM_VALIDATE_MODULE (1, module);
return scm_sym2var (sym, scm_module_lookup_closure (module),
SCM_BOOL_F);
#undef FUNC_NAME
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Deprecation question - is proposed code-change back-portable to V1.8.7?
2012-08-16 11:30 Deprecation question - is proposed code-change back-portable to V1.8.7? Ian Hulin
@ 2012-08-16 13:51 ` Ludovic Courtès
2012-08-16 23:04 ` Ian Hulin
2012-08-19 9:50 ` Andy Wingo
0 siblings, 2 replies; 4+ messages in thread
From: Ludovic Courtès @ 2012-08-16 13:51 UTC (permalink / raw)
To: guile-user
Hi,
Ian Hulin <ian@hulin.org.uk> skribis:
> From looking at the docs following the recommendations in the
> deprecation messages, it looks like the offending line needs to change to
> return scm_module_variable ( module, sym);
>
> Does scm_module_variable internally do what scm_module_lookup_closure
> did,
Yes.
> and if so, does Guile 1.8.7 do exactly the same as Guile 2.06?
Yes, but unfortunately, ‘scm_module_variable’ didn’t exist in Guile
1.8. So you’ll have to #ifdef to use one or the other.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Deprecation question - is proposed code-change back-portable to V1.8.7?
2012-08-16 13:51 ` Ludovic Courtès
@ 2012-08-16 23:04 ` Ian Hulin
2012-08-19 9:50 ` Andy Wingo
1 sibling, 0 replies; 4+ messages in thread
From: Ian Hulin @ 2012-08-16 23:04 UTC (permalink / raw)
To: guile-user
Hi Ludo,
Many thanks for the quick response,
Cheers,
Ian
On 16/08/12 14:51, Ludovic � wrote:
> Hi,
>
> Ian Hulin <ian@hulin.org.uk> skribis:
>
>> From looking at the docs following the recommendations in the
>> deprecation messages, it looks like the offending line needs to
>> change to return scm_module_variable ( module, sym);
>>
>> Does scm_module_variable internally do what
>> scm_module_lookup_closure did,
>
> Yes.
>
>> and if so, does Guile 1.8.7 do exactly the same as Guile 2.06?
>
> Yes, but unfortunately, ‘scm_module_variable’ didn’t exist in
> Guile 1.8. So you’ll have to #ifdef to use one or the other.
>
> Thanks, Ludo’.
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Deprecation question - is proposed code-change back-portable to V1.8.7?
2012-08-16 13:51 ` Ludovic Courtès
2012-08-16 23:04 ` Ian Hulin
@ 2012-08-19 9:50 ` Andy Wingo
1 sibling, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2012-08-19 9:50 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-user
On Thu 16 Aug 2012 15:51, ludo@gnu.org (Ludovic Courtès) writes:
>> and if so, does Guile 1.8.7 do exactly the same as Guile 2.06?
>
> Yes, but unfortunately, ‘scm_module_variable’ didn’t exist in Guile
> 1.8. So you’ll have to #ifdef to use one or the other.
Better to just define scm_module_variable in guile 1.8:
#if defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION < 2)
SCM
scm_module_variable (SCM module, SCM sym)
{
return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
}
#endif
Cheers,
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-19 9:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 11:30 Deprecation question - is proposed code-change back-portable to V1.8.7? Ian Hulin
2012-08-16 13:51 ` Ludovic Courtès
2012-08-16 23:04 ` Ian Hulin
2012-08-19 9:50 ` Andy Wingo
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).