guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with modules in Guile 2.0


From: Gubinelli Massimiliano
Subject: Re: Problem with modules in Guile 2.0
Date: Tue, 13 Mar 2012 02:10:51 +0100

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=$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)

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

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 <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]