unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Porting guile-xlib
@ 2013-01-27 13:31 Mark Witmer
  2013-01-27 14:48 ` Mark Witmer
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Witmer @ 2013-01-27 13:31 UTC (permalink / raw)
  To: guile-user


Hi all,

I'm interested in using guile-xlib to mess around with writing a window
manager. However, it looks like my first task would be porting it to
Guile 2.0, since it's quite old (assuming some newer version isn't
floating around in the ether somewhere -- I'm looking at guile-xlib
0.4).

I haven't done anything like this before, so I'm seeking any wisdom
anyone out there might have on the subject. A couple specific questions
for now:

1. Is there a good reference source for the old deprecated methods? I
looked up a few (eg. "scm_wta" and "scm_i_makinum") in the old manuals
going back to 1.4 but didn't have any luck finding them. I can read the
source, but some documentation would help!

2. Since scm_smob_free is deprecated, does that mean I can just replace
a line like "return scm_smob_free(child_smob)" with "return 0;" and rest
easy knowing the gc will take care of the details?

Thanks

Mark Witmer



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

* Re: Porting guile-xlib
  2013-01-27 13:31 Porting guile-xlib Mark Witmer
@ 2013-01-27 14:48 ` Mark Witmer
  2013-01-27 15:36   ` Mike Gran
  2013-01-27 14:50 ` Ludovic Courtès
  2013-01-27 19:14 ` Gabriel Schnoering
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Witmer @ 2013-01-27 14:48 UTC (permalink / raw)
  To: Mark Witmer; +Cc: guile-user


I found something farily obvious that will help with a lot of these
kinds of questions; methods like "scm_i_makinum" were accessed via
macros, so the macro (SCM_MAKINUM) is what I had to search for in the
old manuals.

Am I safe to use "scm_from_int" in its place and other general SCM
numeric functions instead of the immediate number ones? These seem to
make up a large number of the deprecated functions in use by this
library.

Mark



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

* Re: Porting guile-xlib
  2013-01-27 13:31 Porting guile-xlib Mark Witmer
  2013-01-27 14:48 ` Mark Witmer
@ 2013-01-27 14:50 ` Ludovic Courtès
  2013-01-27 19:14 ` Gabriel Schnoering
  2 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2013-01-27 14:50 UTC (permalink / raw)
  To: guile-user

Hi,

Mark Witmer <mark@markwitmer.com> skribis:

> I'm interested in using guile-xlib to mess around with writing a window
> manager. However, it looks like my first task would be porting it to
> Guile 2.0, since it's quite old (assuming some newer version isn't
> floating around in the ether somewhere -- I'm looking at guile-xlib
> 0.4).

Nice!  Are you targeting the Feb. 16th anniversary?  :-)

> 1. Is there a good reference source for the old deprecated methods? I
> looked up a few (eg. "scm_wta" and "scm_i_makinum") in the old manuals
> going back to 1.4 but didn't have any luck finding them. I can read the
> source, but some documentation would help!

The Guile 1.6 manual is still on-line here:

  http://www.gnu.org/software/guile/docs/docs-1.6/guile-ref/index.html

‘scm_i_makinum’ is basically ‘scm_from_int’.

‘scm_wta’ raises an error or a wrong-type-arg error (see
libguile/deprecated.c in Guile 2.0.)

> 2. Since scm_smob_free is deprecated, does that mean I can just replace
> a line like "return scm_smob_free(child_smob)" with "return 0;" and rest
> easy knowing the gc will take care of the details?

If all the memory associated with the SMOB is allocated with one of the
‘scm_gc’ functions, then ‘scm_smob_free’ and similar can all be
removed.  Likewise, SMOB ‘mark’ functions can be dismissed in that case
(info "(guile) Memory Blocks").

HTH,
Ludo’.




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

* Re: Porting guile-xlib
  2013-01-27 14:48 ` Mark Witmer
@ 2013-01-27 15:36   ` Mike Gran
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Gran @ 2013-01-27 15:36 UTC (permalink / raw)
  To: Mark Witmer; +Cc: guile-user@gnu.org

Hi Mark




> Am I safe to use "scm_from_int" in its place and other general SCM
> numeric functions instead of the immediate number ones? These seem to
> make up a large number of the deprecated functions in use by this
> library.

Basically yes.

But when converting a scheme integer back to a C integer with 
scm_to_int and associated functions, remember that they can throw an
error if your Guile number is too big to fit in the C representation.

-Mike



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

* Re: Porting guile-xlib
  2013-01-27 13:31 Porting guile-xlib Mark Witmer
  2013-01-27 14:48 ` Mark Witmer
  2013-01-27 14:50 ` Ludovic Courtès
@ 2013-01-27 19:14 ` Gabriel Schnoering
  2 siblings, 0 replies; 5+ messages in thread
From: Gabriel Schnoering @ 2013-01-27 19:14 UTC (permalink / raw)
  To: guile-user

Hi,

 > I'm interested in using guile-xlib to mess around with writing a window
 > manager.
Nice idea ! I really find its a missing feature.

Why don't you target xcb rather than xlib ?
It seems more modern (and more suited for guile ?).

Regards.

Le 27/01/2013 14:31, Mark Witmer a écrit :>
 > Hi all,
 >
 > I'm interested in using guile-xlib to mess around with writing a window
 > manager. However, it looks like my first task would be porting it to
 > Guile 2.0, since it's quite old (assuming some newer version isn't
 > floating around in the ether somewhere -- I'm looking at guile-xlib
 > 0.4).
 >
 > I haven't done anything like this before, so I'm seeking any wisdom
 > anyone out there might have on the subject. A couple specific questions
 > for now:
 >
 > 1. Is there a good reference source for the old deprecated methods? I
 > looked up a few (eg. "scm_wta" and "scm_i_makinum") in the old manuals
 > going back to 1.4 but didn't have any luck finding them. I can read the
 > source, but some documentation would help!
 >
 > 2. Since scm_smob_free is deprecated, does that mean I can just replace
 > a line like "return scm_smob_free(child_smob)" with "return 0;" and rest
 > easy knowing the gc will take care of the details?
 >
 > Thanks
 >
 > Mark Witmer
 >



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

end of thread, other threads:[~2013-01-27 19:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 13:31 Porting guile-xlib Mark Witmer
2013-01-27 14:48 ` Mark Witmer
2013-01-27 15:36   ` Mike Gran
2013-01-27 14:50 ` Ludovic Courtès
2013-01-27 19:14 ` Gabriel Schnoering

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