guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile ChangeLog script.c


From: Martin Grabmueller
Subject: guile/guile-core/libguile ChangeLog script.c
Date: Tue, 15 May 2001 13:12:10 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Martin Grabmueller <address@hidden>     01/05/15 13:12:10

Modified files:
        guile-core/libguile: ChangeLog script.c 

Log message:
        * script.c (scm_compile_shell_switches): New command line option
        `--use-srfi' for loading a list of SRFIs on startup.
        (scm_shell_usage): Added `--use-srfi' to help message.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/ChangeLog.diff?cvsroot=OldCVS&tr1=1.1393&tr2=1.1394&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/script.c.diff?cvsroot=OldCVS&tr1=1.39&tr2=1.40&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1393 
guile/guile-core/libguile/ChangeLog:1.1394
--- guile/guile-core/libguile/ChangeLog:1.1393  Tue May 15 07:57:47 2001
+++ guile/guile-core/libguile/ChangeLog Tue May 15 13:12:09 2001
@@ -1,3 +1,9 @@
+2001-05-15  Martin Grabmueller  <address@hidden>
+
+       * script.c (scm_compile_shell_switches): New command line option
+       `--use-srfi' for loading a list of SRFIs on startup.
+       (scm_shell_usage): Added `--use-srfi' to help message.
+
 2001-05-10  Marius Vollmer  <address@hidden>
 
        Merge from mvo-vcell-clenaup-1-branch.
Index: guile/guile-core/libguile/script.c
diff -u guile/guile-core/libguile/script.c:1.39 
guile/guile-core/libguile/script.c:1.40
--- guile/guile-core/libguile/script.c:1.39     Tue May 15 07:57:20 2001
+++ guile/guile-core/libguile/script.c  Tue May 15 13:12:10 2001
@@ -384,6 +384,8 @@
            "  --debug        start with debugging evaluator and backtraces\n"
           "  -q             inhibit loading of user init file\n"
            "  --emacs        enable Emacs protocol (experimental)\n"
+          "  --use-srfi=LS  load SRFI modules for the SRFIs in LS,\n"
+          "                 which is a list of numbers like \"2,13,14\"\n"
            "  -h, --help     display this help and exit\n"
            "  -v, --version  display version information and exit\n"
           "  \\              read arguments from following script lines\n",
@@ -402,6 +404,7 @@
 SCM_SYMBOL (sym_load_user_init, "load-user-init");
 SCM_SYMBOL (sym_top_repl, "top-repl");
 SCM_SYMBOL (sym_quit, "quit");
+SCM_SYMBOL (sym_use_srfis, "use-srfis");
 
 
 /* Given an array of command-line switches, return a Scheme expression
@@ -532,6 +535,43 @@
 
       else if (! strcmp (argv[i], "-q")) /* don't load user init */ 
        inhibit_user_init = 1;
+
+      else if (! strncmp (argv[i], "--use-srfi=", 11)) /* load SRFIs */ 
+       {
+         SCM srfis = SCM_EOL;  /* List of requested SRFIs.  */
+         char * p = argv[i] + 11;
+         while (*p)
+           {
+             long num;
+             char * end;
+
+             num = strtol (p, &end, 10);
+             if (end - p > 0)
+               {
+                 srfis = scm_cons (scm_long2num (num), srfis);
+                 if (*end)
+                   {
+                     if (*end == ',')
+                       p = end + 1;
+                     else
+                       scm_shell_usage (1, "invalid SRFI specification");
+                   }
+                 else
+                   break;
+               }
+             else
+               scm_shell_usage (1, "invalid SRFI specification");
+           }
+         if (scm_ilength (srfis) <= 0)
+           scm_shell_usage (1, "invalid SRFI specification");
+         srfis = scm_reverse_x (srfis, SCM_UNDEFINED);
+         tail = scm_cons (scm_listify
+                          (sym_use_srfis,
+                           scm_listify (scm_sym_quote, 
+                                        srfis, SCM_UNDEFINED),
+                           SCM_UNDEFINED),
+                          tail);
+       }
 
       else if (! strcmp (argv[i], "-h")
               || ! strcmp (argv[i], "--help"))



reply via email to

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