unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Bruce Korb <bkorb@veritas.com>
Cc: Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: Re-addition of deprecated stuff to 1.7.
Date: Sun, 01 Jun 2003 12:56:44 -0700	[thread overview]
Message-ID: <3EDA5A7C.D0FB7603@veritas.com> (raw)
In-Reply-To: 878yslps9q.fsf@zagadka.ping.de

[-- Attachment #1: Type: text/plain, Size: 3912 bytes --]

Marius Vollmer wrote:

> I'd say it is a trade-off between how much pain you are willing to
> inflict upon your clients and how much pain you are willing to suffer
> yourself.
> 
> I think (and hope) it is entirely tolerable to require you clients to
> install Guile 1.6 when they want to compile your code.

As the author of a piece of code that is relatively obscure,
it is tough enough to get it test-driven, let alone test-driven
after they have had to upgrade something else.  Current distributions
are still using 1.4 (leastwise the latest Red Hat 7.x and SuSE 8.1
use it).  These releases are not even a year old yet.  It *will*
be a couple of years before it is reasonable to expect all potential
clients to have 1.6.

> > May I please encourage you to supply configury stuff that is capable
> > of adapting current interfaces to old Guiles?
> 
> Too much work for too little gain, I'd say.  Instead, we should make
> it as easy as possible to install Guile 1.6 so that there is no reason
> not to have it on ones system.

I sent some macros, tho I coded around the need to use it myself.

> These configure snippets might be collected in a central place, maybe,
> when people are willing to maintain such a thing.

That's what I was suggesting...

> But given the above, I think it is OK to just fail and require Guile
> 1.6.

Too early.

> There are two [main] reasons... to want stability in an interface:
> one is that your code works unchanged with multiple
> versions/implementations of the other side of the API, another is that
> you don't want to do the work of tracking the changes in an API.

> In my opinion, the first reason is not very valid for Guile; there
> should be no reason to require some code to compile _unchanged_
> against multiple versions of Guile.  When there are such reasons, we
> should work to remove the reasons, not to make it easier to compile
> _unchanged_.

I don't want to really say, "unchanged".  I do want to say
that the compatibility glue is important.  I am now developing against
1.6.  However, as much as you would like to see 1.4 retired,
the bulk of the distributions at this time have 1.4.  I need
to be able to jigger what I use so it can adapt to whatever
is locally installed.  By the time the bulk of installations
are running 1.6, you'll be shipping 1.8 and using the same arguments.

> Note the emphasis on _unchanged_.  Not wanting to do much work when
> tracking API changes is a very good position to take.

I'm taking both positions (I get to, I'm not developing Guile ;-).
But I'm also willing to share what I've done.  (Attached are two
configury macros.  One to find libguile, even on systems where
guile-config was omitted [Red Hat], the other to detect 1.4 systems
and provide #define glue for scm_eval_x and scm_port.)

> When changing
> the Guile API, we should make it in such a way that client code needs
> to change as little as possible.  This often means that it doesn't
> need to change at all.  However, it is not an unbreakable requirement
> that client code must continue to compile with all new versions of
> Guile.

That's a little extreme.  OTOH, when you retire ``scm_port'' you
could also add:

  #if (THE_LAST_GUILE_VERSION_I_KNEW_ABOUT < GUILE_VERSION_1_6)
  #  define  scm_port scm_t_port
  #endif

and delete that code only after 1.6 has been in the major distros
for a couple of years.  The Guile version I understand is a
mix of 1.4 and 1.6 'cuz I'm transitioning.  The attached configury
checks for 1.4 and does the reverse #define:

  /* Define this if no scm_t_port */
  #define scm_t_port scm_port

> It is of course good practice to minimize the needed changes,

I'm sure you do your best.  One's best cannot ever be perfect.

> > P.S. If _anyone_ can show me how to set the string port file
> > name and line number, I *sure* would be a happy camper.
> 
> I'm getting to that in a few minutes... :-)

Cool.  :-D

[-- Attachment #2: libguile.m4 --]
[-- Type: text/plain, Size: 5035 bytes --]


AC_DEFUN([AG_WITHLIB_GUILE],[
  AC_ARG_WITH([libguile],
    AC_HELP_STRING([--with-libguile], [libguile installation prefix]),
    [ag_cv_with_libguile_root=${with_libguile}],
    AC_CACHE_CHECK([whether with-libguile was specified], ag_cv_with_libguile_root,
      ag_cv_with_libguile_root=no)
  ) # end of AC_ARG_WITH libguile

  if test "${with_libguile+set}" = set && \
     test "${withval}" = no
  then ## disabled by request
    ag_cv_with_libguile_root=no
    ag_cv_with_libguile_cflags=no
    ag_cv_with_libguile_libs=no
  else

  AC_ARG_WITH([libguile-cflags],
    AC_HELP_STRING([--with-libguile-cflags], [libguile compile flags]),
    [ag_cv_with_libguile_cflags=${with_guile_cflags}],
    AC_CACHE_CHECK([whether with-libguile-cflags was specified], ag_cv_with_libguile_cflags,
      ag_cv_with_libguile_cflags=no)
  ) # end of AC_ARG_WITH libguile-cflags

  AC_ARG_WITH([libguile-libs],
    AC_HELP_STRING([--with-libguile-libs], [libguile link command arguments]),
    [ag_cv_with_libguile_libs=${with_guile_libs}],
    AC_CACHE_CHECK([whether with-libguile-libs was specified], ag_cv_with_libguile_libs,
      ag_cv_with_libguile_libs=no)
  ) # end of AC_ARG_WITH libguile-libs

  case "X${ag_cv_with_libguile_cflags}" in
  Xyes|Xno|X )
    case "X${ag_cv_with_libguile_root}" in
    Xyes|Xno|X ) ag_cv_with_libguile_cflags=no ;;
    * )        ag_cv_with_libguile_cflags=-I${ag_cv_with_libguile_root}/include ;;
    esac
  esac
  case "X${ag_cv_with_libguile_libs}" in
  Xyes|Xno|X )
    case "X${ag_cv_with_libguile_root}" in
    Xyes|Xno|X ) ag_cv_with_libguile_libs=no ;;
    * )        ag_cv_with_libguile_libs="-L${ag_cv_with_libguile_root}/lib -lguile";;
    esac
  esac
  ag_save_CPPFLAGS="${CPPFLAGS}"
  ag_save_LIBS="${LIBS}"
  case "X${ag_cv_with_libguile_cflags}" in
  Xyes|Xno|X )
    f=`guile-config compile 2>/dev/null` || f=''
    test -n "${f}" && ag_cv_with_libguile_cflags="${f}" && \
      AC_MSG_NOTICE([guile-config used for CFLAGS: $f]) ;;
  esac
  case "X${ag_cv_with_libguile_libs}" in
  Xyes|Xno|X )
    f=`guile-config link 2>/dev/null` || f=''
    test -n "${f}" && ag_cv_with_libguile_libs="${f}" && \
      AC_MSG_NOTICE([guile-config used for LIBS: $f]) ;;
  esac
  fi ## disabled by request

  case "X${ag_cv_with_libguile_cflags}" in
  Xyes|Xno|X )
    ag_cv_with_libguile_cflags="" ;;
  * ) CPPFLAGS="${CPPFLAGS} ${ag_cv_with_libguile_cflags}" ;;
  esac
  case "X${ag_cv_with_libguile_libs}" in
  Xyes|Xno|X )
    LIBS="${LIBS} -lguile"
    ag_cv_with_libguile_libs="-lguile" ;;
  * )
    LIBS="${LIBS} ${ag_cv_with_libguile_libs}" ;;
  esac
  LIBGUILE_CFLAGS=""
  LIBGUILE_LIBS=""
  AC_MSG_CHECKING([whether libguile can be linked with])
  AC_CACHE_VAL([ag_cv_with_libguile],[
  AC_LINK_IFELSE([[@%:@include <guile/gh.h>
@%:@include <libguile.h>
int main () {
  SCM fumble, bumble, stumble;
  stumble = scm_cons( fumble, bumble );
  stumble = scm_display( fumble, bumble );
  stumble = scm_ilength( fumble );
  stumble = scm_makstr( 1, 2 );
  stumble = gh_eval_str( "stumble" );
  scm_misc_error( "oops", "bad", bumble );
  stumble = scm_num_eq_p( fumble, bumble );
  scm_wrong_type_arg( "oops", 1, bumble );
  return 0; }]],
    [ag_cv_with_libguile=yes],
    [ag_cv_with_libguile=no]) # end of AC_LINK_IFELSE 
  ]) # end of AC_CACHE_VAL for ag_cv_with_libguile
  AC_MSG_RESULT([${ag_cv_with_libguile}])
    AC_SUBST([LIBGUILE_CFLAGS])
    AC_SUBST([LIBGUILE_LIBS])
    AC_SUBST([LIBGUILE_PATH])

  if test "X${ag_cv_with_libguile}" != Xno
  then[
      LIBGUILE_CFLAGS="${ag_cv_with_libguile_cflags}"
      LIBGUILE_LIBS="${ag_cv_with_libguile_libs}"
      case "${LIBGUILE_LIBS}" in *-L* )
        LIBGUILE_PATH=`echo ${LIBGUILE_LIBS} | sed 's/.*-L[ 	]*//;s/[ 	].*//'`
      ;; * ) LIBGUILE_PATH='' ;; esac]
      CPPFLAGS="@S|@{ag_save_CPPFLAGS}"
  LIBS="@S|@{ag_save_LIBS}"
  else
    CPPFLAGS="${ag_save_CPPFLAGS}"
    LIBS="${ag_save_LIBS}"
      LIBGUILE_CFLAGS=''
      LIBGUILE_LIBS=''
      LIBGUILE_PATH=''
      AC_MSG_ERROR([Cannot find working libguile])
  fi
  AC_SUBST([AG_GUILE])
  
]) # end of AC_DEFUN of AG_WITHLIB_GUILE


