chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Re: [ANN] New egg: Object-relation mapper Pandora


From: Peter Bex
Subject: Re: [Chicken-users] Re: [ANN] New egg: Object-relation mapper Pandora
Date: Thu, 20 Aug 2009 21:11:34 +0200
User-agent: Mutt/1.4.2.3i

On Thu, Aug 20, 2009 at 08:38:39PM +0200, Thomas Chust wrote:
> > [...]
> > The *.import.scm files can be deleted from version control.  Your setup
> > file already generates them with the -j switch, which means they are
> > overwritten every time pandora is compiled.
> 
> No, they shouldn't be deleted and no, they are not generated by the
> setup script!

Oops, I guess I overlooked that.  I guess that's why Chicken didn't fail
on compilation but just gave a warning ;)

> I admit that this use of import libraries in unorthodox, but it should
> not be problematic unless the names of the procedures imported ad used
> from the database driver eggs change, in which case the Pandora
> backends have to be adapted anyway.

It sounds very brittle.  Perhaps Felix can enlighten us to whether it's
a good idea to do it like this?

> Experience shows that nearly
> every egg for CHICKEN 4 comes *without* any locally installable
> documentation, probably because the automatic generation and/or
> bundling with the rest of the egg doesn't work.

If this is the case, that is a bug and should be reported and fixed in
the place where the docs are supposed to be generated!

> I also like to keep
> the HTML files under version control, even though they are generated,
> because I want to be able to exactly reproduce the files that went
> into a specific tagged version of the egg, if necessary.

Fair enough.

> Hmm, the Makefile generating the .setup file was the easiest way I
> could think of to spare myself from having to change version numbers
> and compiler flags in more than one place.

.setup files are Scheme scripts.  You can just do something like:

(define egg-version "1.0.0")

(install-extension
  'pandora
  '("pandora.so" "pandora.import.so" "pandora-static.o")
  `((version ,egg-version)))

...

Making the flags customisable is a little harder, because COMPILE is
a macro, but it can also be done.  Perhaps this works:
*WARNING, untested code*

(define-syntax compile/flags
  (syntax-rules ()
      ((_ args ...)
       (compile -O2 -d1 args ...))))
(compile/flags -s "pandora.scm" -j "pandora")
...

> The Makefile is also
> convenient to regenerate the HTML documentation and to package up an
> .egg file for my own website. What's so weird about saving work in the
> development and build process using a Makefile?

It's not weird for C programs, but this is Scheme, a dynamic language.
If Scheme is not up for the job, something's definitely wrong!

> As long as I'm allowed to defend my weird coding practices against the
> nitpicking, that's fine with me ;-)

Of course! I even learned a thing or two from this.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgpS0YwnRzz4T.pgp
Description: PGP signature


reply via email to

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