[Top][All Lists]
[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
- Re: *.mid vs *.midi, (continued)
- Message not available
- Message not available
- Message not available
- Re: *.mid vs *.midi, Hans Aberg, 2008/05/19
- Re: *.mid vs *.midi, immanuel litzroth, 2008/05/19
- Message not available
- Re: *.mid vs *.midi, Hans Aberg, 2008/05/19
- Re: *.mid vs *.midi, Mats Bengtsson, 2008/05/19
- Re: *.mid vs *.midi, Hans Aberg, 2008/05/19
- Haskell module design [was Re: *.mid vs *.midi], Trevor Daniels, 2008/05/19
- Re: Haskell module design, Hans Aberg, 2008/05/19
- Re: *.mid vs *.midi, Han-Wen Nienhuys, 2008/05/19
- Modules (Was: Blah blah),
Hans Aberg <=
- Re: Modules (Was: Blah blah), Han-Wen Nienhuys, 2008/05/19
- Compilation setup (Was: Modules), Hans Aberg, 2008/05/20
- Re: *.mid vs *.midi, Graham Percival, 2008/05/19
- Re: *.mid vs *.midi, Valentin Villenave, 2008/05/19
- Message not available
- Re: *.mid vs *.midi, Hans Aberg, 2008/05/19
- Re: *.mid vs *.midi, immanuel litzroth, 2008/05/19
- initial .ly files [was Re: *.mid vs *.midi], Karl Hammar, 2008/05/17
- Re: initial .ly files [was Re: *.mid vs *.midi], Nicolas Sceaux, 2008/05/17
- Re: initial .ly files [was Re: *.mid vs *.midi], Karl Hammar, 2008/05/18
- Re: initial .ly files [was Re: *.mid vs *.midi], Hans Aberg, 2008/05/17