AC_DEFUN([AG_LINK_EVAL_STRING],[
  AC_MSG_CHECKING([whether scm_primitive_eval_x links])
  AC_CACHE_VAL([ag_cv_link_eval_string],[
    ag_save_CPPFLAGS="${CPPFLAGS}"
    CPPFLAGS="${ag_cv_with_libguile_cflags} ${CPPFLAGS}"
    ag_save_LIBS="${LIBS}"
    LIBS="${ag_cv_with_libguile_libs} ${LIBS}"
  AC_TRY_LINK([@%:@include <guile/gh.h>
@%:@include <libguile.h>],
    [SCM res = scm_primitive_eval_x( SCM_UNDEFINED );],
    [ag_cv_link_eval_string=yes],[ag_cv_link_eval_string=no]
  ) # end of TRY_LINK
    CPPFLAGS="${ag_save_CPPFLAGS}"
    LIBS="${ag_save_LIBS}"
  ]) # end of AC_CACHE_VAL for ag_cv_link_eval_string
  AC_MSG_RESULT([${ag_cv_link_eval_string}])

  if test "X${ag_cv_link_eval_string}" = Xno
  then
    AC_DEFINE([scm_primitive_eval_x], [scm_eval_x],
        [Define this if no scm_primitive_eval_x])
AC_DEFINE([scm_t_port], [scm_port], [Define this if no scm_t_port])
  fi
  
]) # end of AC_DEFUN of AG_LINK_EVAL_STRING

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

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

  reply	other threads:[~2003-06-01 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-26 18:04 Re-addition of deprecated stuff to 1.7 Marius Vollmer
2003-04-26  8:31 ` Neil Jerram
2003-05-17 17:22   ` Marius Vollmer
2003-05-17 17:47     ` Rob Browning
2003-05-17 17:57       ` Marius Vollmer
2003-05-17 18:12     ` Bruce Korb
2003-06-01 18:27       ` Marius Vollmer
2003-06-01 19:56         ` Bruce Korb [this message]
2003-06-09 19:46           ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EDA5A7C.D0FB7603@veritas.com \
    --to=bkorb@veritas.com \
    --cc=neil@ossau.uklinux.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).