guile-devel
[Top][All Lists]
Advanced

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

New command line option --use-srfi


From: Martin Grabmueller
Subject: New command line option --use-srfi
Date: Tue, 15 May 2001 22:07:06 +0200

Hello list,

I have modified libguile/script.c and ice-9/boot-9.scm to support the
new command line option `--use-srfi', which enables SRFI loading on
startup.

The option is given a list of integers, which are the numbers of the
SRFI modules to be loaded.  The SRFI modules are loaded, imported into
the module (guile) and the corresponding feature identifers are added
to the feature list examined by `cond-expand'.

Examples:

address@hidden (~/cvs/guile/guile-core/libguile): ./guile --use-srfi=2
guile> (cond-expand (srfi-2 #t) (else #f))
#t
guile> (cond-expand (srfi-11 #t) (else #f))
#f
guile> (cond-expand ((or srfi-2 srfi-11) #t) (else #f))
#t
guile> C-d
address@hidden (~/cvs/guile/guile-core/libguile): ./guile --use-srfi=2,13
guile> and-let*
#<macro! and-let*>
guile> (string-pad "foo" 20 #\!)
"!!!!!!!!!!!!!!!!!foo"
guile> C-d
address@hidden (~/cvs/guile/guile-core/libguile):

This was the first time I was hacking the option parsing stuff, so if
you could have a look, feedback would be much appreciated.

While implementing this, I thought about generalizing this idea to add
a command line option for using modules.  I have not done that because
I don't know whether it's useful, and because the SRFI stuff needs
some special treatment to work with `cond-expand'.  A possibility
would be to invent a command line option for using modules on startup,
and let the SRFI modules register themselves with `cond-expand' on
their own.  

But anyway, I have not thought enough about that, and the new option
seems clean and works well, hopefully.  I'm open for improvements and
suggestions.

Regards,
  'martin



reply via email to

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