From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gubinelli Massimiliano Newsgroups: gmane.lisp.guile.user Subject: Re: Problem with modules in Guile 2.0 Date: Tue, 13 Mar 2012 02:10:51 +0100 Message-ID: <657CFD3F-5D6D-41DD-930C-CE42EE4084B7@gmail.com> References: <54183C89-DE93-417E-84EC-5C454E56EE35@gmail.com> <87eht4yww5.fsf@pobox.com> <79B073AF-B3A8-46E0-A047-C4F5686E167E@gmail.com> <87obs7vojn.fsf@netris.org> <87r4x1spox.fsf@netris.org> <98C676BD-A7F7-47C7-B837-5E7FB6C30231@gmail.com> <87ehsyrhyn.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: multipart/alternative; boundary="Apple-Mail=_F39E1482-2CE3-4153-9919-62C14DC84819" X-Trace: dough.gmane.org 1331601068 28526 80.91.229.3 (13 Mar 2012 01:11:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2012 01:11:08 +0000 (UTC) Cc: guile-user@gnu.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Mar 13 02:11:07 2012 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S7GGZ-0000x9-ER for guile-user@m.gmane.org; Tue, 13 Mar 2012 02:11:07 +0100 Original-Received: from localhost ([::1]:45890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7GGY-0005aU-Nf for guile-user@m.gmane.org; Mon, 12 Mar 2012 21:11:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7GGT-0005aF-A9 for guile-user@gnu.org; Mon, 12 Mar 2012 21:11:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7GGQ-0002PN-H3 for guile-user@gnu.org; Mon, 12 Mar 2012 21:11:00 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:49559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7GGQ-0002PE-3r for guile-user@gnu.org; Mon, 12 Mar 2012 21:10:58 -0400 Original-Received: by werj55 with SMTP id j55so8554wer.0 for ; Mon, 12 Mar 2012 18:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=CaLanF0jpfjig69sTWgVl6zqlbtHk5Vw1Tr2jZP6iis=; b=PB6WHoiUI64CN3AjIrHou4nbLR+rt66L+5o7Pj+I+BbJzRxZAW2CaGYn9MdBU/3bU6 crRp5agEExzk/Cmed9rf3/YC62H/xdiEDxaLzlPwgvild3QpAFUvTu/Ixyy2EsLo+2MO EHQugP1PL7VTNhEDUaz96f6hNBCfrDp2TdccPoeYcO39YDmjVN7/kl40saNuGoqvP/qF uD3X5z1S3uIRg71TGvCKOmV/5X5LjFd//5z2VmnKuXQSoK9dIfqkG7UzP3O3hixYUnej XaMjWAqwNN+9nLr6xM5MhYDdTklLvVrLEsw3vxeZfdchlSbZqFaAYXCE8nVaG8uJmjrI 6/uQ== Original-Received: by 10.180.95.197 with SMTP id dm5mr2510694wib.20.1331601054866; Mon, 12 Mar 2012 18:10:54 -0700 (PDT) Original-Received: from [192.168.0.11] (mor75-3-78-192-22-137.fbxo.proxad.net. [78.192.22.137]) by mx.google.com with ESMTPS id gp8sm38646406wib.5.2012.03.12.18.10.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Mar 2012 18:10:54 -0700 (PDT) In-Reply-To: <87ehsyrhyn.fsf@netris.org> X-Mailer: Apple Mail (2.1257) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9339 Archived-At: --Apple-Mail=_F39E1482-2CE3-4153-9919-62C14DC84819 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Mark, I've update the svn repository and now the build process should = recognize Guile 2.0. To build TeXmacs you will need the Qt framework, = freetype and of course Guile. A standard ./configure --enable-qt make should suffice. You car run TeXmacs without installing by telling it = where to find resources. Assuming you are=20 in the source directory, after the make the executable is to be found in = TeXmacs/bin, so the followng is enough TEXMACS_PATH=3D$PWD/TeXmacs TeXmacs/bin/texmacs.bin Scheme scripts are in TeXmacs/progs.=20 The custom module macro is defined in kernel/boot/boot.scm TeXmacs functions are defined via the tm-define macro defined in = kernel/texmacs/tm-define.scm=20 An example of contextual overloading allowed by tm-define : (from = kernel/math/math-edit.scm:44) (tm-define (kbd-enter t shift?) (:require (tree-is? t 'equation)) (go-end-of 'equation) (insert-return)) here we redefine the function kdb-enter in the case the :require = condition results #t. The new definition is simply added by the = tm-define macro at the top of the previous with a conditional statement. = I do not know if this can cause interferences with compilation.=20 General documentation about TeXmacs is written in the TeXmacs document = format and you can find it in the TeXmacs help menu (Help->Scheme = extensions). The documentation on the main web page (www.texmacs.org) = does not contain the chapters about the scheme interface.=20 Maybe we should continue this discussion in private, without polluting = the mailing list. Massimiliano On Mar 11, 2012, at 9:38 PM, Mark H Weaver wrote: > Gubinelli Massimiliano writes: >>> Why not convert your scripts to use the standard Guile module = syntax? >>=20 >> TeXmacs is currently composed of 250 scheme files for \sim 60000 = lines >> of scheme. >=20 > Fair enough. I see no obstacle to adapting the TeXmacs module system = to > work with Guile 2. It's just a matter of finding the cleanest way to > implement it. >=20 >> It has a slightly customized module system and features contextual >> overloading of functions (a function can be redefined to act >> differently is some condition is met without modifying the module >> which implemented the base behaviour). We would like to preserve the >> current system as much as possible. >=20 > Can you provide some specific examples of this contextual overloading = of > functions, so that I might understand this feature more clearly? > Pointers to relevant documentation would also be helpful. >=20 >> With the current svn you will not be able to build TeXmacs with Guile >> 2.0. If you are interested in that I will tell you how to do. >=20 > Please do. I would like to try to build TeXmacs with Guile 2, so that = I > may better help you with the transition to Guile 2. >=20 > Thanks, > Mark --Apple-Mail=_F39E1482-2CE3-4153-9919-62C14DC84819 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi = Mark,

 I've update the svn repository and now = the build process should recognize Guile 2.0. To build TeXmacs you will = need the Qt framework, freetype and of course Guile. = A standard

./configure = --enable-qt
make

should suffice. You = car run TeXmacs without installing by telling it where to find = resources. Assuming you are 
in the source directory, = after the make the executable is to be found in TeXmacs/bin, so the = followng is enough

TEXMACS_PATH=3D$PWD/TeXmacs = TeXmacs/bin/texmacs.bin

Scheme scripts are in = TeXmacs/progs. 

The custom module macro is = defined in kernel/boot/boot.scm
TeXmacs functions are defined = via the tm-define macro defined in = kernel/texmacs/tm-define.scm 

An example = of contextual overloading allowed by tm-define : (from = kernel/math/math-edit.scm:44)

  (:require (tree-is? t 'equation))
  (go-end-of 'equation)
  = (insert-return))

here we redefine the = function kdb-enter in the case the :require condition results #t. The = new definition is simply added by the tm-define macro at the top of the = previous with a conditional statement. I do not know if this can = cause interferences with = compilation. 

General documentation about = TeXmacs is written in the TeXmacs document format and you can find it in = the TeXmacs help menu (Help->Scheme extensions). The documentation on = the main web page (www.texmacs.org)= does not contain the chapters about the scheme = interface. 

Maybe we should continue this = discussion in private, without polluting the mailing = list.

Massimiliano

=
On Mar 11, 2012, at 9:38 PM, Mark H Weaver wrote:

Gubinelli Massimiliano <m.gubinelli@gmail.com> = writes:
Why not = convert your scripts to use the standard Guile module = syntax?

TeXmacs is = currently composed of 250 scheme files for \sim 60000 = lines
of = scheme.

Fair enough.  I see no obstacle to = adapting the TeXmacs module system to
work with Guile 2.  It's = just a matter of finding the cleanest way to
implement = it.

It has a slightly customized module = system and features contextual
overloading of functions (a function can be redefined to = act
differently is some = condition is met without modifying the = module
which implemented the = base behaviour). We would like to preserve = the
current system as much as = possible.

Can you provide some specific examples of = this contextual overloading of
functions, so that I might understand = this feature more clearly?
Pointers to relevant documentation would = also be helpful.

With the current svn = you will not be able to build TeXmacs with = Guile
2.0. If you are = interested in that I will tell you how to do.

Please = do.  I would like to try to build TeXmacs with Guile 2, so that = I
may better help you with the transition to Guile 2.

=     Thanks,
=       Mark

<= /div>= --Apple-Mail=_F39E1482-2CE3-4153-9919-62C14DC84819--