guile-user
[Top][All Lists]
Advanced

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

modules, 2nd try.


From: Han-Wen Nienhuys
Subject: modules, 2nd try.
Date: Wed, 18 Sep 2002 00:18:07 +0200

After getting no response on the devel list, let me try once more,
over here. I want to move the input -identifier mechanism in LilyPond
over to Scheme. Currently, people can do


        %identifier = ... defines a variable 
        variableOne = 5.0
        \score {

               ..music..

               \paper  {
                       % The paper block introduces a new scope.

                       variableTwo = 5.0\cm

                       % \identifier references a variable.
                       linewidth = \variableOne * \variableTwo
               }
        }
       % variableTwo not visible here.
        

I want to move this to Scheme to get more flexibility, without having
to bother with programming language design: identifiers should become
Scheme variables, and should be available in Scheme functions. In the
future, it should be possible to do

        %identifier = ... defines a variable
        variableOne = 5.0

        \score {

               ..music..

               \paper  {
                       variableTwo = 5.0\cm

                       %  #... introduces inline Scheme. 
                       linewidth = #(* variableOne variableTwo)
               }
        }

In terms of code, I want to create sets of bindings. The sets should
be nested, and available to the Scheme evaluator.

How do I do this?  I tried mucking about with modules, but I can't
even get the basic functionality working, and they seem a bad match
with my wishes, since definitions in modules are private by default,
and the name spaces are not nested.

How do I go about this?

--
Han-Wen Nienhuys   |   address@hidden   |   http://www.cs.uu.nl/~hanwen 




reply via email to

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