lilypond-user
[Top][All Lists]
Advanced

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

Modules (Was: Blah blah)


From: Hans Aberg
Subject: Modules (Was: Blah blah)
Date: Mon, 19 May 2008 19:02:40 +0200

On 19 May 2008, at 17:54, Han-Wen Nienhuys wrote:

My hope was to get to the discussion of using in Lilypond Haskell like a "import" construct, which I think might help LilyPond users, as opposed to
the current "\include", which I think is more like the C preprocessor
"#include", and is trickier to use.

While I agree sight-unseen that the Haskell mechanism is more elegant
than the C includes, the latter is a fairly simple mechanism, and
orthogonal to lilypond's namespace handling.  If you come up with any
improvements, you need to remember that it all has to also work with
guile's namespace handling in a logical way. Right now \paper and
\header introduce new scopes, and are implemented in terms of a Guile
module that import the top-level namespace.

I am aware of that, but I do not know Guile's module system. On thing I do not like with Haskell is that if one writes
  module A where
  f :: Int -> String
  f _ = "A.f"
---------------
  module B where
  import A
  f :: Int -> String
  f _ = "A.f"

  b :: Int -> String
  b = f
then this is an error, one has to write
  b = B.f
I would think more logical that if one is in the module B, names of it need not be qualified.

There is also a shortcoming when importing names unqualified: I think one cannot then easily choose some names to qualified and others not.

In Lilypond, I thought that perhaps it was such file setup problems that
causes problems for users.

While the include mechanism is clumsy, last time I looked the most
common complaint was lack of documentation.  This may have changed in
the last year due to GDP.  Where are when it comes to usability ?

My original reply was to Karl Hammar said:

I would be nice to be able to do like

  lilypond a.ly .. o.ly z.ly

i.e. treat a.ly .. o.ly as if they where included in z.ly, without
having to say so in z.ly.

to which I said it is not needed with the Haskell system. But I think there were some discussions about making it easier to share code, just set some local fonts.

  Hans






reply via email to

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