unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* scm interface public/private functions
@ 2003-04-23 18:12 Thamer Al-Harbash
  2003-04-23 22:32 ` Viktor Pavlenko
  2003-04-28 16:11 ` Rob Browning
  0 siblings, 2 replies; 3+ messages in thread
From: Thamer Al-Harbash @ 2003-04-23 18:12 UTC (permalink / raw)


Hi,

Like many other newish guile users I haven't used the gh
interface and am using the scm interface. The lack of
documentation has made me look at a lot of code to find what I
need from the new interface.

I understand the new interface is not documented because of
changes it may go through, however I'm weary of using the wrong
functions.

For example, should I be using scm_str2symbol() as opposed to
calling scm_mem2symbol()? Is there any convention in the code
that would point out what's intentionally a public interface and
what is private?

-- 
Thamer Al-Harbash            http://www.whitefang.com/
	(if (> pressure too-much-pressure)
		'flame 'work)


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


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

* Re: scm interface public/private functions
  2003-04-23 18:12 scm interface public/private functions Thamer Al-Harbash
@ 2003-04-23 22:32 ` Viktor Pavlenko
  2003-04-28 16:11 ` Rob Browning
  1 sibling, 0 replies; 3+ messages in thread
From: Viktor Pavlenko @ 2003-04-23 22:32 UTC (permalink / raw)
  Cc: guile-user

>>>>> "TAH" == Thamer Al-Harbash <tmh@whitefang.com> writes:

    TAH> For example, should I be using scm_str2symbol() as opposed to
    TAH> calling scm_mem2symbol()? Is there any convention in the code
    TAH> that would point out what's intentionally a public interface
    TAH> and what is private?

I believe scm_str2symbol and scm_mem2symbol is like strcpy and memcpy
etc.  -- use the one which suits you more.

-- 
Viktor


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


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

* Re: scm interface public/private functions
  2003-04-23 18:12 scm interface public/private functions Thamer Al-Harbash
  2003-04-23 22:32 ` Viktor Pavlenko
@ 2003-04-28 16:11 ` Rob Browning
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Browning @ 2003-04-28 16:11 UTC (permalink / raw)
  Cc: guile-user

Thamer Al-Harbash <tmh@whitefang.com> writes:

> For example, should I be using scm_str2symbol() as opposed to
> calling scm_mem2symbol()? Is there any convention in the code that
> would point out what's intentionally a public interface and what is
> private?

The convention for all new code is that anything prefixed with SCM_I_
or scm_i_ should be considered internal.  Use it at your own peril
(i.e. at the risk of future incompatibility).  This convention is now
fairly widely respected, though I'm certain there are still
exceptions.

With respect to scm_*2symbol, I believe those are both public
functions, so you may use either.  str2symbol presumes a null
terminated C string, and mem2symbol does not.  Not that you should
have to look at the source, but if you do, you'll see:

  SCM
  scm_str2symbol (const char *str)
  {
    return scm_mem2symbol (str, strlen (str));
  }

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


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


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

end of thread, other threads:[~2003-04-28 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-23 18:12 scm interface public/private functions Thamer Al-Harbash
2003-04-23 22:32 ` Viktor Pavlenko
2003-04-28 16:11 ` Rob Browning

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